 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Chambahs Guest
Offline
|
Posted: Tue Dec 28, 2004 12:57 am Post subject: help? |
 |
|
|
|
i got a source from catid, .dll for mervbot, was wondering if someone would like to convert it to an ASSS module for me?  |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Dec 28, 2004 10:27 am Post subject: |
 |
|
|
|
Learn to program yourself. If you're going to use ASSS, you'll have to know how to program, or at least have a programming slave.
Oh, and you can use MERVBot in ASSS. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
Chambahs Guest
Offline
|
Posted: Tue Dec 28, 2004 11:12 am Post subject: |
 |
|
|
|
current programming slave = SMong lol but hes lazy and also, my topic got deleted by someone, but i asked if anyone has an example i can follow of a module in python? it would help me learn alot faster if i can see what all these commands do  |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Tue Dec 28, 2004 1:59 pm Post subject: |
 |
|
|
|
I think this is fairly simple: # demo asss python module
# dec 28 2004 smong
# nearly always use this
from asss import *
# get some interfaces
# see chat.h for where I_CHAT comes from, see other .h files for more (fx:
# game.h)
chat = get_interface(I_CHAT)
# a callback
# this function is called when a player enters/leaves, see core.h for PA_???
# constants
def paction(p, action, arena):
# start indenting
if action == PA_ENTERARENA:
# see chat.h for the names of more functions like SendMessage
chat.SendMessage(p, "hello")
# i'm not sure which one of these is correct, you will have to
# experiment. edit: ok i tested this, #2 works.
# see player.h for more p.??? fields
#chat.SendMessage(p, "1) hello %s", p.name)
chat.SendMessage(p, "2) hello %s" % p.name)
#chat.SendMessage(p, "3) hello ", p.name)
#chat.SendMessage(p, ( "4) hello ", p.name ))
# tell asss to call 'paction' when CB_PLAYERACTION is signalled
# see .h files for CB_??? names
cb1 = reg_callback(CB_PLAYERACTION, paction)
# a command
# see cmdman.h for what each parameter does
def c_moo(cmd, params, p, targ):
# help text (?help moo)
"""\
Module: <py> demo
Targets: none
a sample command.
"""
chat.SendMessage(p, "moo")
# tell asss to call 'c_moo' when a player types ?moo
# note: add cmd_moo to conf/groupdef.dir/default so players have permission to
# use this command.
cmd1 = add_command("moo", c_moo)
# now make you own module
# i recommend writing on paper what you would do if you were hosting the event
# manually, then look at the .h files to find the callbacks you need (like
# shipchange, kill, etc) look at the asss console for execution errors, and if
# that doesn't help, add some chat.SendArenaMessage("i'm at line ...") type
# messages to locate the buggy piece of code.
|
Save this in bin/demo.py. Then ingame make sure pymod is loaded by using ?lsmod and ?insmod. Then add this module with the following command: ?insmod <py> demo. Re-entering the arena and typing ?moo should do some stuff. |
|
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: 17 page(s) served in previous 5 minutes.
|