[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]  AddTimer not adding anything
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

AddTimer not adding anything

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Larkin   (278 posts)  [Biography] bio
Date Fri 18 Feb 2005 03:38 PM (UTC)  quote  ]
Message
I'm trying to make a system whereby flags will reset themselves when commands fail. If the command succeeds, I want to delete the timer before it fires. My problem, however, is that the timer isn't created when I put something in the Script parameter field. I've tried varying the other parameters to see if it has any effect, but the only thing that allows me to successfully add the timer is to null out the Script parameter.

I'm using Lua for this and here's basically what I want to do:


function Balances:flag(key, val)
  self.flags[key] = val
  Note("Flag " .. tostring(key) .. " set to " .. tostring(val))
  AddTimer("resetflag_" .. key, 0, 0, 2, "", timer_flag.Enabled + timer_flag.OneShot + timer_flag.Replace + timer_flag.Temporary, "Balances:resetflag")
end

function Balances:resetflag(a, b, c)
  Note("Timer fired to reset a flag")
end


Then, I have an alias for when I try to do a certain action and set the flag to true. When the action succeeds, I have a trigger to delete the named timer for the flag and set another flag for my balance.

Can anyone point out something I should be doing differently?

(I've tried using a global function instead of the class/table function. I've also tried putting a 'dummy' command in the 'Send to world' parameter. Neither have worked for me.)

Thanks!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Fri 18 Feb 2005 04:44 PM (UTC)  quote  ]
Message
You can't have a subroutine that has a colon in it. So your timer isn't being created because it's an invalid script name.

And timers only send one argument (the timer name), since theres no line, or wildcards.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #2 on Fri 18 Feb 2005 05:09 PM (UTC)  quote  ]
Message
Thanks. I think it was the parameters not matching up that got me. If it's mentioned in the documentation, I simply overlooked it. Too bad I can't call a table function. That I can live with, though.
[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.


1,716 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [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.

[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]    [Web site powered by FutureQuest.Net]