Advertisement
Kovitikus

The Sands' Little Teapot

Apr 6th, 2020
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. from typeclasses.scripts import Script
  2. from typeclasses.objects import Object
  3. import evennia
  4.  
  5.  
  6. class MobScript(Script):
  7.    
  8.     def at_script_creation(self):
  9.        
  10.         self.interval = 30  # every 30 seconds
  11.        
  12.     def at_repeat(self):
  13.        
  14.         self.obj.teapot()
  15.        
  16. class Mob(Object):
  17.    
  18.     def at_object_creation(self):
  19.         ai = evennia.create_script(key='Mob_AI', typeclass='codes.test.MobScript', obj=self)
  20.        
  21.     def teapot(self):
  22.         self.location.msg_contents(self.name + ' sings, \'I\'m a little teapot short and stout.\'')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement