|
sarduarkar Newbie
Joined: 08 Sep 2015 Posts: 4
|
Posted: Tue Sep 08, 2015 10:47 am
CMUD trigger coding help? |
Just installed 30-day trial of CMUD to see if the features are worth purchasing. Struggling with creating useful scripts/triggers due to lack of programming background and knowledge of zscript. Could someone please help with the following:
1. TICK TIMER reset.
My mud's tick interval is NOT static. It resets anywhere from between 25-35 secs, making the standard intervals CMUD provides always off.
What I want to do.... is have it reset the interval count when it notices a change in the "hour" on my command prompt. This is my command prompt: <389/406 * 414/454 * 419/419>[11]
The variable in brackets at the end, [11], is the time variable in hours. I'd like to reset the Tick Timer with #ts whenever that value changes (10->11->12->13.. 24->0->1 and so on). Is this possible?
2. Assigning HOTKEYS
- Numpad to equal directional North, East, South,West, Up, Down.
- Key "/" equal attack player A.
I apologize if this is in the wrong section. New to the forums and CMUD. Appreciate any help you can provide. Also, general consensus is CMUD is better than ZMUD if I want to stick with a mud program? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Wed Sep 09, 2015 1:48 am |
The numpad directions should be working by default, NumLock toggles it.
Those settings are known as Macroes.
As for you prompt, you just need to make a trigger to match it
#TRIGGER {<(%d)/(%d) ~* (%d)/(%d) ~* (%d)/(%d)>~[(%d)~]} {a bunch of variable assignments go here} _nodef {prompt}
Then you can make an expression trigger based off of the @hour variable you are likely to create.
#TR {@hour} {#TS} _nodef {Expression}
That last one might not work, I have never tried making an expression trigger from the command line, I usually use the GUI.
And yes, CMUD is better. It is the further development of zMUD. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
sarduarkar Newbie
Joined: 08 Sep 2015 Posts: 4
|
Posted: Wed Sep 09, 2015 4:07 am |
Thank you Shalimar. I will try fiddling with the code you posted. I am a complete noob with variables and the like, so may take me some time. Been reading many trigger tutorials in the interim to try to understand it.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Wed Sep 09, 2015 4:18 am |
Feel free to post for more help!
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
sarduarkar Newbie
Joined: 08 Sep 2015 Posts: 4
|
Posted: Thu Sep 10, 2015 11:37 am |
Trouble getting it to work. Here is what I've come up with after lots of reading.
#VARIABLE lasthour 0
#TRIGGER {<(%d)/(%d) ~* (%d)/(%d) ~* (%d)/(%d)>~[(%d)~]}
{#if (%7!=@lasthour) {
#var lasthour %7 then
#ts 30
}}
But for some reason not working properly. I'm guessing my syntax is wrong. Also, it seems to not check the prompt correctly. I am guessing this has something to do with the _nodef {prompt} syntax you posted somehow. How do I properly do that in the GUI? Note: I am putting this into GUI (trigger window popup in CMUD)?
The idea is to create the variable "lasthour" and then have it checked against current time. If they do not match, reset 30 second ticktimer and put in a new "lasthour".
Thanks! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Thu Sep 10, 2015 10:09 pm |
#TRIGGER {<(%d)/(%d) ~* (%d)/(%d) ~* (%d)/(%d)>~[(%d)~]} {
hp=%1
hpMax=%2
and so on to define your variables
#IF (%7!=@lastHour) {lastHour=%7;#TS}
}
In the GUI there are a series of checkboxes on any given trigger, the two that matter in this case are 'on newline' and 'on prompt', make sure newline is unchecked and prompt is checked if you only want it to fire on your prompt. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
sarduarkar Newbie
Joined: 08 Sep 2015 Posts: 4
|
Posted: Fri Sep 11, 2015 4:55 am |
Wonderful! Think it works now. You truly a guru, Shalimar. Thank you so much for your help.
|
|
|
|
Ambroas Newbie
Joined: 22 Aug 2016 Posts: 1
|
Posted: Mon Aug 22, 2016 3:50 am |
I have the same issue however I'm not sure at all about the prompt and such. First my prompt isn't as simple as his:
D - 0 - 5854 - 11time
260|266 333|333 273|274
The time is the same though, ticks in game range from 25-35 seconds. I'd like for CMUD to see a change in time on the prompt and #ts 30 when it does. I have no idea what I need to do, is the last post by Shalimar all I'd need to enter but with my prompt? I can also modify my prompt to be the same as his if that helps I guess but I like having the extra info. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Mon Aug 22, 2016 1:21 pm |
Usually better to start your own thread than to resurrect an old one, but not the end of the world.
#TR {^(%d)|(%d) (%d)|(%d) (%d)|(%d)$} {}
Somethink like that should capture the pattern, however I have no clue what each of those numbers represent for you, So I cant go much further. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|