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


Joined: 17 Apr 2001
Posts: 14
Location: USA

PostPosted: Sun Dec 30, 2001 4:42 am   

trouble using #cond
 
I'm having some trouble with the #cond command. The mud i play on has a portal system to be able to move b/w zones, and I'm trying to set up a script that will work with zchat and will tell people where im going.

The problem i have is that either A. The trigger wont go off b/c its waiting for text from the mud, and i want it to go off when i enter the command, or B. the #cond statement i have is wrong.

so i have

#CLASS {portal}
#VAR destination {1}
#TRIGGER {enter %1} {#var destination %1;#cond {You step into the portal and the world fades into the mist.} {#if {@destination = 1} {#show just entered his matter teleportation device. His destination... CT ~#1 - Circle of Power};#if {@destination = 2} {#show just entered his matter teleportation device. His destination... CT ~#2 - The White Rose};#if {@destination = 3} {#show just entered his matter teleportation device. His destination... CT ~#3 - Fate};#if {@destination = 6} {#show just entered his matter teleportation device. His destination... CT ~#6 - The Knights Templar};#if {@destination = 7} {#show just entered his matter teleportation device. His destination... CT ~#7 - The Cheese Merchants of Medievia};#if {@destination = 9} {#show just entered his matter teleportation device. His destination... CT ~#9 - Guardians of Justice}} {Within|Param=1};#cond {You step into the portal, and the world spins madly...} {#emoteall just misportalled.} {within|param=1}} "" {"prompt"}

so basically I type 'enter #' where # is a number 1-100, but only a few that i have if statements for , it stores the # into @destination, checks for 'You step into the portal and the world fades into the mist.' from the mud, when it gets that, it should go through my if statemnts comparing @destination with one of the zones im going to, and fire off the #emoteall i have set.

i know its getting to the mistportal #cond and stopping
but i want it to check for the mistportal as well as a successful portal, which its random if i get a good portal or a bad one.

so i guess my question is how do i get zmud to fire the trigger when i send 'enter #' to the mud, and wait for the good portal or bad portal message, and fire off those commands?

if that made no sense whatsoever, ill try to explain a little better.
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sun Dec 30, 2001 10:10 am   
 
States are fun, but perhaps not strictly necessary here:

Untested, should work in 6.x+:
#CLASS {PortalEnter}
#var destination {1}
#alias {enter} {~enter %-1;#var destination %-1;#t+ "PortalEnter|Entry";#ala +5 {#t- "PortalEnter|Entry"}}
#CLASS {PortalEnter|Entry} {disable}
#trigger {You step into the portal and the world fades into the mist.} {#show just entered his matter teleportation device. His destination... CT ~#@destination - %case(@destination,Circle of Power,The White Rose,Fate,Case 4,Case 5,The Knights Templar,The Cheese Merchants of Medievia,Case 8,Guardians of Justice)}
#trigger {You step into the portal, and the world spins madly...} {#emoteall just misportalled.} "prompt"
#CLASS 0

This basically sends the command and opens a 5 second window (can easily be modified as needed) to get the result to avoid unnecessary trigger matching.

Also, I used %case to cut down on the repetition in the text. Replace/add items as necessary. It is possible to do #oninput triggers like you are looking for but aliases are more efficient.

- Charbal
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Dec 30, 2001 12:39 pm   
 
The #COND command does not go inside the trigger, it goes right after the trigger. Example:
#TRIGGER {this is a trigger} {that does nothing}
#COND {this is another state} {for the previous trigger}

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Dec 30, 2001 3:59 pm   
 
This belongs on the Beta Forum. There is no #COND command in 6.16

LightBulb
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