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
kosh
Beginner


Joined: 24 Oct 2002
Posts: 14
Location: Canada

PostPosted: Thu Oct 24, 2002 1:46 pm   

a simnple trigger question
 
ok Im trying to set up a script that will spell up ppl that pay me x gold

basically it starts by them saying spell me up

I tell them the price of the spell up

what I want to do is basically

(*) says 'spell me up'
tell %1 you need to pay the small price of @spellupprice

now what I want to do is have it so that it will only spell the person up if they pay the price

and Im still new at getting triggers to work from within triggers
any thoughts or suggestions?
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Thu Oct 24, 2002 6:45 pm   
 
The simplest approach would be a single trigger. If your money transactions look like this:

Bob gives 5 coins to you.

Then
#TR {(%w) gives (%d) coins to you.} {#IF (%2 >= @spellupprice) {#VAR customer %1; spellup @customer}}

where spellup is an alias with all the appropriate spells.

Notice the use of the %w and %d matching patterns. %w matches a single word, %d matches a whole number.

Later you might want to add checks to ensure the customer isn't emoting the gold transfer. If so, you'll need to track your gold on hand in a variable and make comparisons before and after the transaction.

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
Lalaynya
Wanderer


Joined: 23 Aug 2002
Posts: 96

PostPosted: Thu Oct 24, 2002 8:13 pm   
 
quote:

Later you might want to add checks to ensure the customer isn't emoting the gold transfer. If so, you'll need to track your gold on hand in a variable and make comparisons before and after the transaction.

Troubadour
(Win 98, Pentium III, 550 MHz)



Bad Troubadour. Spoil all our fun.

*snicker*
Reply with quote
kosh
Beginner


Joined: 24 Oct 2002
Posts: 14
Location: Canada

PostPosted: Fri Oct 25, 2002 2:29 am   
 
[quote]

Later you might want to add checks to ensure the customer isn't emoting the gold transfer. If so, you'll need to track your gold on hand in a variable and make comparisons before and after the transaction.

I actually already have that in place I was just wondering about triggers from with-in triggers and I found out the answer shortly after I posted.... I totally forgot about the #temp command lol
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