referencing timers in aliases

Posted by Ignis on Wed 24 Aug 2005 08:23 AM — 6 posts, 28,306 views.

#0
is there a way reference enabling or disabling a timer in an alias/trigger?

is it something simple like sending "timer.<timername>.enabled = n" to command or execute?

also is there a way to create a random number, or to increment a value in an alias each time it's fired?
USA #1
EnableTimer "timername", 1 to enable, or 0 to disable (syntax changes depending on your script language).

Random functions are totally script dependant, so the syntax varies, but yes, very possible.

and yes, you can just have the alias add 1 to a variable via a script.
Or, you can use the information provided with the alias (via GetAliasInfo, 10 and 11). I'm honestly not sure what the difference between 10 and 11 is, nor do I know when/if they reset (which may or may not be your intent).
Russia #2
Check the following functions in Mushclient's Help:

world.EnableTimer
world.SetVariable
world.GetVariable

Random numbers can be done in any scripting language, so take your pick.
#3
okay, I can get my aliases, triggers, timers and what-nots working, and I know a decent bit about vb, but I can't seem to get scripting working in mc, any idea what I'm doing wrong?


I have scripting enabled, I don't have any saved scripts yet though, I also have kinda taken the easy way out with my previous aliases and triggers and not actually tried calling a script function to work.

Error number: -2146827864
Event: Execution of line 1 column 1
Description: Object required: '[string: "who"]'
Line in error:

Called by: Immediate execution

if the error message means anything to anyone
#4
Can you post the code that causes the error? Or don't you know yet which bit of code is doing this?

It appears that you're trying to execute a script function "who" and the function or object isn't found. Did you specify the proper target (i.e., script versus world)?
USA #5
You're probably forgetting to include a script command at all.

Remember, to send something to the world, you need to tell the script engine to SEND.
"who"
would be as if you simply typed "who" on a line in a script.
to send, you need to use this:
send "who"
or World.Send "who"
but in most cases, the world is unnecessary.