More Python tests.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@5819 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
2386618e1b
commit
5b90804e69
16
test/python
16
test/python
|
|
@ -41,6 +41,14 @@ arch cobblestones2
|
||||||
x 1
|
x 1
|
||||||
y 4
|
y 4
|
||||||
end
|
end
|
||||||
|
arch exit
|
||||||
|
x 1
|
||||||
|
y 4
|
||||||
|
arch event_apply
|
||||||
|
title Python
|
||||||
|
slaying /test/python_exit.py
|
||||||
|
end
|
||||||
|
end
|
||||||
arch cobblestones2
|
arch cobblestones2
|
||||||
x 2
|
x 2
|
||||||
end
|
end
|
||||||
|
|
@ -72,6 +80,14 @@ arch cobblestones2
|
||||||
x 2
|
x 2
|
||||||
y 4
|
y 4
|
||||||
end
|
end
|
||||||
|
arch oakdoor
|
||||||
|
x 2
|
||||||
|
y 4
|
||||||
|
arch event_apply
|
||||||
|
title Python
|
||||||
|
slaying /test/python_exit.py
|
||||||
|
end
|
||||||
|
end
|
||||||
arch cobblestones2
|
arch cobblestones2
|
||||||
x 3
|
x 3
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ def do_help():
|
||||||
whoami.Say(' - readkey')
|
whoami.Say(' - readkey')
|
||||||
whoami.Say(' - writekey')
|
whoami.Say(' - writekey')
|
||||||
whoami.Say(' - speed')
|
whoami.Say(' - speed')
|
||||||
|
whoami.Say(' - owner')
|
||||||
|
whoami.Say(' - friendlylist')
|
||||||
|
whoami.Say(' - create')
|
||||||
|
|
||||||
def do_arch():
|
def do_arch():
|
||||||
archs = Crossfire.GetArchetypes()
|
archs = Crossfire.GetArchetypes()
|
||||||
|
|
@ -233,6 +236,28 @@ def do_speed():
|
||||||
who.SpeedLeft = -50
|
who.SpeedLeft = -50
|
||||||
whoami.Say('Changed your speed, now %f and %f'%(who.Speed, who.SpeedLeft))
|
whoami.Say('Changed your speed, now %f and %f'%(who.Speed, who.SpeedLeft))
|
||||||
|
|
||||||
|
def do_owner():
|
||||||
|
whoami.Say('Not implemented.');
|
||||||
|
|
||||||
|
def do_friendlylist():
|
||||||
|
friends = Crossfire.GetFriendlyList()
|
||||||
|
for ob in friends:
|
||||||
|
if (ob.Owner):
|
||||||
|
n = ob.Owner.Name
|
||||||
|
else:
|
||||||
|
n = ''
|
||||||
|
whoami.Say(' - %s (%s)'%(ob.Name, n))
|
||||||
|
|
||||||
|
def do_create():
|
||||||
|
first = Crossfire.CreateObjectByName('gem')
|
||||||
|
if (first):
|
||||||
|
whoami.Say('created gem: %s'%first.Name)
|
||||||
|
first.Teleport(whoami.Map, 2, 2)
|
||||||
|
second = Crossfire.CreateObjectByName('diamond')
|
||||||
|
if (second):
|
||||||
|
whoami.Say('created diamond: %s'%second.Name)
|
||||||
|
second.Teleport(whoami.Map, 2, 2)
|
||||||
|
|
||||||
topic = Crossfire.WhatIsMessage().split()
|
topic = Crossfire.WhatIsMessage().split()
|
||||||
#whoami.Say('topic = %s'%topic)
|
#whoami.Say('topic = %s'%topic)
|
||||||
#whoami.Say('topic[0] = %s'%topic[0])
|
#whoami.Say('topic[0] = %s'%topic[0])
|
||||||
|
|
@ -278,5 +303,11 @@ elif topic[0] == 'writekey':
|
||||||
do_writekey()
|
do_writekey()
|
||||||
elif topic[0] == 'speed':
|
elif topic[0] == 'speed':
|
||||||
do_speed()
|
do_speed()
|
||||||
|
elif topic[0] == 'owner':
|
||||||
|
do_owner()
|
||||||
|
elif topic[0] == 'friendlylist':
|
||||||
|
do_friendlylist()
|
||||||
|
elif topic[0] == 'create':
|
||||||
|
do_create()
|
||||||
else:
|
else:
|
||||||
do_help()
|
do_help()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
import Crossfire
|
||||||
|
|
||||||
|
#Crossfire.SetReturnValue( 1 )
|
||||||
|
|
||||||
|
whoami = Crossfire.WhoAmI()
|
||||||
|
who = Crossfire.WhoIsActivator()
|
||||||
|
|
||||||
|
whoami.Say("exit applied by %s"%who.Name)
|
||||||
Loading…
Reference in New Issue