Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Bug in executing script #2061

Closed
finalcn opened this issue Feb 20, 2020 · 1 comment
Closed

[BUG] Bug in executing script #2061

finalcn opened this issue Feb 20, 2020 · 1 comment
Labels
bug An actual error or unwanted behavior.

Comments

@finalcn
Copy link

finalcn commented Feb 20, 2020

Bug in executing script

Steps to reproduce the issue / Reasons for adding feature:

  1. Bug 1
class BugScript(DoNothing):
    def at_script_creation(self):
        self.interval=1
    def at_repeat(self):
        self.stop()

run script self=script.test.BugScript

at_repeat()  ''NoneType' object has no attribute 'callcount''
  1. Bug 2
class BugScript(DoNothing):
    def at_script_creation(self):
        self.interval=1
        self.start_delay=3
    def at_repeat(self):
        pass

run script self=script.test.BugScript

django.core.exceptions.ValidationError: ["'3' value must be either True or False."]
     Evennia version: 0.9.0
     OS: nt
     Python: 3.8.0
     Twisted: 19.7.0
     Django: 2.2.9
@finalcn finalcn changed the title [BUG] Script run error [BUG] Bug in executing script Feb 20, 2020
@Griatch Griatch added the bug An actual error or unwanted behavior. label Feb 29, 2020
@Griatch
Copy link
Member

Griatch commented Feb 29, 2020

@finalcn

  • The first script error is caused by the self.stop() in the at_repeat. I have now fixed so that the system handles that. Note that this particular example could just as well been a function - it will run once and then stop.
  • The second error is not a bug, you are using the wrong type. start_delay is (as the error indicates) a boolean that indicates if we should wait interval seconds before doing the first repeat or not. See https://github.com/evennia/evennia/wiki/Scripts#properties-and-functions-defined-on-scripts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An actual error or unwanted behavior.
Projects
None yet
Development

No branches or pull requests

2 participants