Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12383/commands
Modified Files:
__init__.py add.py events.py export.py
Log Message:
Changed all references to "events" to "scripts"
Index: export.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/export.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** export.py 23 Aug 2004 03:10:39 -0000 1.12
--- export.py 25 Aug 2004 17:03:04 -0000 1.13
***************
*** 202,206 ****
warnings += 'Item %s has an amount of %i. This information will be lost when made static.<br><br>' % ( hex( item.serial ), item.amount )
! eventlist = item.eventlist
if len( eventlist ) > 0:
warnings += 'Item %s has events (%s) assigned to it. It wont be usable when made static.<br><br>' % ( hex( item.serial ), eventlist )
--- 202,206 ----
warnings += 'Item %s has an amount of %i. This information will be lost when made static.<br><br>' % ( hex( item.serial ), item.amount )
! eventlist = item.scripts
if len( eventlist ) > 0:
warnings += 'Item %s has events (%s) assigned to it. It wont be usable when made static.<br><br>' % ( hex( item.serial ), eventlist )
Index: add.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/add.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** add.py 29 Jul 2004 19:45:58 -0000 1.9
--- add.py 25 Aug 2004 17:03:04 -0000 1.10
***************
*** 219,223 ****
def onLoad():
wolfpack.registercommand('add', add)
!
def onUnload():
global generated
--- 219,223 ----
def onLoad():
wolfpack.registercommand('add', add)
!
def onUnload():
global generated
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/__init__.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** __init__.py 24 Aug 2004 20:13:22 -0000 1.15
--- __init__.py 25 Aug 2004 17:03:04 -0000 1.16
***************
*** 90,94 ****
def nightsight(socket, command, arguments):
player = socket.player
! player.removeevent('magic.nightsight')
if player.hastag('nightsight'):
--- 90,94 ----
def nightsight(socket, command, arguments):
player = socket.player
! player.removescript('magic.nightsight')
if player.hastag('nightsight'):
Index: events.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/events.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** events.py 24 Aug 2004 18:10:23 -0000 1.4
--- events.py 25 Aug 2004 17:03:04 -0000 1.5
***************
*** 3,8 ****
from wolfpack.consts import LOG_MESSAGE, EVENT_USE
! def addevent_response(player, arguments, target):
! event = arguments[0]
object = None
--- 3,8 ----
from wolfpack.consts import LOG_MESSAGE, EVENT_USE
! def addscript_response(player, arguments, target):
! script = arguments[0]
object = None
***************
*** 19,51 ****
return
! player.log(LOG_MESSAGE, "Adds event '%s' to object 0x%x.\n" % (event, object.serial))
! object.addevent(event)
object.resendtooltip()
! player.socket.sysmessage('You add the event to your target.')
"""
! \command addevent
\description Attach a script to an object.
! \usage - <code>addevent [script]</code>
Script is the id of the script you want to attach.
"""
! def commandAddevent(socket, command, arguments):
if len(arguments) == 0:
! socket.sysmessage('Usage: addevent <identifier>')
return
! event = arguments.strip()
try:
! wolfpack.hasevent(event, EVENT_USE)
except:
! socket.sysmessage('No such event: %s.' % event)
return
! socket.sysmessage("Please select the object you want to add the event '%s' to." % event)
! socket.attachtarget('commands.events.addevent_response', [event])
! def removeevent_response(player, arguments, target):
! event = arguments[0]
object = None
--- 19,51 ----
return
! player.log(LOG_MESSAGE, "Adds script '%s' to object 0x%x.\n" % (script, object.serial))
! object.addscript(script)
object.resendtooltip()
! player.socket.sysmessage('You add the script to your target.')
"""
! \command addscript
\description Attach a script to an object.
! \usage - <code>addscript [script]</code>
Script is the id of the script you want to attach.
"""
! def commandAddscript(socket, command, arguments):
if len(arguments) == 0:
! socket.sysmessage('Usage: addscript <identifier>')
return
! script = arguments.strip()
try:
! wolfpack.hasscript(script, EVENT_USE)
except:
! socket.sysmessage('No such script: %s.' % script)
return
! socket.sysmessage("Please select the object you want to add the script '%s' to." % script)
! socket.attachtarget('commands.events.addscript_response', [script])
! def removescript_response(player, arguments, target):
! script = arguments[0]
object = None
***************
*** 62,96 ****
return
! if object.hasevent(event):
! player.log(LOG_MESSAGE, "Removes event '%s' from object 0x%x.\n" % (event, object.serial))
! object.removeevent(event)
object.resendtooltip()
! player.socket.sysmessage('You remove the event from your target.')
else:
! player.socket.sysmessage('Your target does not have the given event.')
"""
! \command removeevent
\description Remove a script from an object.
! \usage - <code>removeevent [script]</code>
Script is the id of the script you want to remove.
"""
! def commandRemoveevent(socket, command, arguments):
if len(arguments) == 0:
! socket.sysmessage('Usage: removeevent <identifier>')
return
! event = arguments.strip()
try:
! wolfpack.hasevent(event, EVENT_USE)
except:
! socket.sysmessage('No such event: %s.' % event)
return
! socket.sysmessage("Please select the object you want to remove the event '%s' from." % event)
! socket.attachtarget('commands.events.removeevent_response', [event])
def onLoad():
! wolfpack.registercommand('addevent', commandAddevent)
! wolfpack.registercommand('removeevent', commandRemoveevent)
--- 62,96 ----
return
! if object.hasscript(script):
! player.log(LOG_MESSAGE, "Removes script '%s' from object 0x%x.\n" % (script, object.serial))
! object.removescript(script)
object.resendtooltip()
! player.socket.sysmessage('You remove the script from your target.')
else:
! player.socket.sysmessage('Your target does not have the given script.')
"""
! \command removescript
\description Remove a script from an object.
! \usage - <code>removescript [script]</code>
Script is the id of the script you want to remove.
"""
! def commandRemovescript(socket, command, arguments):
if len(arguments) == 0:
! socket.sysmessage('Usage: removescript <identifier>')
return
! script = arguments.strip()
try:
! wolfpack.hasscript(script, EVENT_USE)
except:
! socket.sysmessage('No such script: %s.' % script)
return
! socket.sysmessage("Please select the object you want to remove the script '%s' from." % script)
! socket.attachtarget('commands.events.removescript_response', [script])
def onLoad():
! wolfpack.registercommand('addscript', commandAddscript)
! wolfpack.registercommand('removescript', commandRemovescript)
|