Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ristani
Newbie


Joined: 14 Aug 2013
Posts: 1

PostPosted: Wed Aug 14, 2013 11:46 pm   

Can i make a trigger that only activate when i press enter?
 
There are no brackets associated with the ADDITEM command. I tried a few different things with the ONINPUT but it seems a blank line isn't considered an 'input' to CMUD, from what I could tell watching the debugger window, so you'll have to send 'something'. Even just a single blank space works.

#ADDI nextCommand "wield sword"
#ONINPUT {^*$} {#EXEC %pop(nextCommand)}

Hope that helps!
Reply with quote
jerup
Newbie


Joined: 27 Oct 2015
Posts: 4

PostPosted: Tue Oct 27, 2015 5:33 am   Can i make a trigger that only activate when i press enter?
 
Hey, so here's my problem: I play on a mud where all triggers that sends commands are banned (instant deletion)

Therefor i need to make triggers that don't activate until i send my next line/command/"press-enter", but it should activate no matter what i type.

Is this possible?

Thanks alot, if you can help

(let me know if my question is un-clear)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Tue Oct 27, 2015 6:10 am   
 
You could script something to where a command queue could be lined up, instead of firing them to the mud directly.
But there is no way to differentiate a machine sent command from a user sent one.
...short of some third party program checking for an actual keystroke with COM access.

You could easily add a toggle variable, than set and check it where needed to ensure nothing was automated in your absence.
But there are other more ethical ways to circumvent the no automation rules often in effect.

1. Make use of named buttons that issue the commands based on their current color, and use %bttncol to change the background color as needed and for a visual cue.
2. Make use of sound files and #PLAY them as alarms to remind you to do things.
3. Make use of text printed to screen as a reminder with #SAY, #PRINT and other similar commands, or use #MXP to make clickable URL-like links to issue the commands.

There are plenty of ways that you can keep track of things that are going on in the game, and easily update them, without resorting to full-on automation.
Get creative!
_________________
Discord: Shalimarwildcat
Reply with quote
jerup
Newbie


Joined: 27 Oct 2015
Posts: 4

PostPosted: Tue Oct 27, 2015 6:44 am   
 
Hello and thanks for your reply!

In regards to the question of ethics, its perfectly allowed to automate, AS long as i hit the key.. They just dont want us possibly performing actions, while being away..

I am aware of your ideas to bring attention to A certain action happening, but alot Can be tedious Work, for example wielding A weapon 20 times in 5 minutes, because xp mobs disarm..
How would my trigger look if i wanted to:

You are disarmed ->


(When i Press Enter/ other command:) -> wield sword
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Tue Oct 27, 2015 10:42 am   
 
#TRIGGER {You are disarmed.} {nextCommand=wield sword}
#ONINPUT {^$} {#SEND %pop(nextCommand)}

Something like that should work, if you use an empty command line.
_________________
Discord: Shalimarwildcat
Reply with quote
jerup
Newbie


Joined: 27 Oct 2015
Posts: 4

PostPosted: Tue Oct 27, 2015 9:36 pm   
 
I changed the trigger to

#TRIGGER {You are disarmed.} {#addi {nextcommand} {wield sword}

This is so i can queue up commands, to be performed with more keystrokes

This is working

#ONINPUT {^$} {#SEND %pop(nextCommand)}

After i typed this in prompt, it resulted in a trigger looking like this:

^$

with the value:

#SEND %pop(nextCommand)


This didn't work for me, meaning i never send the @nextcommand

So i removed the $ so now i have a trigger that is: ^ with the command #SEND %pop(nextCommand)

This works almost! Now my queued up triggers activate when i type any command..

It doesn't activate when i just press blank line (enter)

What am i doing wrong?

Edit: I know I must seem dim-witted, and I am, in regard to cmud and zmud..but it's not for lack of trying, I try to research the solutions, it's just hard for me to understand what I'm reading, so the help is nice
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Wed Oct 28, 2015 6:01 am   
 
The %pop function both returns and removes the first item of string list.
So it should work regardless of how many members the @nextCommand variable contains.

In pattern patching ^ anchors to the start of a new line
$ anchors to the end of the line
together they signify a blank line

Not sure why that wouldn't work on an input trigger though.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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