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


Joined: 30 Aug 2005
Posts: 49

PostPosted: Tue Aug 30, 2005 12:28 am   

String List and #if
 
Pattern: (%w) gives you (%d) coin*.

#if (%d > 1000 and @stringlist (Im confused here) != %1) {
Tell %1 You have been added to the list.
}

I want it to make sure that when someone who is already in the list gives me gold, they will not be sent that message again. Any help?

Whats with this Pathetic Newbie crap? Pssh, I might be a newbie, but im not pathetic!

Is there a way to make it where it forgets the rest of the commands after this function?

Like..

#If (Gold == 0) {
%end} {Say I Have more than one gold!}
Cry

If Gold is equal to 0, then he would not cry

what is the %end? thx


Last edited by TerrellKl on Tue Aug 30, 2005 1:32 am; edited 1 time in total
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Tue Aug 30, 2005 1:31 am   
 
Code:
#TRIGGER {(%w) gives you (%d) coin*.} {#IF (%2 > 1000 AND !%ismember(%1,@stringlist) {#ADDITEM Stringlist %1;tell %1 You have been added to the list.}}

Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Tue Aug 30, 2005 1:34 am   
 
DeReP wrote:
Code:
#TRIGGER {(%w) gives you (%d) coin*.} {#IF (%2 > 1000 AND !%ismember(%1,@stringlist) {#ADDITEM Stringlist %1;tell %1 You have been added to the list.}}


What does the ! do may i ask?

nevermind, i figured it out, it means That its not a member of that string list.
I got another problem

how i can i stop people from going
emote gives you 1000 gold coins. and still be put upon this list? i've been trying to get this working for hours. to no avail.

Pattern: mv (%d)gold
#var gold %1

I have my current gold always locked in that variable. Please help
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Tue Aug 30, 2005 4:03 am   
 
Code:
#TRIGGER {(%w) gives you (%d) coin*.} {#ALARM +1 {#MATH GoldCompare @gold+%2; #IF (%2 > 1000 AND !%ismember(%1,@stringlist) AND @Gold =  @GoldCompare ) {#ADDITEM Stringlist %1;tell %1 You have been added to the list.}}}

That might work, I'm not entirely possitive bout it.
The alarm is used so that you wil capture your gold with the prompt received after the emote or the actual transfer of gold.
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Tue Aug 30, 2005 4:16 am   
 
It worked once.. dunno why
then it ceased to work, i tried to null the value after the trigger is executed but it didnt help any.
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Tue Aug 30, 2005 5:20 am   
 
okay i got it working half decent like

except that i need it set #state 0 after 10 seconds if the second state hasnt fired. Im not exactly sure how to do that

If The second states pattern isnt met, i need to to set state to 0 and emote has declined you.


that is all i need now
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Tue Aug 30, 2005 5:19 pm   
 
Right, I think we need to reset @Goldcompare before it triggers every time, otherwise it will just add gold to goldcompare endlessly, and will never validate on actual deposit.
Code:
#TRIGGER {(%w) gives you (%d) coin*.} {goldcompare = %null
#MATH GoldCompare @gold+%2
#ALARM +1 {#IF (%2 >= 1000 AND !%ismember(%1,@stringlist) AND @Gold = @GoldCompare) {#ADDITEM Stringlist %1;tell %1 You have been added to the list.}}}

Ok I edited it, now it should add the money to goldcompare before your prompt is received, so that it can compare it to the new prompt, and your actual gold.
As for conditioning it you can add an option to the condition to wait for X miliseconds and then it will reset to state 0 automatically
Code:
#Trigger {Pattern} {commands}
#COND {Pattern} {commands} {dur|10000}

That should last for 10 seconds then reset if no pattern is matched.
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Thu Sep 01, 2005 3:05 am   
 
Problems

I cant get the last part to work

#trigger {^(%w) gives you (%d) gold coin*.}
#Condition {(@validated = "yes")} {stuff} <--- Expression

If State 2 doesn't fire in 5 Seconds i need it to slap %1 and reset the whole thing

i would use Duration if it wasnt an expression please help?
Reply with quote
TerrellKl
Novice


Joined: 30 Aug 2005
Posts: 49

PostPosted: Thu Sep 01, 2005 6:03 am   
 
Never mind.. I got it..

The whole trigger is complete!
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