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
Ashur
Novice


Joined: 25 Jul 2011
Posts: 39

PostPosted: 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?
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: 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
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