 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Guest
Offline
|
Posted: 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?
#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
|
|
Back to top |
|
 |
Guest
Offline
|
|
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: 30 page(s) served in previous 5 minutes.
|