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
help?

 
Post new topic   Reply to topic Printable version
 View previous topic  another biller question Post :: Post New Region/Map Stuff  View next topic  
Author Message
Chambahs
Guest


Offline

PostPosted: Tue Dec 28, 2004 12:57 am    Post subject: help? Reply to topic Reply with quote

i got a source from catid, .dll for mervbot, was wondering if someone would like to convert it to an ASSS module for me? icon_smile.gif
Back to top
Dr Brain
Flip-flopping like a wind surfer


Age:39
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Tue Dec 28, 2004 10:27 am    Post subject: Reply to topic Reply with quote

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


Offline

PostPosted: Tue Dec 28, 2004 11:12 am    Post subject: Reply to topic Reply with quote

current programming slave = SMong lol but hes lazy icon_razz.gif 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 icon_smile.gif
Back to top
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Tue Dec 28, 2004 1:59 pm    Post subject: Reply to topic Reply with quote

I think this is fairly simple:
Code: Show/Hide
# 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
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
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: 17 page(s) served in previous 5 minutes.

phpBB Created this page in 0.441174 seconds : 28 queries executed (95.0%): GZIP compression disabled