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


Joined: 14 Oct 2003
Posts: 14
Location: Canada

PostPosted: Wed Oct 15, 2003 5:13 pm   

Trigger Help please
 
Alright, first off this is for Medievia and I run ZMud 6.62. Anyways here's my problem. I'm trying to write a script for grabbing variables off what comes off the screen. And I'm getting stuck someplace.... here's what I want the script to be triggered from:

The wizard looks at a magic orb placed here by Vryce....
The wizard telepaths you, 'Let's see here... I see an entrance at...'.
The wizard telepaths you, 'A Rocky Cliff Path'.
The wizard telepaths you, 'in the general vicinity of'.
The wizard telepaths you, 'The Cliff of Berkovic'.
The wizard telepaths you, 'The entrance was found fairly recently.'

and here is what I got so far:

#trig {^The wizard telepaths you, 'let's see here... I see an entrance at...'.} {} {combst}
#trig {^The wizard telepaths you, '&rvar'} {} {combst}
#trig {^The wizard telepaths you, 'in the general vicinity of'.} {} {combst}
#trig {^The wizard telepaths you, '&zvar'} {} {combst}
#trig {^The wizard telepaths you, '&tvar'} {} {combst}

#alias {combsinfo} {#showme {Combs ~[Zone~] $zvar ~[Room~] $rvar ~[Age~] $tvar}} {combst}
#alias {clcombs} {clan Combs ~[Zone~] $zvar ~[Room~] $rvar ~[Age~] $tvar} {combst}
#alias {saycombs} {say Combs ~[Zone~] $zvar ~[Room~] $rvar ~[Age~] $tvar} {combst}
#alias {towncombs} {town Combs ~[Zone~] $zvar ~[Room~] $rvar ~[Age~] $tvar} {combst}
#alias {chatcombs} {ca Combs ~[Zone~] $zvar ~[Room~] $rvar ~[Age~] $tvar} {combst}


when I try and use it, it keeps listing only the last telepath variable captured, in this example 'The entrance was found fairly recently.' Any help any of you could give would be greatly appreciated.

Thanks.
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Thu Oct 16, 2003 2:48 am   
 
Well I can tell you why it does that - you have 3 triggers all firing on the same text. Because the last piece of text matches them all, all three variables get set to the same thing.

If you combine them into a state trigger (I only know how to do this via the editor I am afraid - copy and paste the trigger patterns into successive lines in the editor) it will magically put the values you seek into the variables as required.

I think you want @ signs in your aliases too...
eg
say Combs ~[Zone~] @zvar ~[Room~] @rvar ~[Age~] @tvar

Hope this helps
Reply with quote
filthyreg
Beginner


Joined: 14 Oct 2003
Posts: 14
Location: Canada

PostPosted: Thu Oct 16, 2003 5:35 am   
 
Thanks for your insight, but I still can't get it to work, I was already aware of the actual problem but I don't know how to fix it... I need to know how I can get those triggers to fire off in order... so like it fires on the first line and captures, then moves to the next line and the next line triggers another capture for different info.... etc.

Any more suggestions, would be greatly appreciated.
Reply with quote
zyran
Beginner


Joined: 16 Apr 2003
Posts: 17
Location: USA

PostPosted: Thu Oct 16, 2003 7:32 am   
 
Like Stackadder said. You have to make a multi-state trigger. Like so
#TRIGGER {The wizard looks at a magic orb placed here by Vryce....} {}
#COND {The wizard telepaths you, 'Let's see here... I see an entrance at...'.} {}
#COND {The wizard telepaths you, '&rvar'} {}
#COND {The wizard telepaths you, 'in the general vicinity of'} {}
#COND {The wizard telepaths you, '&zvar'} {}
#COND {The wizard telepaths you, '&tvar'} {}
and if you want your aliases to work too you need to change the $ signs to @ signs.
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Thu Oct 16, 2003 12:24 pm   
 
Ah thanks for the command line version zyran :-)
Reply with quote
filthyreg
Beginner


Joined: 14 Oct 2003
Posts: 14
Location: Canada

PostPosted: Thu Oct 16, 2003 4:15 pm   
 
I'm aware of the @ symbol... I Tried the state trigger but it still isn't working so... obviously I'm doing something wrong. Incidentally, my version that I just created, looks just like yours, but still doesn't work.

But I'll look at it again. Thanks for your replies.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Thu Oct 16, 2003 10:00 pm   
 
#cond isn't something you would see inside the 'value' field. go into the 'states' tab to check it out. If you see #cond inside the value field you need to put it into the states tab or recreate the trigger on the command bar.
Reply with quote
filthyreg
Beginner


Joined: 14 Oct 2003
Posts: 14
Location: Canada

PostPosted: Thu Oct 16, 2003 11:25 pm   
 
Ok, I finally got it to work... and it wasn't a matter of how I typed things in to the state trigger... it was just some of the damn characters that were halting the trigger... ah well. here's the finished product if anyone wants:


#CLASS {Combs}
#ALIAS chatcombs {ca Combs Zone: @zone Room: @room Age: @time}
#ALIAS clcombs {cl Combs ~[Zone~] @zone ~[Room~] @room ~[Age~] @time}
#ALIAS combsinfo {#show Combs ~[Zone~] @zone ~[Room~] @room ~[Age~] @time}
#ALIAS fcombs {f Combs ~[Zone~] @zone ~[Room~] @room ~[Age~] @time}
#ALIAS saycombs {say Combs ~[Zone~] @zone ~[Room~] @room ~[Age~] @time}
#ALIAS towncombs {town Combs ~[Zone~] @zone ~[Room~] @room ~[Age~] @time}
#TRIGGER {The wizard looks at a magic orb placed here by Vryce....} {}
#COND {The wizard telepaths you, ~'Let's see here... I see an entrance at...~'.} {}
#COND {The wizard telepaths you, ~'&room~'.} {}
#COND {The wizard telepaths you, ~'in the general vicinity of~'.} {}
#COND {The wizard telepaths you, ~'&zone~'.} {}
#COND {The wizard telepaths you, ~'&time~'.} {}
#CLASS 0



P.S. Thanks to all who helped me get this thing working... it was greatly appreciated.
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