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
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Sat Jul 17, 2004 8:12 pm   

Accessing and useing @var Information
 
Hello again. Ok I have created the following script

#CLASS {tokexchange}
#VAR tokenin {Arolas.10}
#VAR tokenout {Arolas10}
#TRIGGER {You receive (%n) (*) quest tokens from (*)} {#IF %iskey( @tokenin, "%3") {#ADDK tokenin {%3} {%eval( %db( @tokenin, "%3") + %1)}} {#ADDK tokenin {%3} {%1}}}
#TRIGGER {You give (*) (%n) (*) quest tokens.} {#IF %iskey( @tokenout, "%1") {#ADDK tokenout {%1} {%eval( %db( @tokenout, "%1") + %2)}} {#ADDK tokenout {%1} {%2}}}
#CLASS 0

basicly when ever there is a token trade made it logs it. It wokrs great. But I need to know how to do 2 things with it, Rank it, and use eq value.

So for example in the above arolas has traded me 10 tokens, I want a trigger or something to take that information and automate itin a note

note syntax looks like

note to (*name)
note subject Token Exchange
note + This is an automated blah blah blah So you know
note + You current have traded me (*token #)
note + Or are currently ranked (rank of total token amounts). Then some other
note + random info.

I have thought about doeing a show ver and then maken a second trigger to capture and store that info. Also The people who receve the lise will need to be on the email life, and have token values with me.

Thanks
_________________
<Clever text here>
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 18, 2004 2:14 am   
 
There is no easy way to sort values. One variable for both in and out would probably work better, with positive numbers for one direction and negative for the other. It would also help if you excluded the ending period from your wildcard.
#CLASS {tokexchange}
#TRIGGER {You receive (%n) * quest tokens from (*).} {#IF %iskey( @tokenex, "%2") {#ADDK tokenex {%2} {%eval( %db( @tokenex, "%2") + %1)}} {#ADDK tokenex {%2} {%1}}}
#TRIGGER {
You give (*) (%n) * quest tokens.} {#IF %iskey( @tokenex, "%1") {#ADDK tokenex {%1} {%eval( %db( @tokenex, "%1") - %2)}} {#ADDK tokenex {%1} {-%2}}
note to %1
note subject Token Exchange
note + This is an automated note.
note + You current have traded me %db( @tokenex, "%1")
note + random info.
}
#CLASS 0

The %db function is used for retrieving information from record variables. The script to send a note can either be included in the trigger or separate.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Sun Jul 18, 2004 7:57 am   
 
Thanks again for your help light!
_________________
<Clever text here>
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