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
Belmyrddyn
Magician


Joined: 17 Oct 2001
Posts: 371
Location: USA

PostPosted: Sun Jul 28, 2002 4:47 am   

Command Input Triggers
 
Okay, I want to create a trigger that will parse every command I send to the mud, and only execute certain commands. How do I prevent a command to be sent to the MUD? I've tried:

#TRIGGER {(*)} {#SUB ""}

When I've set the Type to: Command Input. What I actually want it to do is save the command I enter to a variable, then have an alias check that variable to see if its an appropriate command, and if it is, execute it. If it isn't, I want it send to a command buffer. I can do all that, but the command I enter on the command line keeps getting sent to the MUD before I can parse it.

Belmyrddyn
Reply with quote
bgunther
Novice


Joined: 20 Dec 2001
Posts: 39
Location: USA

PostPosted: Sun Jul 28, 2002 7:47 am   
 
You don't want a normal trigger... a normal trigger checks for patterns sent to you from the mud... what you need is #oninput

#oninput {(*)} {#echo Got it, now do what you want with it}

I don't use anything like this myself, but I have heard that if you trigger on anything sent to the mud, there is likely to be a performance impact



Bob, aka Kayd on SWMud and a few others.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jul 28, 2002 8:46 am   
 
A normal trigger (#TRIGGER) only matches on lines that appear in the main window. It doesn't make preemptive strikes on the command-line buffer like #ONINPUT does.

EDIT: I'm not quite sure if it's needful, but you MIGHT have to use %* over * to properly catch all commands or all combinations of commands (like n;n;w).

li'l shmoe of Dragon's Gate MUD
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jul 28, 2002 12:52 pm   
 
Also, to stop a command from being sent to the MUD, you use #GAG in the oninput trigger. Example:
#ONINPUT {%*} {#GAG}

will stop all commands from being sent to the MUD.

Kjata
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