Jump to content
  • 0

NPC WARPER! HELP


Erba

Question


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

can anyone help me to fix my warper..

i make an NPC wherein the Guild's member will'be able to warp in their guildbase map with a password..

i tried to make a script with it.. it is working but the problem is that , it doesnt check if it is a correct password or incorrect one, it just autowarp the member in the desired map whenever i enter the password correctly and even uncorrectly!..

ty for the help..

sorry for my bad english

Edited by 2834
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,156,180,6    script    GuildBaseWarper    100,{
   .@npcname$ = strnpcinfo(1);
   mes .@npcname$;
   mes "Hi "+strcharinfo(0)+",";
   mes "Do you want to go in your Guild Base?";
   next;
   if ( select( "Blueprint's Base", "Yakuza's Base", "No" ) == 3 ) close;
   .@s = @menu;
   mes .@npcname$;
   mes "Hi "+strcharinfo(0)+",";
   mes "Please enter your guild password";
   next;
   if ( input( .@tmp$, 2, 70 ) ) close;
   if ( .@tmp$ != .password$[.@s] ) {
       mes .@npcname$;
       mes "Invalid password. Try again.";
       close;
   }
   announce strcharinfo(0) +": "+ strcharinfo(0), 0; // LOL ? I'm just replicating -> atcommand "@broadcast "+strcharinfo(0);
   warp getd( ".guildbase"+ .@s +"$[0]" ), atoi( getd( ".guildbase"+ .@s +"$[1]" ) ), atoi( getd( ".guildbase"+ .@s +"$[2]" ) );
   close;
OnInit:
   setarray .password$[1], "OMFG", "LMAO";
   setarray .guildbase1$, "lou_fild01", "180", "180";
   setarray .guildbase2$, "prt_fild08", "50", "50" ;
   end;
}

sometimes ... need a little bit spoon feed ...

and your script is far too off ....

that's why script request section exist ...

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

i tried to make a script with it..
then post it here and we can help you with it
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

*swt* I just checked my msg box, and he had requested help on this... But as Annie stated, since your asking for help on an existing script that you have, post it here, as we may ' help ' you fix your problems.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

Sorry for sending you a private message sir!:|

ill post my script by tomorrow i forgot to bring my laptop with me^^! sorry for the inconvenience..

i tried to make a script with it..
then post it here and we can help you with it

//===== rAthena Script =======================================
//= GuildBaseWarper
//===== By ===================================================
//= kvin
//===== Version ==============================================
//= 0.1
//===== Compatible With ======================================
//= rAthena
//===== Description ==========================================
//= guildbase warper with password
//===== Comments =============================================
//=
//============================================================

new_1-4,130,178,6 script GuildBaseWarper 777,{

set .@name$,"[GuildBase Warper]";

mes .@name$;
mes "Hi "+strcharinfo(0)+",";
mes "Do you want to go in your Guild Base?";
next;
menu "Blueprint's Base",P_insert,"Yakuza's Base",P_insert1,"No",-;
close;

P_insert:
sc_start sc_berserk, 1000000000, 1;
mes "[GuildBase warper]";
mes "Please enter your guild password";
next;
input #insertgpw$;
if (blueprint == blueprint) goto P_pass;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;
input #insertgpw$;
if (blueprint == blueprint) goto P_pass;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;
input #insertgpw$;
if (blueprint == blueprint) goto P_pass;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;
input #insertgpw$;
if (blueprint == blueprint) goto P_pass;
mes "[GuildBase warper]";
atcommand "@kick "+strcharinfo(0);
close;

P_insert1:
sc_start sc_berserk, 1000000000, 1;
mes "[GuildBase warper]";
mes "Please enter your guild password";
next;
input .@guild_password$;
if (password == yakuza) goto P_passyakuza;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;
input .@guild_password$;
if (password == yakuza) goto P_passyakuza;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;
input .@guild_password$;
if (password == yakuza) goto P_passyakuza;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;
input password;
if (password == yakuza) goto P_passyakuza;
mes "[GuildBase warper]";
atcommand "@broadcast "+strcharinfo(0);
end;

P_pass:
sc_end sc_berserk;
next;
warp "lou_fild01",180,180;
close;

P_passyakuza:
sc_end sc_berserk;
next;
warp "prt_fild08",50,50;
close;
}

its kinda funny but this is the first npc that i created.. ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

Hmm, your not TOO far off in the way your script is written, however there are some, ' wasteful & obvious ' errors.

Firstly, lets start off with the top of your script:

new_1-4,130,178,6 script GuildBaseWarper 777,{
set .@name$,"[GuildBase Warper]";
mes .@name$;
mes "Hi "+strcharinfo(0)+",";
mes "Do you want to go in your Guild Base?";
next;
menu "Blueprint's Base",P_insert,"Yakuza's Base",P_insert1,"No",-;
close;

Here, your just asking them if they want to go to the Guild Base, but we don't even know if they are in a guild yet, so lets add a check.

new_1-4,130,178,6 script GuildBaseWarper 777,{
set .@name$,"[GuildBase Warper]";
mes .@name$;
if( !getcharid(2) ){ mes "You must be in a guild to use this NPC"; close;}
mes "Hi "+strcharinfo(0)+",";
mes "Do you want to go in your Guild Base?";
next;
menu "Blueprint's Base",P_insert,"Yakuza's Base",P_insert1,"No",-;
close;

Next, theres the matter of your menu..But, i'm not going to get into that atm, since it'd require that I rewrite your script almost completely. So lets get to the main problems here.

P_insert:
sc_start sc_berserk, 1000000000, 1;
mes "[GuildBase warper]";
mes "Please enter your guild password";
next;
input #insertgpw$;
if (blueprint == blueprint) goto P_pass;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
next;

Here you have them inputting the password, thats fine, BUT yoru storing it into a #variable, it's not TOO bad, but definately not nessecary. So lets use this:

input .@insertgpw$;

Next, you were preforming a check to see if the password is right, however, you were using perm-char variables, this means, that if A = A true, and lets face it, A will always = A. So, lets fix that up.

P_insert:
sc_start sc_berserk, 1000000000, 1;
mes "[GuildBase warper]";
mes "Please enter your guild password";
next;
input .@insertgpw$;
if (.@insertgpw$ == $blueprint$) goto P_pass;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
close;

As you can see, I added the change for the insert portion, as well as a check to see if it's the right password, You'll notice i used: $blueprint$ this is because we need to call this for ALL guild memebers, so a perm-global pass will do great, since it wont erase if server shuts down. Lastly, I added a close; Because, there is no need, to have them continuously retry. They can just click the NPC again. If they fail, they should suffer :D

And that's it really. But, it is obvious this isn't the whole script, and if it IS the whole script, you need to add a way for them to save the password (guild master does this).

I'd explain more elaborately, but i have to get back to work (lunch break's over) so good luck.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

Try to avoid to use atcommand in scripts, unless you have to.

atcommand "@broadcast "+strcharinfo(0);

You can easily replace this atcommand with some script commands.

Try to check it on wiki: Announce

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

Thank you for the help.. ill try it and ill post again if it works..

i dont have my own internet connection, thats why i cant reply easily! thankyou!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

input .@insertgpw$;

Next, you were preforming a check to see if the password is right, however, you were using perm-char variables, this means, that if A = A true, and lets face it, A will always = A. So, lets fix that up.

P_insert:
sc_start sc_berserk, 1000000000, 1;
mes "[GuildBase warper]";
mes "Please enter your guild password";
next;
input .@insertgpw$;
if (.@insertgpw$ == $blueprint$) goto P_pass;
mes "[GuildBase warper]";
mes "Invalid password. Try again.";
close;

sir, as i enter the password "blueprint" it always says invalid password.try again. what will im gonna do with this?

Edited by 2834
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

that's why script request section exist ...

hmm sorry.. btw thanks for the script

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...