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


Joined: 28 Jun 2002
Posts: 13

PostPosted: Fri Jun 28, 2002 6:20 am   

Pulling my hair out, part 1
 
Is there some trick to saving triggers? I have the following problems (using 6.16) which I will try to describe in as much detail as I can...

Problem 1: Creating a trigger from the command line.

Here is the trigger I type in at the command line: #TRIGGER {--(*)"} {%1}

What this is supposed to do is let me control a bot by whispering a command to it prepended with "--" without the quotes, and stripping off the quote that the game puts at the end of the whisper. The bot sends the command to the game. When I create the trigger in the editor, typing in --(*)" for the pattern and %1 for the value, it creates exactly the trigger I typed above, with the curly braces and everything.

But when I try to create it on the command line, typing it in exactly as above (which is exactly how the editor makes it), it does not work. I look in the editor to see the created trigger, and it is this: #TRIGGER {{--(*)"}} {}

What the heck? Why did it put the extra curly braces around the pattern? What happened to my %1?
Reply with quote
Kharok
Beginner


Joined: 28 Jun 2002
Posts: 13

PostPosted: Fri Jun 28, 2002 6:50 am   
 
Problem 2: Working with classes in the editor.

I don't want to be in "bot mode" all the time, so I made a class called Slave that I can put all my bot triggers into. The correct, working, trigger from Problem 1 (created in the editor, not on the command line) is in it already.

I want the command whispers I send to the bot to be gagged and the command to still be executed. So I need to create a trigger #TRIGGER {--(*)"} {#GAG} and put it above the previous trigger. Not fooling around with classes and creating them both in order in the editor, everything works fine.

But dangit, I want them in the Slave class. Like I said, the first trigger is already in the class. My first attempt at adding the second trigger was to type it directly into the class script in the editor, like so:

before modification:
#CLASS {Slave}
#TRIGGER {--(*)"} {%1}
#CLASS 0

after modification:
#CLASS {Slave}
#TRIGGER {--(*)"} {#GAG}
#TRIGGER {--(*)"} {%1}
#CLASS 0

but when I try to save it, it just gets rid of the gag line. What happened to it? Where did it go?

Second attempt: Create the gag trigger in the editor from inside the Slave folder.

I got some sort of name clash error.

Third attempt: Create the gag trigger in the editor but outside the Slave folder, drag it into the Slave folder, drag it into the proper folder.

This worked! Except for two problems. First, I can't get it to "stick". I click save everywhere I can find it, but when I quit zmud and go back in, the gag trigger is gone. Second, editing the new class script is really weird...

before messing with it:
#CLASS {Slave}
#TRIGGER {--(*)"} {#GAG}
#TRIGGER {--(*)"} {%1}
#CLASS 0

after deleting a char and putting it back so it will let me save it, and clicking the save button, sometimes it will save like it should and other times it will replace my two triggers with the weird wrong one from problem 1 above.

What's going on?
Reply with quote
Kharok
Beginner


Joined: 28 Jun 2002
Posts: 13

PostPosted: Fri Jun 28, 2002 6:54 am   
 
"Third attempt: Create the gag trigger in the editor but outside the Slave folder, drag it into the Slave folder, drag it into the proper folder."

should read: "Third attempt: Create the gag trigger in the editor but outside the Slave folder, drag it into the Slave folder, drag it into the proper ORDER."

My bad
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jun 28, 2002 7:30 am   
 
" is a special character, which marks the beginning of a string and needs a second " to end the string. Since you want to use it as a literal character, it must be preceded by a ~.

LightBulb
Senior Member
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Fri Jun 28, 2002 8:00 am   
 
I'm pretty sure the trigger names are unique, which is why your second trigger is overwriting the first (or vice versa..)

Just put both commands in the same trigger:

#TRIGGER {--(*)"} {#GAG;%1}

Lady C.
Reply with quote
Kharok
Beginner


Joined: 28 Jun 2002
Posts: 13

PostPosted: Fri Jun 28, 2002 8:59 am   
 
LightBulb and Castaway -

Thank you so much! That solved all my problems :) I feel kinda dumb now cause I missed something so simple ;)
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