Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
wont work

 
Post new topic   Reply to topic Printable version
 View previous topic  1.3.5 Post :: Post Elvl  View next topic  
Author Message
Help?
Guest


Offline

PostPosted: Wed Jan 12, 2005 12:07 am    Post subject: wont work Reply to topic Reply with quote

?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:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Wed Jan 12, 2005 12:16 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
Chambahs
Guest


Offline

PostPosted: Wed Jan 12, 2005 12:22 am    Post subject: Reply to topic Reply with quote

LOL oops, yea, sorry thats me
Back to top
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Wed Jan 12, 2005 12:38 am    Post subject: Reply to topic Reply with quote

I forget what I had to do to get it to work on my copy of asss :/ sorry.
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:26
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Jan 12, 2005 3:04 am    Post subject: Reply to topic Reply with quote

add it to the individual conf files... not groupdef.dir
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Wed Jan 12, 2005 3:09 am    Post subject: Reply to topic Reply with quote

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.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Chambahs
Guest


Offline

PostPosted: Wed Jan 12, 2005 2:52 pm    Post subject: Reply to topic Reply with quote

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

PostPosted: Wed Jan 12, 2005 3:22 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Chambahs
Guest


Offline

PostPosted: Wed Jan 12, 2005 4:50 pm    Post subject: Reply to topic Reply with quote

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

PostPosted: Wed Jan 12, 2005 5:07 pm    Post subject: Reply to topic Reply with quote

'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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Chambahs
Guest


Offline

PostPosted: Wed Jan 12, 2005 5:17 pm    Post subject: Reply to topic Reply with quote

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

PostPosted: Wed Jan 12, 2005 7:14 pm    Post subject: Reply to topic Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 29 page(s) served in previous 5 minutes.

phpBB Created this page in 0.482422 seconds : 37 queries executed (94.0%): GZIP compression disabled