[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  referencing timers in aliases

referencing timers in aliases

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Ignis   (26 posts)  [Biography] bio
Date Wed 24 Aug 2005 08:23 AM (UTC)
Message
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?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Wed 24 Aug 2005 08:53 AM (UTC)
Message
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).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #2 on Wed 24 Aug 2005 08:54 AM (UTC)
Message
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.
[Go to top] top

Posted by Ignis   (26 posts)  [Biography] bio
Date Reply #3 on Wed 24 Aug 2005 09:29 AM (UTC)
Message
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
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #4 on Wed 24 Aug 2005 07:44 PM (UTC)
Message
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)?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #5 on Wed 24 Aug 2005 09:56 PM (UTC)
Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,327 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]