From 35c3d0fc930710bb8447ad0bba7094f62d005450 Mon Sep 17 00:00:00 2001 From: akirschbaum Date: Thu, 10 Nov 2005 22:20:56 +0000 Subject: [PATCH] Make it work with with new Python plugin; remove debug output; make source-code formatting consistent. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/trunk/maps@4028 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/IPO/board.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/python/IPO/board.py b/python/IPO/board.py index 4fef5d3b0..41196d7bd 100755 --- a/python/IPO/board.py +++ b/python/IPO/board.py @@ -28,14 +28,12 @@ import string board = CFBoard.CFBoard() -activator=Crossfire.WhoIsActivator() -activatorname=activator.Name -whoami=Crossfire.WhoAmI() +activator = Crossfire.WhoIsActivator() +activatorname = activator.Name +whoami = Crossfire.WhoAmI() -boardname=Crossfire.ScriptParameters() # 6 is say event -print "Activated %s" %boardname - -if (boardname): +boardname = Crossfire.ScriptParameters() +if boardname: text = string.split(Crossfire.WhatIsMessage(), ' ', 1) @@ -44,7 +42,7 @@ if (boardname): activator.Write(message) elif text[0] == 'write': - if len(text)==2: + if len(text) == 2: board.write(boardname, activatorname, text[1]) activator.Write('Added to %s'%boardname) else: @@ -59,15 +57,16 @@ if (boardname): id = 1 for element in elements: author, message = element - activator.Write('<%d> (%s) %s'%(id,author,message)) - id=id+1 + activator.Write('<%d> (%s) %s'%(id, author, message)) + id = id+1 else: activator.Write('%s is empty'%boardname) elif text[0] == 'remove': - if len(text)==2: - if board.getauthor(boardname,int(text[1]))==activatorname or activator.IsDungeonMaster: - if board.delete(boardname, int(text[1])): + if len(text) == 2: + index = int(text[1]) + if board.getauthor(boardname, index) == activatorname or activator.DungeonMaster: + if board.delete(boardname, index): activator.Write('Removed from %s'%boardname) else: activator.Write('Doesn\'t exist on %s'%boardname)