 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Help? Guest
Offline
|
Posted: Wed Jan 12, 2005 12:07 am Post subject: wont work |
 |
|
|
|
?pwnt and ?moo wont work, any suggestions? also, i did add cmd_moo and cmd_pwnt at the bottom of the groupdef.dir, this was taken from SMong and edited..
from asss import *
chat = get_interface(I_CHAT)
def paction(p, action, arena):
if action == PA_ENTERARENA:
chat.SendMessage(p, p.name+" has entered, please, all say hello.")
elif action == PA_CONNECT:
chat.SendArenaMessage(arena, p.name+" will enter")
cb1 = reg_callback(CB_PLAYERACTION, paction)
def c_moo(cmd, params, p, targ):
# help text (?help moo). may have to move this comment somewhere else if it won't run.
"""\
Module: <py> demo
Targets: none
a sample command.
"""
chat.SendMessage(p, "moo")
cmd1 = add_command("moo", c_moo)
def c_pwnt(cmd, params, p, targ):
"""\
Module: Chambahs' Demo
Targets: none
a Pwnage command
"""
chat.SendMessage(p, "You got pwnt")
cmd1 = add_command("You got pwnt", c_pwnt) |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Wed Jan 12, 2005 12:16 am Post subject: |
 |
|
|
|
chambahs? _________________ Performance is often the art of cheating carefully. - James Gosling
Last edited by CypherJF on Wed Jan 12, 2005 8:05 pm, edited 1 time in total |
|
Back to top |
|
 |
Chambahs Guest
Offline
|
Posted: Wed Jan 12, 2005 12:22 am Post subject: |
 |
|
|
|
LOL oops, yea, sorry thats me |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Wed Jan 12, 2005 12:38 am Post subject: |
 |
|
|
|
I forget what I had to do to get it to work on my copy of asss :/ sorry. |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Wed Jan 12, 2005 3:04 am Post subject: |
 |
|
|
|
add it to the individual conf files... not groupdef.dir |
|
Back to top |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Wed Jan 12, 2005 3:09 am Post subject: |
 |
|
|
|
I'm not sure what you mean by "added them to the bottom of groupdef.dir". It's a directory, so it has no bottom. Try adding them to "default", if you want them to work for all players.
Now, this line is causing all your problems:
add_command("You got pwnt", c_pwnt) |
First, "You got pwnt" isn't a valid command name. It has to be all lowercase and not contain spaces (there's nothing enforcing that, but command names with spaces just won't work). Second, add_command returns a command ticket that you have to hold on to, or else the command will be unregistered. You're assigning the second ticket to the same variable as the first one, so the first one is getting deleted, and the first command is getting unregistered. |
|
Back to top |
|
 |
Chambahs Guest
Offline
|
Posted: Wed Jan 12, 2005 2:52 pm Post subject: |
 |
|
|
|
sorry lol thats what i meant, the bottom of the default in the groupdef.dir, and grel, i just copied exactly what SMong wrote in his demo, its just i changed the words to "You got ownt" insaid of "moo", so if it worked for smong, i dont get why it wont work for me... |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Jan 12, 2005 3:22 pm Post subject: |
 |
|
|
|
What's with the uppercase M?
Here's a stronger hint: Quote: | cmd1 = add_command("You got pwnt", c_pwnt) |
You can use [ code ] tags in your post so the code is all aligned neatly (which is quite important when it comes to Python). |
|
Back to top |
|
 |
Chambahs Guest
Offline
|
Posted: Wed Jan 12, 2005 4:50 pm Post subject: |
 |
|
|
|
k, fixed everything else, everytime i accomplish a command, i try another...
def c_say(cmd, params, p, targ):
chat.SendArenaMessage(p.arena, param+ " Got Pwnt By " +p.name )
if param+ == Chambahs:
chat.SendArenaMessage(p.arena, p.name+ "Does not Pwnt Chambahs, Chambahs pwns " +p.name)
cmd3 = add_command("saypwnt", c_say)
if, if param+ == Chambahs:
gives me an error of the ==, then what can i replace it with? |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Wed Jan 12, 2005 5:07 pm Post subject: |
 |
|
|
|
'param' or 'params', which ever magically works for you.
The + is used to join/merge/concatenate two strings (and probably some other data types in python as well). |
|
Back to top |
|
 |
Chambahs Guest
Offline
|
Posted: Wed Jan 12, 2005 5:17 pm Post subject: |
 |
|
|
|
now it says, 'param' is not defined...
also, why did you sign off of MSN, its more easier to talk to you lol |
|
Back to top |
|
 |
-Smong- Guest
Offline
|
Posted: Wed Jan 12, 2005 7:14 pm Post subject: |
 |
|
|
|
I resolved this over chat, I hope.
Chambahs in quotes like this "Chambahs".
param should actually be params (although Chambahs insisted it works ok as param+ in SendArenaMessage). |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 31 page(s) served in previous 5 minutes.
|