google-code-export / evennia

Automatically exported from code.google.com/p/evennia
Other
1 stars 0 forks source link

repeats = 1 and start_delay = False causes problems #421

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Blame @Google for that formatting problem there, not me.

Original comment by daniel@benoy.name on 15 Aug 2013 at 5:18

GoogleCodeExporter commented 9 years ago

Original comment by griatch on 21 Aug 2013 at 1:44