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
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Mon Apr 12, 2004 1:15 pm   

Making 2 variables as 1
 
I have a question...

I have a trigger on (%w) tells you: find (%w)
to do: #MATH %1fcount (@%1fcount +1)

the thing is, Different people asks me for finds.
Now, what I want todo is that I want it to put a variable
so if the %1 is Corleidum, it should make a variable called

CorleidumFcount and when it hits the limit (3) it will send corleidum a tell, telling him that he exceeded his search requests.

so I got this, wich is so not working
#IF (@wfind"fcount" >=3) {tell @wfind I'm sorry, you have exceeded your limit of 3 searches.} {fiok}

So, how can I make it work..?
Reply with quote
Morgoth
Beginner


Joined: 07 Apr 2004
Posts: 12
Location: Israel

PostPosted: Mon Apr 12, 2004 1:23 pm   
 
(%w) tells you: find (%w)
#If (@%1fcount<3) {whateveractionyoudo;#ADD %1fcount 1} {Tell %1 I'm sorry, you have exceeded your limit of 3 searches}

If whateveryoudo is the alias fiok, then put {fiok;#ADD %1fcount 1}.


I hope this helps.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Apr 12, 2004 4:05 pm   
 
You need to specify that "wfind" is another variable.
#IF (@{@{wfind}fcount} >=3) {tell @wfind I'm sorry, you have exceeded your limit of 3 searches.} {fiok}

If you use a record variable, you'll only need one which will reduce the clutter in your variable list considerably.
#IF (%db( @Fcount, @wfind)) {#ADDK Fcount @wfind %eval( 1 + %db( @Fcount, @wfind))} {#ADDK Fcount @wfind 1}
#IF (%db( @Fcount, @wfind) < 4)) {fiok} {tell @wfind sorry, your find limit ran out}
Reply with quote
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Mon Apr 12, 2004 7:40 pm   
 
quote:
Originally posted by LightBulb

You need to specify that "wfind" is another variable.
#IF (@{@{wfind}fcount} >=3) {tell @wfind I'm sorry, you have exceeded your limit of 3 searches.} {fiok}

If you use a record variable, you'll only need one which will reduce the clutter in your variable list considerably.
#IF (%db( @Fcount, @wfind)) {#ADDK Fcount @wfind %eval( 1 + %db( @Fcount, @wfind))} {#ADDK Fcount @wfind 1}
#IF (%db( @Fcount, @wfind) < 4)) {fiok} {tell @wfind sorry, your find limit ran out}



Hmm, I am getting an error here.: =(

on this:_
#IF (%db( @Fcount, @wfind) < 4)) {fiok} {tell @wfind sorry, your find limit ran out}...w hy?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Mon Apr 12, 2004 7:46 pm   
 
It has one two many ) delete the on you have colored red and it should go away
Reply with quote
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Mon Apr 12, 2004 7:51 pm   
 
quote:
Originally posted by nexela

It has one two many ) delete the on you have colored red and it should go away



Great, thanks! but still, not working..the error is gone. but it doesn't ad more then 1, so the data record is always at 1, never changes.. Why?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Apr 13, 2004 9:52 pm   
 
With extra ) removed.
#IF (%db( @Fcount, @wfind)) {#ADDK Fcount @wfind %eval( 1 + %db( @Fcount, @wfind))} {#ADDK Fcount @wfind 1}
#IF (%db( @Fcount, @wfind) < 4) {fiok} {tell @wfind sorry, your find limit ran out}

I'm sorry this doesn't work for you. I've tested these statements several times and they work. If you are having problems, it's possible that you incorrectly entered some values as strings instead of numbers. This can be fixed by deleting your existing variable and allowing the script to create a new one.
#UNV Fcount

NOTE: This is not a complete script. Additional statements are needed to set the value of @wfind (used in both statements above) and any other variables used by the fiok alias.
Reply with quote
Corleidum
Novice


Joined: 30 Apr 2003
Posts: 43
Location: Sweden

PostPosted: Wed Apr 14, 2004 12:49 am   
 
quote:
Originally posted by LightBulb

With extra ) removed.
#IF (%db( @Fcount, @wfind)) {#ADDK Fcount @wfind %eval( 1 + %db( @Fcount, @wfind))} {#ADDK Fcount @wfind 1}
#IF (%db( @Fcount, @wfind) < 4) {fiok} {tell @wfind sorry, your find limit ran out}

I'm sorry this doesn't work for you. I've tested these statements several times and they work. If you are having problems, it's possible that you incorrectly entered some values as strings instead of numbers. This can be fixed by deleting your existing variable and allowing the script to create a new one.
#UNV Fcount

NOTE: This is not a complete script. Additional statements are needed to set the value of @wfind (used in both statements above) and any other variables used by the fiok alias.



weird, well it works fine now, thank you lightbuld, you're my saver!!

Ok, one last thing. Now, sometims it will say: That person does not excist in our realm.

Now, any smart solution about how to NOT add 1 to the FCOUNT if the person in question is not online?
thanks
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 14, 2004 3:57 am   
 
Just subtract 1.
#TR {That person does not excist in our realm.} {#ADDK Fcount @wfind %eval( %db( @Fcount, @wfind) - 1)}

(misspelling of 'exist' preserved)
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