More whitespace cleanup.

This commit is contained in:
Griatch 2012-03-30 23:57:04 +02:00
parent c0322c9eae
commit 45c5be8468
43 changed files with 1116 additions and 1131 deletions

View file

@ -1,9 +1,9 @@
"""
Example script for testing. This adds a simple timer that
has your character make observations and noices at irregular
intervals.
intervals.
To test, use
To test, use
@script me = examples.bodyfunctions.BodyFunctions
The script will only send messages to the object it
@ -11,7 +11,7 @@ is stored on, so make sure to put it on yourself
or you won't see any messages!
"""
import random
import random
from ev import Script
class BodyFunctions(Script):
@ -19,26 +19,26 @@ class BodyFunctions(Script):
This class defines the script itself
"""
def at_script_creation(self):
def at_script_creation(self):
self.key = "bodyfunction"
self.desc = "Adds various timed events to a character."
self.interval = 20 # seconds
#self.repeats = 5 # repeat only a certain number of times
self.start_delay = True # wait self.interval until first call
#self.persistent = True
def at_repeat(self):
"""
This gets called every self.interval seconds. We make
a random check here so as to only return 33% of the time.
This gets called every self.interval seconds. We make
a random check here so as to only return 33% of the time.
"""
if random.random() < 0.66:
# no message this time
return
return
rand = random.random()
# return a random message
if rand < 0.1:
if rand < 0.1:
string = "You tap your foot, looking around."
elif rand < 0.2:
string = "You have an itch. Hard to reach too."
@ -58,6 +58,6 @@ class BodyFunctions(Script):
string = "You get a great idea. Of course you won't tell anyone."
else:
string = "You suddenly realize how much you love Evennia!"
# echo the message to the object
self.obj.msg(string)