|
Ashur Novice
Joined: 25 Jul 2011 Posts: 39
|
Posted: Sun Sep 04, 2011 10:48 pm
Does cmud keep track of the times of outputs? |
I want to make a trigger/timer that will send commands every X seconds, so that I don't idle out. But I'd like it to only send a command to the MUD if I've been idle for X seconds. Does CMUD keep track of this information in any way or will I have to get clever?
|
|
|
|
Fizgar Magician
Joined: 07 Feb 2002 Posts: 333 Location: Central Virginia
|
Posted: Mon Sep 05, 2011 2:22 am |
There isn't any built in function that will keep track of the amount of time since your last command was entered that I know of. If you are going to make an alarm that will send commands every x seconds all you need to do is name that alarm in the id field of the trigger. Then make a second command input trigger that will match on anything and have it reset the idle alarm. Below is an example that may illustrate what I'm trying to say better, it's been a long day.
This would be the "idle alarm" trigger that you would have the commands in, to keep you from going idle. This example fires every 10 seconds.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger name="alarm" type="Alarm" priority="10" copy="yes">
<pattern>10</pattern>
<value>//command to keep you from going idle goes in this alarm</value>
</trigger>
</cmud> |
This is the command input trigger that will reset the "idle alarm" whenever you enter a command.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger type="Command Input" priority="20" copy="yes">
<pattern>*</pattern>
<value>#call %alarm(alarm,10000)</value>
</trigger>
</cmud> |
|
|
_________________ Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34 |
|
|
|
|
|