McNeri Posted November 14, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 98 Reputation: 2 Joined: 01/24/12 Last Seen: May 17, 2015 Share Posted November 14, 2012 Hi, Help me guys.. Please edit this script, when players login in-game and he/she has not set the password of his/her account, the NPC will automatically pop-up and ask to set the password. Security_Manager.txt Sorry bad english. Quote Link to comment Share on other sites More sharing options...
Bin4ry Posted November 14, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share Posted November 14, 2012 OnPCLoginEvent: if (!#AccountPW$) { mes "[security Manager]"; mes "Please set a 2nd password:"; next; input .@AccountPW$; next; set .@RandomFinalize,rand(100,999); mes "Are you sure you want to set your password to ^FF0000"+.@AccountPW$+"^000000? If your 100% sure type the number ^0000FF"+.@RandomFinalize+"^000000."; input .@Finalize; if(.@Finalize!=.@RandomFinalize) { next; mes "You really should set up a personal account password."; close; } set #AccountPW$,.@AccountPW$; next; mes "Your password has been set as ^FF0000"+#AccountPW$+"^000000."; close; } else { mes "[securty Manager]"; mes "Enter your personal account password."; input .@AccountPW$; if (.@AccountPW$ != #AccountPW$) { mes "[securty Manager]"; mes "Invalid password entry."; close2; atcommand "@kick "+strcharinfo(0); end; } next; mes "[securty Manager]"; mes "You password has been accepted."; close; } } Replace whole OnPCLoginEvent Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 14, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 14, 2012 if (!#AccountPW$) { [Error]: script:op_1: argument is not a number (op=C_LNOT) yeah rathena script engine sux ! operator only usable in integer value, cannot use for string btw this script ... is broken also ... [Debug]: npc_scriptcont: SecurityManager (sd->npc_id=110000212) is not 'UnknownNPC' (id=0). why the script start with next; command -.-" Quote Link to comment Share on other sites More sharing options...
McNeri Posted November 14, 2012 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 98 Reputation: 2 Joined: 01/24/12 Last Seen: May 17, 2015 Author Share Posted November 14, 2012 thanks darristan thanks darristan Quote Link to comment Share on other sites More sharing options...
Bin4ry Posted November 14, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share Posted November 14, 2012 Well I'm just following his script adding a ! check, didn't know that doesn't work for $ Thanks for telling AnnieRuru. Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 14, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 14, 2012 (edited) You could however do something like this: if( !axtoi(#AccountPW$) ){do blah;} OR set .@var,axtoi(#AccountPW$); if(!.@var){do blah;} That'll turn your string into an interger, by assuming its a Hex value, this way, any Alpha-numeric combinations will be accepted, vs atoi (which only accepts strings consitant of only numbers). Edit: NVM, that wont work lol.. just realized hex only has A->F as letters lmao, but you CAN do this: if( !getstrlen(#AccountPW$) ){do blah;} Edited November 14, 2012 by GmOcean 1 Quote Link to comment Share on other sites More sharing options...
Euphy Posted November 14, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted November 14, 2012 @GmOcean: if (str$ == "") Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 15, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 15, 2012 Edit: NVM, that wont work lol.. just realized hex only has A->F as letters lmao, but you CAN do this: 'ax'toi means a conversion in hexadecimal system, that has numbers from 0 to 9 and letters from A to F. Mostly used in web programming, eA and rA use it a lot for color flags. @GmOcean: if (str$ == "") That's a mere trick but still not the best as efficiency. Works only in rAthena of course as it has some sorto of direct string comparator. It will need the system to make some implicit conversions due to the odd coding to make it like it is. GmOcean's solution was more suitable and actually nicer for the CiC. if( !getstrlen(str$) ) 2 Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 15, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 15, 2012 @Euphy - I do know that is a possibility, however, I was merely trying to solve his !variable use lol. Also, i would normally use ( == " " ) Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 15, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 15, 2012 Ryokem post yeah, just a peak at script.c, our crappy script engine parse == C_EQ operator very ugly even C_LNOT + BUILDIN_FUNC(getstrlen) is much cleaner me also want to do like this from now on xD http://rathena.org/board/topic/73137-script-core-improvements/ remember to support this project XD Quote Link to comment Share on other sites More sharing options...
Question
McNeri
Hi,
Help me guys.. Please edit this script, when players login in-game and he/she has not set the password of his/her account, the NPC will automatically pop-up and ask to set the password.
Security_Manager.txt
Sorry bad english.
Link to comment
Share on other sites
9 answers 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.