Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script Sample#code -1,{
- function GenerateCode;
- OnPCLoadMapEvent:
- for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 )
- if( strcharinfo(3) == .Map$[.@i] ) {
- deltimer .npc_name$+:"::OnCheck";
- addtimer( ( rand( 5,10 ) * 60000 ),.npc_name$+:"::OnCheck" );
- break;
- }
- end;
- OnCheck:
- //set .@GeneratedCode$,GenerateCode( <Bitmask>,<Length> );
- set .@GeneratedCode$,GenerateCode( 7,5 );
- mes "Please input the ^FF0000RED COLOR^000000 words.";
- mes "^0055FF"+GenerateCode( 7,rand(1,10) )+"^FF0000"+.@GeneratedCode$+"^000000"+GenerateCode( 7,rand(1,10) )+"^000000";
- input .@Input$;
- if( .@Input$ != .@GeneratedCode$ ){
- mes "You entered Wrong Code.";
- close2;
- warp "prontera",155,181;
- end;
- }
- end;
- OnInit:
- set .npc_name$,strnpcinfo(3);
- // List Of Maps
- setarray .Map$,"prontera","payon","izlude","aldebaran";
- for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 )
- setmapflag .Map$[.@i],mf_loadevent;
- end;
- // Credits to Brian ~
- function GenerateCode {
- if( getarg(0) & 1 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"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) & 2 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"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 .@Word$[ getarraysize( .@Word$ ) ],"0","1","2","3","4","5","6","7","8","9";
- if( getarg(0) & 8 ) setarray .@Word$[ getarraysize( .@Word$ ) ],"~","!","@","#","$","%","^","&","*","*","(",")","_","+","-","?",">","<";
- do{
- set .@Random$,.@Random$ + .@Word$[ rand( getarraysize( .@Word$ ) ) ];
- }while( getstrlen( .@Random$ ) < getarg(1) );
- return .@Random$;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement