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
Python Spree

 
Post new topic   Reply to topic Printable version
 View previous topic  Python Scoreboard Post :: Post UT Project  View next topic  
Author Message
Guest



Offline

PostPosted: Thu Oct 28, 2010 2:29 am    Post subject: Python Spree Reply to topic Reply with quote

I got this to load and attach, but it doesn't seem to do anything..

What am I doing wrong?


Code: Show/Hide
#spree by resoL
#10-10

#include spree.conf

from asss import *


stats = get_interface(I_STATS)
chat = get_interface(I_CHAT)


#start callback to reset kills on ship and/or freq change
def shipchange(p, newship, oldship,  newfreq,  oldfreq):
   chat.SendMessage(p, "%s changed to ship %s and freq %s. Spree reset" % (p.name, newship, newfreq))
   if newship != SHIP_SPEC:
   #code to reset spree count..
      p.spree_kills = p.spree_kills = 0


#start callback to check wins
def kill(arena, killer, killed, bty, flagcount, pts, green):
   if killed.freq != killer.freq:
      try:
         killer.spree_kills = killer.spree_kills + 1
      except AttributeError:


#start callback to check losses
         if killer.freq != killed.freq:
            try:
               killed.spree_kills = killed.spree_kills + 1
            except AttributeError:


#start callback to send spree arena message
               if ((spree.kills % 3) == 0) and (spree.kills > 0):
                  #chat.SendArenaSoundMessage = config.GetStr(p.spree.cfg, "Spree" "%s (%s:0)" % (killer.name, killer.spree_kills))
                  chat.SendArenaMessage (p.arena, "%s is on a spree! %s:0" % (killer.name, killer.spree_kills))
                  return pts, green


def mm_attach(arena):
   arena.minigames_ref1 = reg_callback(CB_SHIPFREQCHANGE, shipchange, arena)
   arena.minigames_ref2 = reg_callback(CB_KILL, kill ,arena)



def mm_detach(arena):
   arena.minigames_ref1 = None
   arena.minigames_ref2 = None
Back to top
Guest



Offline

PostPosted: Thu Oct 28, 2010 2:37 am    Post subject: Reply to topic Reply with quote

lol, ya so I fixed the bottom section to
Code: Show/Hide

def mm_attach(arena):
   arena.spree_ref1 = reg_callback(CB_SHIPFREQCHANGE, shipchange, arena)
   arena.spree_ref2 = reg_callback(CB_KILL, kill ,arena)



def mm_detach(arena):
   arena.spree_ref1 = None
   arena.spree_ref2 = None





ImportError: dynamic module does not define init function (initspree)

Not sure what that means.
Back to top
Guest



Offline

PostPosted: Thu Oct 28, 2010 2:38 am    Post subject: Reply to topic Reply with quote

lol, ya so I fixed the bottom section to
Code: Show/Hide

def mm_attach(arena):
   arena.spree_ref1 = reg_callback(CB_SHIPFREQCHANGE, shipchange, arena)
   arena.spree_ref2 = reg_callback(CB_KILL, kill ,arena)



def mm_detach(arena):
   arena.spree_ref1 = None
   arena.spree_ref2 = None





ImportError: dynamic module does not define init function (initspree)

Not sure what that means.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects 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: 69 page(s) served in previous 5 minutes.

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