Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands
In directory sc8-pr-cvs1:/tmp/cvs-serv31082/wolfpack/commands
Modified Files:
__init__.py action.py bank.py decoration.py export.py
import.py info.py where.py wipe.py
Log Message:
Changed scripts to resemble changes in wolfpack.registerglobal and wolfpack.registercommand
Added barebone for new magic system.
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/__init__.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** __init__.py 10 Jul 2003 10:14:31 -0000 1.3
--- __init__.py 23 Sep 2003 12:17:39 -0000 1.4
***************
*** 2,11 ****
import wolfpack
def onLoad():
! wolfpack.registercommand( "enablegod", "wolfpack.commands" )
!
! def onCommand( socket, command, arguments ):
! if command == "ENABLEGOD":
! packet = [ 0x2b, 0x01 ]
! socket.sendpacket( packet )
!
\ No newline at end of file
--- 2,9 ----
import wolfpack
+ def enablegod( socket, command, arguments ):
+ packet = [ 0x2b, 0x01 ]
+ socket.sendpacket( packet )
+
def onLoad():
! wolfpack.registercommand( "enablegod", enablegod )
Index: action.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/action.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** action.py 26 Jul 2003 01:54:43 -0000 1.1
--- action.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 9,17 ****
import wolfpack
-
- def onLoad():
- wolfpack.registercommand( "action", "wolfpack.commands.action" )
! def onCommand( socket, command, arguments ):
try:
action = hex2dec( arguments )
--- 9,14 ----
import wolfpack
! def action( socket, command, arguments ):
try:
action = hex2dec( arguments )
***************
*** 19,20 ****
--- 16,20 ----
except:
socket.sysmessage( 'Usage: action <animation-id>' )
+
+ def onLoad():
+ wolfpack.registercommand( "action", action )
Index: bank.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/bank.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bank.py 26 Jul 2003 01:54:43 -0000 1.1
--- bank.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 11,18 ****
from wolfpack.utilities import hex2dec
! def onLoad():
! wolfpack.registercommand( "bank", "wolfpack.commands.bank" )
!
! def onCommand( socket, command, arguments ):
arguments = arguments.strip() # Remove trailing and leading whitespaces
layer = 0x1d
--- 11,15 ----
from wolfpack.utilities import hex2dec
! def bank( socket, command, arguments ):
arguments = arguments.strip() # Remove trailing and leading whitespaces
layer = 0x1d
***************
*** 40,41 ****
--- 37,42 ----
char.socket.sendcontainer( container )
+
+ def onLoad():
+ wolfpack.registercommand( "bank", bank )
+
\ No newline at end of file
Index: decoration.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/decoration.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** decoration.py 29 Aug 2003 17:58:11 -0000 1.1
--- decoration.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 10,14 ****
import os
-
def processFile( filename, map ):
count = 0
--- 10,13 ----
***************
*** 62,69 ****
return 0
! def onLoad():
! wolfpack.registercommand("decoration", "wolfpack.commands.decoration")
!
! def onCommand( socket, command, arguments ):
char = socket.player
socket.sysmessage("Generating world decoration, please wait.")
--- 61,65 ----
return 0
! def decoration( socket, command, arguments ):
char = socket.player
socket.sysmessage("Generating world decoration, please wait.")
***************
*** 81,82 ****
--- 77,81 ----
socket.sysmessage("World generating complete. %i items were generated." % count )
+
+ def onLoad():
+ wolfpack.registercommand( "decoration", decoration )
Index: export.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/export.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** export.py 18 Jun 2003 00:04:17 -0000 1.1
--- export.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 11,21 ****
from wolfpack.gumps import cGump
def onLoad():
! wolfpack.registercommand( "export", "wolfpack.commands.export" )
!
! def onCommand( socket, command, arguments ):
! if command == "EXPORT":
! socket.sysmessage( "Target the upper left corner of the area you want to export." )
! socket.attachtarget( "wolfpack.commands.export.callback", [] )
def callback( char, args, target ):
--- 11,20 ----
from wolfpack.gumps import cGump
+ def export( socket, command, arguments ):
+ socket.sysmessage( "Target the upper left corner of the area you want to export." )
+ socket.attachtarget( "wolfpack.commands.export.callback", [] )
+
def onLoad():
! wolfpack.registercommand( "export", export )
def callback( char, args, target ):
Index: import.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/import.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** import.py 1 Sep 2003 20:39:14 -0000 1.4
--- import.py 23 Sep 2003 12:17:39 -0000 1.5
***************
*** 12,48 ****
from wolfpack.utilities import hex2dec
! def onLoad():
! wolfpack.registercommand( "import", "wolfpack.commands.import" )
! def onCommand( socket, command, arguments ):
! if command == "IMPORT":
! char = socket.player
! gump = cGump( x=100, y=100, callback="wolfpack.commands.import.callback" )
! gump.addBackground( id=0x2436, width=350, height=300 )
!
! text = '<basefont color="#FEFEFE"><h3>Import</h3><br><basefont color="#FEFEFE">Enter the name of the worldfile you want to import below. But before clicking Import, choose the correct file format from the list. <!--You may also choose any other options you find suitable.-->'
! gump.addHtmlGump( x=20, y=20, width=310, height=200, html=text )
!
! # Radiobuttons
! gump.startGroup( 0 )
! gump.addRadioButton( x=20, y=160, off=0x25f8, on=0x25fb, id=1 )
! gump.addText( x=55, y=165, text='Sphere 51a', hue=0x835 )
!
! gump.addRadioButton( x=150, y=160, off=0x25f8, on=0x25fb, id=2, selected=1 )
! gump.addText( x=185, y=165, text='WSC', hue=0x835 )
!
! gump.addRadioButton( x=250, y=160, off=0x25f8, on=0x25fb, id=3 )
! gump.addText( x=285, y=165, text='Text', hue=0x835 )
! # InputField
! gump.addResizeGump( x=20, y=210, id=0xBB8, width=310, height=25 )
! gump.addInputField( x=25, y=212, width=295, height=20, hue=0x834, id=1, starttext="export.wsc" )
! gump.addText( x=265, y=250, text='Import', hue=0x835 )
! gump.addButton( x=310, y=250, up=0x26af, down=0x26b1, returncode=1 )
! gump.send( char )
"""
--- 12,47 ----
from wolfpack.utilities import hex2dec
! def import_command( socket, command, arguments ):
! char = socket.player
!
! gump = cGump( x=100, y=100, callback="wolfpack.commands.import.callback" )
!
! gump.addBackground( id=0x2436, width=350, height=300 )
!
! text = '<basefont color="#FEFEFE"><h3>Import</h3><br><basefont color="#FEFEFE">Enter the name of the worldfile you want to import below. But before clicking Import, choose the correct file format from the list. <!--You may also choose any other options you find suitable.-->'
! gump.addHtmlGump( x=20, y=20, width=310, height=200, html=text )
! # Radiobuttons
! gump.startGroup( 0 )
! gump.addRadioButton( x=20, y=160, off=0x25f8, on=0x25fb, id=1 )
! gump.addText( x=55, y=165, text='Sphere 51a', hue=0x835 )
!
! gump.addRadioButton( x=150, y=160, off=0x25f8, on=0x25fb, id=2, selected=1 )
! gump.addText( x=185, y=165, text='WSC', hue=0x835 )
! gump.addRadioButton( x=250, y=160, off=0x25f8, on=0x25fb, id=3 )
! gump.addText( x=285, y=165, text='Text', hue=0x835 )
! # InputField
! gump.addResizeGump( x=20, y=210, id=0xBB8, width=310, height=25 )
! gump.addInputField( x=25, y=212, width=295, height=20, hue=0x834, id=1, starttext="export.wsc" )
! gump.addText( x=265, y=250, text='Import', hue=0x835 )
! gump.addButton( x=310, y=250, up=0x26af, down=0x26b1, returncode=1 )
! gump.send( char )
! def onLoad():
! wolfpack.registercommand( "import", import_command )
"""
Index: info.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/info.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** info.py 1 Sep 2003 22:15:11 -0000 1.9
--- info.py 23 Sep 2003 12:17:39 -0000 1.10
***************
*** 15,27 ****
from wolfpack import *
- def onLoad():
- wolfpack.registercommand( "info", "wolfpack.commands.info" )
-
- def onCommand( socket, command, argstring ):
- if command == "INFO":
- info( socket, command, argstring )
-
- return 1
-
def info( socket, command, argstring ):
args = argstring.split(" ")
--- 15,18 ----
***************
*** 32,35 ****
--- 23,29 ----
socket.attachtarget( "wolfpack.commands.info.infotargetresponse", args )
return 1
+
+ def onLoad():
+ wolfpack.registercommand( "info", info )
def infotargetresponse( char, args, target ):
Index: where.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/where.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** where.py 26 Jul 2003 01:54:43 -0000 1.1
--- where.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 9,17 ****
import wolfpack
-
- def onLoad():
- wolfpack.registercommand( "where", "wolfpack.commands.where" )
! def onCommand( socket, command, arguments ):
char = socket.player
region = char.region
--- 9,14 ----
import wolfpack
! def where( socket, command, arguments ):
char = socket.player
region = char.region
***************
*** 41,42 ****
--- 38,42 ----
else:
char.message( "You are at %d,%d,%d on %s" % ( pos.x, pos.y, pos.z, map ) )
+
+ def onLoad():
+ wolfpack.registercommand( "where", where )
Index: wipe.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/wipe.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** wipe.py 2 Sep 2003 02:32:19 -0000 1.2
--- wipe.py 23 Sep 2003 12:17:39 -0000 1.3
***************
*** 23,33 ****
else:
args[1]( char.socket, args[2], target )
-
- def onLoad():
- wolfpack.registercommand( "wipe", "wolfpack.commands.wipe" )
- wolfpack.registercommand( "nuke", "wolfpack.commands.wipe" )
! def onCommand( socket, command, argstring ):
if len( argstring ) > 0:
if argstring.lower() == "all":
--- 23,29 ----
else:
args[1]( char.socket, args[2], target )
! def nuke( socket, command, argstring ):
if len( argstring ) > 0:
if argstring.lower() == "all":
***************
*** 68,69 ****
--- 64,68 ----
return 1
+ def onLoad():
+ wolfpack.registercommand( "wipe", nuke )
+ wolfpack.registercommand( "nuke", nuke )
|