Server Help

ASSS Questions - wont work

Anonymous - 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)
CypherJF - Wed Jan 12, 2005 12:16 am
Post subject:
chambahs?
Anonymous - Wed Jan 12, 2005 12:22 am
Post subject:
LOL oops, yea, sorry thats me
CypherJF - 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.
Bak - Wed Jan 12, 2005 3:04 am
Post subject:
add it to the individual conf files... not groupdef.dir
Grelminar - 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:
Code: Show/Hide
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.
Anonymous - 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...
Smong - 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).
Anonymous - 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?
Smong - 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).
Anonymous - 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
Anonymous - 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).
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group