Advertisement
Guest User

Untitled

a guest
Mar 13th, 2010
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import random
  4. from Credentials import botowner, botname, botpassword
  5. from SubspaceBot import *
  6.  
  7.  
  8. if __name__ == '__main__':
  9.     bot = SubspaceBot(botowner, 'This bot announces ship changes')
  10.     bot.connectToServer('66.235.184.102', 7900, botname, botpassword, '#python')
  11.    
  12.     print "Bot connected to server"
  13.    
  14.     while bot.isConnected():
  15.         event = bot.waitForEvent()
  16.         if event.type == EVENT_CHANGE:
  17.             if event.old_ship != event.player.ship:
  18.                 bot.sendArenaMessage(event.player.name + ' changed from ' + GetShipName(event.old_ship) + ' to ' + GetShipName(event.player.ship) + '!')
  19.            
  20.     print "Bot disconnected"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement