Note: This forum is merely an archive. It is no longer possible to register or post. - StackOverflow
New Ace of Spades Forums: http://buildandshoot.com/

Seizure Script

Finished a script? Pop it in here.

Seizure Script

Postby ReubenMcHawk » Wed Dec 28, 2011 1:16 am

A while back, I made a "seizure script" in response to complaints regarding the disco script hurting people's eyes. Figured I'd post it here. Credits to mat^2 for making the original disco script, which I cannibalized for this one.

Code: Select all
from twisted.internet.task import LoopingCall
import random

import commands

@commands.name('seizure')
@commands.admin
def toggle_seizure(connection):
    protocol = connection.protocol
    protocol.seizure = not protocol.seizure
    if protocol.seizure:
        protocol.seizure_loop.start(0.05)
        protocol.send_chat('ENJOY YOUR SEIZURE')
    else:
        protocol.seizure_loop.stop()
        protocol.send_chat('SEIZURE DONE')

commands.add(toggle_seizure)

SEIZURE_COLORS = set([
    (255, 0, 0),
    (0, 0, 255),
    (255, 255, 0),
    (255, 28, 174),
    (0, 255, 0),
    (255, 127, 0)
])

def apply_script(protocol, connection, config):
    class SeizureProtocol(protocol):
        current_colors = None
        seizure = False
        def __init__(self, *arg, **kw):
            protocol.__init__(self, *arg, **kw)
            self.seizure_loop = LoopingCall(self.update_color)
       
        def update_color(self):
            if not self.current_colors:
                self.current_colors = SEIZURE_COLORS.copy()
            color = self.current_colors.pop()
            self.set_fog_color(color)
    return SeizureProtocol, connection


And for the lazy, just download this.
http://www.mediafire.com/?ak5t3e1d833a399
Image
Hi I'm Reuben, I make YouTube videos sometime.
I also make music.
I lead {RoT} the best clan ever. PM me for IRC info to come chill with kool kidz.
fite me noob
User avatar
ReubenMcHawk
Member
 
Posts: 541
Joined: Sat Dec 10, 2011 8:15 pm
Location: Ethiopia

Re: Seizure Script

Postby PresidentEden » Thu Jan 12, 2012 5:44 am

Excellent, excellent.. just wonderful.
User avatar
PresidentEden
Member
 
Posts: 41
Joined: Thu Jan 12, 2012 12:15 am
Location: Raven Rock base, D.C.


Return to Script releases



Who is online

Users browsing this forum: No registered users and 1 guest

cron