View Single Post
  #1  
Old 08-06-2003, 08:47 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
I made an RC Login system myself. I made a seperate database NPC for it, RC Login System. It runs on a timeout of 1 (I did use a timeout of 5, but timeout of 1 creates SLIGHTLY more lag, and it's microseconds). Just every timeout loop, have it check this.newrcs to this.oldrcs and make sure the strings are the same (strequals). If they are, then just ignore it and have it reset the timeout. BUT if it is different, check the strings to find what is new. I have my automatically PM Updates and personal messages to them. /npc messages new 'account' 'message' is how I'm using it to send messages. It just stores a string and sends to the RC when he gets on.
BTW, using a timeout on the Control-NPC is just something that isn't done. The reasons are limitless as to WHY you shouldn't use them, but it's just kind of one of those things. It's just like telling people to not use a .1 timeout serverside if they don't have to, or not to run pointless timeouts in every NPC. It is just something that scripters should know (no offense, everyone has to learn some time or another). If you have the RC chat do a with(getnpc(RC Login Sys)) and have it set a string, then just transferring and a small edit of the script would make it work just fine, and would also help reduce lag (should be one of the greatest concerns when coding).
---Shifter
__________________
Who has time for life these days?
Reply With Quote