I prefer using what I call "scripted timers" for that sort of thing. This means measuring the time between trigger calls of the script routine to figure out if a certain time period has elapsed. I find that to be more convenient than adding/deleting mushclient timers all the time, especially if you want to queue several jobs like that. The template for a "scripted timer" involves:
1. A trigger subroutine
2. A "balance" variable - this is a flag which defines whether you can or not perform a certain queued task.
3. A "time stamp" variable - this stores the exact time when the balance variable was set to false (the task was performed) last.
4. A "time setting" subroutine - sets the value of the time stamp variable (3); is called everytime the balance variable (2) is set to false - the corresponding task is performed
5. A "time check" function - subtracts the time stamp from the time of the current call, then compares the result to the specified time period for a specific balance variable. Returns vbTrue if the time period has elapsed, vbFalse - if it's still too early to perform the task again.
The entire setup makes sure you perform a specific task no more often than over a specific interval of time, which is what is achieved with MC timers. However, I find this approach to be a lot cleaner than fiddling around with multiple MC timers, and com calls associated with them. It is also very simple to expand to add new tasks - you just have to add new balance/time-stamp variable pairs for each task and include them in your subs and function.
Here's an example script in vbs:
'This is the balance/time-stamp pair for the "oil" task
dim oilBalance, oilTimestamp
oilBalance = vbTrue
'This is the sub called by your prompt trigger
'
sub CheckPrompt(name, output, wildcs)
'code to extract and store the values from the prompt goes
'somewhere around here
'and here's the timer-related code
if oilBalance then
world.send "rub oil"
SetTimeStamp "oil"
oilBalance = vbFalse
else
if TimingExpired("oil") then
world.send "rub oil"
SetTimeStamp "oil"
oilBalance = vbFalse
end if
end if
end sub
'This sets the time stamp
'
sub SetTimeStamp(task)
select case task
case "oil"
oilTimeStamp = Timer
end select
end sub
'This checks if the timing for a certain task has expired
'
function TimingExpired(task)
dim timeNow, timeDiff
timeNow = Timer
select case task
case "oil"
timeDiff = timeNow - oilTimestamp
if (timeDiff < 0) then
timeDiff = timeNow + (86400 - oilTimestamp)
end if
if (timeDiff < 4.0) then 'here 4.0 denotes the delay between oil rubs
TimingExpired = vbFalse
else
oilBalance = vbTrue
TimingExpired = vbTrue
end if
end select
end function
For fool-proofness' sake you can add a 1 sec timer to the prompt trigger to check for the expiration of the balance time - that offers enough protection against lag, from my experience.