Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19562/commands
Modified Files:
__init__.py
Log Message:
spellbook updates
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/__init__.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** __init__.py 16 Sep 2004 16:42:28 -0000 1.19
--- __init__.py 17 Sep 2004 18:06:52 -0000 1.20
***************
*** 119,122 ****
--- 119,155 ----
"""
+ \command goname
+ \usage - <code>goname name</code>
+ \description Go to the first character found with the given name.
+ """
+ def goname(socket, command, arguments):
+ if len(arguments) == 0:
+ socket.sysmessage('Usage: goname <name>')
+ return
+
+ chars = wolfpack.chariterator()
+
+ char = chars.first
+ found = None
+ name = hash(arguments.lower())
+
+ while char:
+ if hash(char.name.lower()) == name:
+ found = char
+ break
+
+ char = chars.next
+
+ if not found:
+ socket.sysmessage('A character with the given name was not found.')
+ else:
+ socket.sysmessage("Going to character '%s' [Serial: 0x%x]." % (found.name, found.serial))
+ pos = found.pos
+ socket.player.removefromview()
+ socket.player.moveto(pos)
+ socket.player.update()
+ socket.resendworld()
+
+ """
\command gouid
\usage - <code>gouid serial</code>
***************
*** 134,137 ****
--- 167,171 ----
if item:
container = item.getoutmostitem()
+
if container.container:
container = container.container
***************
*** 144,147 ****
--- 178,185 ----
socket.player.update()
socket.resendworld()
+
+ if item.container.isitem():
+ socket.sendobject(item.container)
+ socket.sendcontainer(item.container)
else:
socket.sysmessage('No item with the serial 0x%x could be found.' % uid)
***************
*** 215,218 ****
--- 253,257 ----
wolfpack.registercommand("followers", followers)
wolfpack.registercommand("gouid", gouid)
+ wolfpack.registercommand("goname", goname)
wolfpack.registercommand("newlos", newlos)
|