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
mjamer
Newbie


Joined: 18 Jan 2002
Posts: 8
Location: USA

PostPosted: Tue Jan 22, 2002 1:28 am   

Script? Trigger?
 
I don't know how to script! I can do triggers, make stuff happen when something else happens... but I don't know how to join them, or make them have any flow.

Here's what I would like to do:

In my mud, when I 'sneak', i get the message "You begin moving quietly."
when I 'hide', I get the message "You crawl into a corner and remain motionless."

I want to work those skills up. There's a road in my mud that goes south a ways and stops, and north a ways and stops, however I can't just do a 'sneak;n;hide;sneak;n'.. type deal, since 'hide' delays in the code.., I also can't turn it on when following someone ie - #trigger {Somone Leaves *} {sneak;hide}, so that it'd practice those skills, instead, those queue up on the mud and i'm stuck waiting before I can do anything else.

Now I'm left with trying to make a button! a button that's either pressed or not, that has the caption "work hs" (hehe! work hide and sneak!).. when I press this button, this is what I would like to happen:

while( button_toggled ) {
sneak;
wait for "you begin moving quitely ..." message
move north;
if cant
move south;
hide;
wait for "You crawl into corner..." message
}

this would loop while i had the button toggled down, walking my char, north and south, over and over while hiding and sneaking to build those skills.

It's sad for me! Cause I can't figure out how to do this with zmud, I could probably write it in C, including the connection network code, FASTER.. =P

Please give me some pointers, there is something I'm not getting when I look at the documentation that is making zmud scripting evade me somehow hehe.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jan 22, 2002 2:57 am   
 
Create these two triggers:
#TRIGGER {You begin moving quietly.} {south;hide} "workhs"
#TRIGGER {You crawl into a corner and remain motionless} {north;sneak} "workhs"

These two trigger will automatically be in a continues loop because one issues the command that produces the message of the other and vice-versa. So to start it, all you need is to go to a room where you can go north and south and send the sneak command, the triggers take on from there.

Of course, you do not want this to be turned on all the time. That's why the triggers that I provided are set to be created in a class called workhs. You can enable or disable this class when you want the triggers to be active or not. To make it easy, you can create a toggle button that enables it and disables it using the #T+ and #T- commands.

Kjata
Reply with quote
mjamer
Newbie


Joined: 18 Jan 2002
Posts: 8
Location: USA

PostPosted: Tue Jan 22, 2002 3:44 am   
 
Thank you Kjata, I reckon I have to think differently than I do in
other languages =)
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