Hi...can someone help me add this function script into my npc..i've tried so many times but it doesn't work.
- script Sample -1,{
function GetString;
OnPCLoginEvent:
switch( rand(2) ){
Case 0:
set .@String$,GetString( 15,rand(5,10) );
mes "Input the ^FF0000RED COLOUR^000000 part";
mes "^0000FF"+GetString( 15,rand(5,10) )+"^FF0000"+.@String$+"^0000FF"+GetString( 15,rand(3,10) )+"^000000";
input .@Input$;
if( .@Input$ != .@String$ ){
mes "Wrong..";
atcommand "@kick "+strcharinfo(0);
}
break;
Case 1:
set .@A,rand(1000);
set .@B,rand(1000);
mes "If A = "+.@A+" B = "+.@B;
switch( rand(4) ){
Case 0:
set .@Answer,.@A + .@B;
mes "How many is A + B ?";
break;
Case 1:
set .@Answer,.@A - .@B;
mes "How many is A - B ?";
break;
Case 2:
set .@Answer,.@A * .@B;
mes "How many is A * B ?";
break;
Case 3:
set .@Answer,.@A / .@B;
mes "How many is A / B ?";
break;
}
input .@Input;
if( .@Input != .@Answer ){
mes "Wrong";
atcommand "@kick "+strcharinfo(0);
}
break;
}
close;
function GetString {
if( getarg(0) & 1 ) setarray .@List$[ getarraysize( .@List$ ) ],"1","2","3","4","5","6","7","8","9";
if( getarg(0) & 2 ) setarray .@List$[ getarraysize( .@List$ ) ],"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z";
if( getarg(0) & 4 ) setarray .@List$[ getarraysize( .@List$ ) ],"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z";
if( getarg(0) & 8 ) setarray .@List$[ getarraysize( .@List$ ) ],"!","@","#","$","%","^","&","*","(",")","-","=","/","+";
set .@Str$,"";
while( getstrlen( .@Str$ ) < getarg(1) )
set .@Str$,.@Str$ + .@List$[ rand( getarraysize( .@List$ ) ) ];
return .@Str$;
}
}
And this is my npc script which i want to edit the function part :
function script AntiBot1 {
setarray .@Alphabet$[getarraysize(.@Alphabet$)],"1","2","3","4","5","6","7","8","9","0";
set .@NameLength,rand(4,5);
for( set .@i,0; .@i < .@NameLength; set .@i,.@i + 1 )
set .@GeneratedName$,.@GeneratedName$ + .@Alphabet$[ rand( getarraysize( .@Alphabet$ ) ) ];
mes "Please input ^FF0000RED^000000 security number [19^FF0000"+.@GeneratedName$+"^00000043]";
atcommand "@fakename "+.@GeneratedName$;
input .@Input$;
if( .@Input$ != .@GeneratedName$ ){
mes "WRONG";
atcommand "@Fakename";
close;
}
atcommand "@Fakename";
return;
}
Welgaia,87,149,5 script Farming Room 871,{
mes "[Game Master]";
mes "Hello, "+strcharinfo(0)+" I'm Game Master.";
next;
mes "Solve Antibot";
callfunc "AntiBot1";
next;
menu "Poring Coin Room",O_Damn;
O_Rule:
mes "[Game Master]";
mes "Gold Room";
next;
warp "ordeal_3-2",29,152;
L_All:
announce "Game Master: "+strcharinfo(0)+" Enter Gold Room",0;
close;
close;
O_Damn:
mes "[Game Master]";
mes "Farming Room";
next;
warp "bat_c02",82,101;
L_Blue:
announce "Game Master: "+strcharinfo(0)+" Enter Poring Coin Room",0;
close;
close;
LCancel:
mes "[Game Master]";
mes "Ygg Seed Room";
next;
warp "ordeal_2-2",26,153;
L_Red:
announce "Game Master: "+strcharinfo(0)+" Enter Ygg Seed Room",0;
close;
close;
OnInit:
waitingroom "Hunt Poring Coin!",0;
end;
}
bat_c02,82,101,6 script Game Master 759,{
mes "[Game Master]";
mes "Hello, "+strcharinfo(0)+" I'm Game Master.";
next;
menu "Free Buff",F_Buff,"Heal Me",Heal_Me,"Main Town",M_To;
F_Buff:
percentheal 100,100;
skilleffect 34,0; sc_start SC_BLESSING,360000,10;
skilleffect 29,0; sc_start SC_INCREASEAGI,360000,10;
specialeffect2 300;
emotion e_kis;
close;
Heal_Me:
percentheal 100,100;
close;
M_To:
mes "Hello, "+strcharinfo(0)+" Wanna Go Main Town.";
next;
mes "Bye!!";
warp "Welgaia",156,101;
close;
OnInit:
waitingroom "Farming Room",0;
end;
}
// ---- Monsters for the Farming Room
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,50,1000,1100
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,80,300,330
bat_c02,0,0,0,0 monster Kill Me Please! 1815,500,300,330
//bat_c02,0,0,0,0 monster Kill Me Please! 1904,10,2000,2200
// mapflag //
bat_c02 mapflag nosave SavePoint
bat_c02 mapflag noexp
bat_c02 mapflag noskill
bat_c02 mapflag nomemo
bat_c02 mapflag nobranch
bat_c02 mapflag nopvp
bat_c02 mapflag nogvg
Question
amauni
Hi...can someone help me add this function script into my npc..i've tried so many times but it doesn't work.
And this is my npc script which i want to edit the function part :
Please anyone help me? Thanks
:)
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.