diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-06-02 15:28:08 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-06-02 15:28:08 +0000 |
commit | f663df0088711641bcfe614ca6ec447ddff572de (patch) | |
tree | 29ee066b74776227b32fc01664b79383ee1a24e8 | |
parent | 2b8318623e7064c6370234e64ae26622dd9dd433 (diff) | |
download | manaserv-f663df0088711641bcfe614ca6ec447ddff572de.tar.gz manaserv-f663df0088711641bcfe614ca6ec447ddff572de.tar.bz2 manaserv-f663df0088711641bcfe614ca6ec447ddff572de.tar.xz manaserv-f663df0088711641bcfe614ca6ec447ddff572de.zip |
Used an example for schedule_in which is more in step with actual practice. Used an example for schedule_every which is less annoying for the server admin.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | data/test.lua | 27 |
2 files changed, 22 insertions, 11 deletions
@@ -1,3 +1,9 @@ +2008-06-02 Philipp Sehmisch <tmw@crushnet.org> + + * data/test.lua: Used an example for schedule_in which is more in step with + actual practice. Used an example for schedule_every which is less annoying + for the server admin. + 2008-05-31 Philipp Sehmisch <tmw@crushnet.org> * data/script/libtmw.lua: Scripted a scheduler which can execute script diff --git a/data/test.lua b/data/test.lua index ad006a52..c2a88126 100644 --- a/data/test.lua +++ b/data/test.lua @@ -27,17 +27,9 @@ atinit(function() tmw.trigger_create(56 * 32, 32 * 32, 64, 64, "patrol_waypoint", 1, true) tmw.trigger_create(63 * 32, 32 * 32, 64, 64, "patrol_waypoint", 2, true) - schedule_every(5, function() - print("This is the schedule_every 5 seconds task") + schedule_every(3600, function() + print("One hour has passed on map 1-1") end) - - schedule_in(25, function() - print("This is the schedule_in 25 seconds after map initialisation task") - schedule_in(7, function() - print("This task was scheduled 7 seconds ago by the other schedule_in task") - end) - end) - end) @@ -61,7 +53,8 @@ function npc1_talk(npc, ch) "A Christmas party!", "To buy.", "To sell.", - "To make a donation.") + "To make a donation.", + "Slowly count from one to ten.") if v == 1 then do_message(npc, ch, "Sorry, this is a heroic-fantasy game, I do not have any gun.") elseif v == 2 then @@ -90,6 +83,18 @@ function npc1_talk(npc, ch) else do_message(npc, ch, "I would feel bad taking money from someone that poor.") end + elseif v == 6 then + tmw.being_say(npc, "As you wish...") + schedule_in(2, function() tmw.being_say(npc, "One") end) + schedule_in(4, function() tmw.being_say(npc, "Two") end) + schedule_in(6, function() tmw.being_say(npc, "Three") end) + schedule_in(8, function() tmw.being_say(npc, "Four") end) + schedule_in(10, function() tmw.being_say(npc, "Five") end) + schedule_in(12, function() tmw.being_say(npc, "Six") end) + schedule_in(14, function() tmw.being_say(npc, "Seven") end) + schedule_in(16, function() tmw.being_say(npc, "Eight") end) + schedule_in(18, function() tmw.being_say(npc, "Nine") end) + schedule_in(20, function() tmw.being_say(npc, "Ten") end) end end |