Code:
----
class Test(Script):
"""
Base class for a character state which presents output slowly.
Simply derive a child class, and define output_text and next_script
"""
output_text = []
next_script = None
def at_script_creation(self):
super(Test, self).at_script_creation()
self.key = "test"
self.interval = 3
self.repeats = 1
self.start_delay = False
self.persistent = False
def at_repeat(self):
self.obj.msg('Test repeat!')
----
Then:
@py me.scripts.add('<module>.Test')
If repeats = 1 during script creation, it will only fire once, as expected, but
the script will not be automatically stopped at the end. If the server
restarts, it will fire again, unless it's manually stopped.
@scripts output stays like this forever:
+-----+-------------+-----------------------+--------+-------+------+----+------
------------------+-------------------------------------------------------------
----+
| id | obj | key | intval | next | rept | db |
typeclass |
desc |
+-----+-------------+-----------------------+--------+-------+------+----+------
------------------+-------------------------------------------------------------
----+
| ...
|
| 111 | Golden Hawk | test | 3s | -- | 1 | - |
Test |
|
+-----+-------------+-----------------------+--------+-------+------+----+------
------------------+-------------------------------------------------------------
----+
Original issue reported on code.google.com by daniel@benoy.name on 15 Aug 2013 at 5:18
Original issue reported on code.google.com by
daniel@benoy.name
on 15 Aug 2013 at 5:18