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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  referencing timers in aliases
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

referencing timers in aliases

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Ignis   (22 posts)  [Biography] bio
Date Wed 24 Aug 2005 08:23 AM (UTC)  quote  ]
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)  quote  ]
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)  quote  ]
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   (22 posts)  [Biography] bio
Date Reply #3 on Wed 24 Aug 2005 09:29 AM (UTC)  quote  ]
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)  quote  ]
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)  quote  ]
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.


3,895 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]