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
okkita
Newbie


Joined: 23 Oct 2002
Posts: 6
Location: Spain

PostPosted: Wed Oct 23, 2002 2:13 pm   

repeating commands, timelines
 
Hi!

I want to create some mechanism to repeat commands in certain periods. For example, reading a book each 5 minutes, or checking mail every 30 minutes.

Would it be possible to implement it in a form like? (without toggle buttons):
autocommands on
autocommands off
autocommands (AUTOCOMMANDS is currently off)

Also, how could it be done so it holds several "timelines" (different delays) with a set of several commands for each one of them?

Help most appreciated :)

(I've 3.36B if it helps)


Okkita
Reply with quote
Lalaynya
Wanderer


Joined: 23 Aug 2002
Posts: 96

PostPosted: Wed Oct 23, 2002 6:16 pm   
 
quote:

Hi!

I want to create some mechanism to repeat commands in certain periods. For example, reading a book each 5 minutes, or checking mail every 30 minutes.

Would it be possible to implement it in a form like? (without toggle buttons):
autocommands on
autocommands off
autocommands (AUTOCOMMANDS is currently off)

Also, how could it be done so it holds several "timelines" (different delays) with a set of several commands for each one of them?

Help most appreciated :)

(I've 3.36B if it helps)


Okkita



You use classes to be able to turn certain sets of triggers and other settings on and off. Timer triggers can be used to schedule certain commands to be executed at specific intervals, and an alias could be used to turn the class on and off, and report the status.

For example, if you put all your timers into a class named AUTO, then this alias will let you turn them on and off:

#AL {autocommands} {#IF ("%1"="on") {#CLASS auto 1};#IF ("%1"="off") {#CLASS auto 0};#if (%class(auto)) {#show Autocommands are currently ON} {#show Autocommands are currently OFF} }
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Oct 23, 2002 6:23 pm   
 
If you had a current version, I'd recommend using #ALARM for the commands and #CLASS for
the toggle. Since you're using such an old version though, nobody but you is likely to
know what commands are available so you'll probably have to find your own solution.

You can use a variable, with an #IF, as your toggle.


LightBulb
Senior Member
Reply with quote
okkita
Newbie


Joined: 23 Oct 2002
Posts: 6
Location: Spain

PostPosted: Thu Oct 24, 2002 10:26 am   
 
Thanks a lot Lalaynya! Looks and works great!

I meant I'm using 6.36B, nasty typo there :)

The main concern is if I would be able to control multiple #alarm timelines, and associate them with a set of commands each... perhaps even being able to modify such commands on the fly... and without defining untidy #alarms for each... let's say it would be nicer if more "dynamic"...

Sounds like database stuff for me. I'm == nil in zMUD dbase control...

Okkita
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Oct 24, 2002 12:45 pm   
 
It should be no problem. Just create your alarms but have them execute the command from a variable. Example:
#ALARM {*300} {#EXEC {@commands1}}

You can then set this variable to whatever commands you would like the alarm to execute:
#VAR commands1 {read book;turn page;drink water}

Kjata
Reply with quote
okkita
Newbie


Joined: 23 Oct 2002
Posts: 6
Location: Spain

PostPosted: Thu Oct 24, 2002 1:56 pm   
 
Hmm... I was thinking more on something like:

Delay Commands
3:00 @Timeline1
1:10 @Timeline2
... ...
*100 @TimelineN

I could be using quite some timelines, thats why I wanted some kind of unified timeline controller, so I can simply modify a record, or a variable and "configure" them altogether... perhaps I'm complicating it needlessly.

Anyways, thanks for the nice answers! :)

Okkita
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Oct 25, 2002 5:36 am   
 
I'm not following you, sorry. What do you want it to do? Wait three minutes and execute the first set of commands, then wait one minute, ten seconds and execute the second set of commands, and so on?

Kjata
Reply with quote
okkita
Newbie


Joined: 23 Oct 2002
Posts: 6
Location: Spain

PostPosted: Fri Oct 25, 2002 9:22 am   
 
What I want is something like:

add_timeline(delay, command_list, id)
command_list = {read book|turn page|read book|close book|put book in shelf}

remove_timeline(id)

query_timelines()
ID Delay Commands
auto_read *4:*10 read book|turn page|read book|close book|put book in shelf
auto_hp *20 hp
auto_who *1:00 who|people

In other words, a timeline controller...

Hope I explained it better now... tx in advance...


Okkita
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