Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands
In directory sc8-pr-cvs1:/tmp/cvs-serv21677/wolfpack/commands
Modified Files:
wipe.py
Log Message:
'wipe all, will remove all "in world" items
Index: wipe.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/wipe.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** wipe.py 1 Sep 2003 04:56:45 -0000 1.1
--- wipe.py 2 Sep 2003 02:32:19 -0000 1.2
***************
*** 31,35 ****
def onCommand( socket, command, argstring ):
if len( argstring ) > 0:
! socket.sysmessage( "Argument handling not implemented [yet]")
else:
socket.sysmessage("Select the area to remove")
--- 31,37 ----
def onCommand( socket, command, argstring ):
if len( argstring ) > 0:
! if argstring.lower() == "all":
! gump = WarningGump( 1060635, 30720, "Wipping <i>all</i> items in the world.<br>Do you wish to proceed?", 0xFFC000, 420, 400, wipeAllWorld, [] )
! gump.send( socket )
else:
socket.sysmessage("Select the area to remove")
***************
*** 37,40 ****
--- 39,58 ----
return 1
+
+ def wipeAllWorld( player, accept, state ):
+ if not accept:
+ player.socket.sysmessage( "Wipe command have been canceled" )
+ return 1
+
+ player.socket.sysmessage( "Removing all items from world, this may take a while" )
+ iterator = wolfpack.itemiterator()
+ item = iterator.first
+ count = 0;
+ while item:
+ if item.container == None:
+ item.delete()
+ count += 1
+ item = iterator.next
+ player.socket.sysmessage( "%i items have been removed from world" % count )
def wipeBoundingBox( socket, target1, target2 ):
|