Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Aon
Beginner


Joined: 12 Nov 2002
Posts: 15

PostPosted: Fri Mar 14, 2003 6:18 pm   

Checking for no variable
 
Ive set up a info bot to report information about characters to someone who asks.. But I need to make sure they dont just start spamming me with characters that I dont have recorded or doesn't exist.. To keep them from spamming me I made a variable equal to the last request and then checked to see if that was the same and if so not to do it.. But I need to figure out how to tell it not to do anything if the information they are looking for doesnt exist.. But I dont think making sure it isnt equal to 0 works.. Need some help..
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Mar 14, 2003 8:45 pm   
 
You might employ the %null function.

#IF %null(@lastrequest) {#NOOP} {say Hello Sailor!}

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Mar 14, 2003 8:55 pm   
 
A simple way is to track the time since last request.
Release info every 30s or 60s and ignore all other requests from that person.

%secs the number of milliseconds since midnight

The other thing is to queue requests and %pop through them as you go.
You can add priority and a quantity check the requestors.

Depending how where the information is stored, you can check to see if you
"got" anything in the look up. %find or the value of the look up is "" or %null as Troubadour suggests above.

Ton Diening
Reply with quote
Aon
Beginner


Joined: 12 Nov 2002
Posts: 15

PostPosted: Sat Mar 15, 2003 5:34 pm   
 
Hrm well the way I stored variables was taken from a previous help I got here.. I use the who list to get my information and when it sees the name it stores the data on the information with %1Title.. so if I wanted to check to see if it existed Id simply have to see if %1Name exited and if it did I could give the information.. I was also looking to somehow use the number from the %1Status to tell who was in each others range if they asked.. But I cant figure out how to do that with my current variable storage.. Ill try this null thing though.. even though I dont quite understand it.. Thanks guys
Reply with quote
Aon
Beginner


Joined: 12 Nov 2002
Posts: 15

PostPosted: Sat Mar 15, 2003 11:23 pm   
 
trying to check status I think might be easier for me to do If I could find out how to take the variable apart just like I put it together.. Is there some way to do that? lol Im really not thinking so but it would be nice if it could tell what part was the word and what part was the part I added.. Only way I could think of doing that is by Removing the "Status" or whatever part I added after that and making a list of the left of the name and then drawing out of that list to check the variables.. I dont know... maybe im trying to do this way too complicated..someone help! :P
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net