Server Help

ASSS Custom Projects - Python Spree

Anonymous - Thu Oct 28, 2010 2:29 am
Post subject: Python Spree
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

Anonymous - Thu Oct 28, 2010 2:37 am
Post subject:
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.
Anonymous - Thu Oct 28, 2010 2:38 am
Post subject:
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.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group