[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]  Lua
. . -> [Subject]  addxml timers

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: addxml timers
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,801 posts)  [Biography] bio   Forum Administrator
Date Fri 25 May 2007 11:08 PM (UTC)  quote  ]
Message
You are right, there is a bug in ImportXML where it doesn't reset a new timer.

I will correct that in the next version.

Meanwhile, in your example, adding the line:


ResetTimer ("test1")


... after addxml.timer, will fix it.

What MUSHclient does, is reset all timers after loading a new world, so for a full load, timers will be reset. However when the ImportXML functionality was added, the need to reset individual timers was overlooked.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Fri 25 May 2007 09:07 AM (UTC)  quote  ]
Message
I tested that out, and it worked fine, but I didn't think that it was waiting the 5 seconds. I set second=59, and it still was firing within two seconds. Adding offset_second=59 to that as well still did not delay the printing more than 2 seconds. This is with MC 4.05

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by Nick Gammon   Australia  (18,801 posts)  [Biography] bio   Forum Administrator
Date Fri 25 May 2007 05:17 AM (UTC)  quote  ]
Message
You are not quoting the send text. It should read:


require "addxml"
addxml.timer {
  name = "test1",
  enabled = true,
  second = 5,
  send_to = 12,
  one_shot = true,
  send = [[
print("hello")
print("how are you")
]]
  }


The way you have done it, the print statements are evaluated immediately, because they are evaluated at addxml.timer time, not when the timer fires.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shaun Biggs   USA  (644 posts)  [Biography] bio
Date Thu 24 May 2007 11:08 PM (UTC)  quote  ]
Message
I think you may have found a bug. I can't get that to work properly even with setting offset_second to 5. For now, just use the DoAfterSpecial function. http://www.gammon.com.au/scripts/function.php?name=DoAfterSpecial

It is much easier to fight for one's ideals than to live up to them.
[Go to top] top

Posted by ReallyCurious   USA  (50 posts)  [Biography] bio
Date Thu 24 May 2007 09:05 PM (UTC)  quote  ]
Message
require "addxml"
addxml.timer {name = "test1",
enabled = true,
second = 5,
send_to = 12,
one_shot = true,
send = print("hello"),
print("how are you")
}

I want to create a labeled timer similar to this but not have it fire when it's created, but to fire 5 seconds after it's created. Can I do this?
[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,623 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]