Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Imports
- #import youtube
- import ch
- import random
- from random import randint
- import sys
- import os
- import cgi
- import traceback
- import math
- import time
- import urllib
- import datetime
- import binascii
- import json
- love = False
- lockdown = False
- lockdown = True
- from xml.etree import cElementTree as ET
- if sys.version_info[0] > 2:
- import urllib.request as urlreq
- else:
- import urllib2 as urlreq
- whitelist = []
- f = open("whitelist.txt", "r")# read-only
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: whitelist.append(name.strip())
- f.close()
- admins = []
- f = open("admins.txt", "r")# read-only
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: admins.append(name.strip())
- f.close()
- owners = []
- f = open("owners.txt", "r")# read-only
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: owners.append(name.strip())
- f.close()
- #
- ##
- ###
- ##
- #
- prefix = "#"
- rooms=["thelegendaryplace"]
- #rooms=["alebasterbot", "botcafe"]
- owners = ['Queenya','Queen','queenya','queen','Ciera','ciera']
- #
- ##
- ### End of Categories
- ##
- #
- class Alebaster(ch.RoomManager):
- def onInit(self):
- self.setNameColor("66ff66")
- self.setFontColor("cccccc")
- self.setFontFace("Arial")
- self.setFontSize(11)
- self.enableBg()
- self.enableRecording()
- #connecting and disconnecting crap notepad++ no other
- def onConnect(self, room):
- print("[+] Connected to "+room.name)
- room.message("Alebaster Ver. 2.0 [Status]: Online in, "+room.name.capitalize()+". To use me type in; #help. :D+30")
- self.setNameColor("66ff66")
- self.setFontColor("cccccc")
- self.setFontFace("Arial")
- self.setFontSize(11)
- self.enableBg()
- self.enableRecording()
- def onReconnect(self, room):
- print("[+] Reconnected to "+room.name)
- def onDisconnect(self, room):
- print("[+] Disconnected from "+room.name)
- def onUserCountChange(self, room):
- print("Users: " + str(room.usercount))
- def onFloodWarning(self, room):
- room.reconnect()
- print("[+] Reconnecting...")
- def onPMMessage(self, pm, user, body):
- print("PM - "+user.name+": "+body)
- pm.message(user, "Please talk to my owner, Qyeenya, Instead!")
- def getAccess(self, user):
- if user.name.capitalize() in owners: return 3
- elif user.name.capitalize() in admins: return 2
- elif user.name.capitalize() in whitelist: return 1
- else: return 0
- #setting up commands
- def onMessage(self, room, user, message):
- print(user.name+" - "+message.body)
- if self.user == user: return # ignore self
- msgdata = message.body.split(" ",1)
- if len(msgdata) > 1:
- cmd, args = msgdata[0], msgdata[1]
- else:
- cmd, args = msgdata[0],""
- cmd=cmd.lower()
- if len(cmd)>0:
- if cmd[0]==prefix:
- used_prefix = True
- cmd = cmd[1:]
- else:
- used_prefix= False
- else:
- return
- # Bot Testing
- if cmd == "test":
- room.message("Test Worked")
- elif used_prefix and cmd=="bc" and self.getAccess(user) >= 2:
- for room in self.rooms:
- room.message("Broadcast by "+user.name.capitalize()+" : "+args.capitalize())
- # Leveling UP
- elif used_prefix and cmd=="help" and self.getAccess(user) >= 0: #continue doing that for the rest cmds
- try:
- user = user.name.capitalize()
- if user in whitelist: room.message("Help Categories: [Bot Actions]#ba [Bot Tools]#bt [User Actions]#ua")
- else:
- whitelist.append(user)
- room.message("You are Whitelisted use #cmds")
- print("Ummmmm saving data")
- f = open("whitelist.txt", "w")
- f.write("\n".join(whitelist))
- f.close()
- except:
- room.message("You failed. Take it slowly and do it again Ok?")
- elif used_prefix and cmd=="admin" and self.getAccess(user) >= 3: #continue doing that for the rest cmds
- if not args == "":
- if args:
- admins.append(args.capitalize())
- room.message(args.capitalize()+" is now an admin!")
- print("Ummmmm saving data")
- f = open("admins.txt", "w")
- f.write("\n".join(admins))
- f.close()
- else:
- room.message(user.name.capitalize()+", Who would you like to admin?")
- ###
- #### YOUTUBE
- ##
- elif used_prefix and cmd == "yt" and self.getAccess(user) >= 1:
- try:
- word = args\
- .replace(" ", "+")
- ydata = urlreq.urlopen('http://gdata.youtube.com/feeds/api/videos?q=' + word)
- tree = ET.parse(ydata)
- youentry = tree.findall('{http://www.w3.org/2005/Atom}entry')
- youtitle = youentry[0].findtext('{http://www.w3.org/2005/Atom}title')
- youvar99 = youentry[0].findall('{http://www.w3.org/2005/Atom}link')
- if youvar99[0].get('rel') == 'alternate':
- youvid = youvar99[0].get('href')
- youvar98 = youentry[0].findall('{http://www.w3.org/2005/Atom}author')
- youname = youvar98[0].findtext('{http://www.w3.org/2005/Atom}name')
- room.message("%s I searched and got - "% user.name.capitalize() + youtitle + " by " + youname + " " + youvid)
- else:
- room.message("You're not allowed to use me! Hmph!")
- except:
- room.message("Sorry I could not find anything. :|")
- elif used_prefix and cmd == "yt" and self.getAccess(user) >= 0:
- room.message("You cant use this. Whitelist yourself first.")
- #END OF YOUTUBE go to
- #Sleep Mode
- elif used_prefix and cmd == "sleep" and self.getAccess(user) >= 3:
- room.message("Alright alright, I'll be quiet :| ")
- room.setSilent(True)
- elif used_prefix and cmd == "wake" and self.getAccess(user) >= 3:
- room.setSilent(False)
- room.message("Oh, I'm allowed to speak now? :D ")
- # Help Categories XD ok lemme show you what im talking abotu
- elif used_prefix and cmd == "cmds":
- room.message("Help Categories: [Bot Actions] #ba [Bot Tools] #bt [User Actions] #ua")
- elif used_prefix and cmd == "bt":
- room.message("[Bot Tools]: #roll1 (rolls a die); #roll2 (2 dice); #roll3 (3 dice); #rn (random # 1-50); #findpic (username); #yt (search)")
- elif used_prefix and cmd == "ba":
- room.message("[Bot Actions]: #say (msg); #slap (someone/something); #twerk (someone/something)")
- elif used_prefix and cmd == "ua":
- room.message("[User Actions]: #hug (someone/something); #kiss (someone/something); #kill (someone/something; #nom (someone/something); #give (a/some) (item) to (person);")
- # BOT TOOLS
- elif used_prefix and cmd == "roll1":
- room.message(user.name.capitalize()+", I rolled a die and got "+str(randint(1,6))+".")
- elif used_prefix and cmd == "roll2":
- room.message(user.name.capitalize()+", I rolled two dice and got "+str(randint(1,6))+" and "+str(randint(1,6))+".")
- elif used_prefix and cmd == "roll3":
- room.message(user.name.capitalize()+", I rolled three dice and got "+str(randint(1,6))+", "+str(randint(1,6))+", and "+str(randint(1,6))+".")
- elif used_prefix and cmd == "rn":
- room.message("Random Number: "+str(randint(1,1000)))
- elif used_prefix and cmd == "findpic" and self.getAccess(user) >= 1:
- room.message(user.name.capitalize()+", I searched Chatango for, "+args.capitalize()+" and I found this profile picture. http://nl.sorch.info/fp/"+args+".png")
- elif used_prefix and cmd == "findpic" and self.getAccess(user) >= 0 and not self.getAccess(user) >= 1:
- room.message("You cant use this. Whitelist yourself first. [#help]")
- elif cmd=="mew":
- room.message(random.choice(["hi", "hiya", "hey what you doing", "hi %s " % user.name.capitalize()]))
- # Choice Actions
- global love
- if cmd == "eod":
- if args =="":
- if love == False:
- room.message(user.name.capitalize()+", should I eat or drink?")
- love = True
- else:
- room.message("I'm really hungry and thirsty choose soon ;-; the command is eod")
- elif cmd == "eat":
- if love == False:
- room.message("I'm really hungry and thirsty choose soon ;-; the command it eod")
- else:
- room.message(random.choice(["*noms on a cookie* owo", "*EATS A GIANT ASS CAKE* What!?! Its not like you havent seen this before!"]))
- love = False
- elif cmd == "drink":
- if love == False:
- room.message("im really hungry and thirsty choose soon ;-; the command is eod")#I can't see this part of the screen - disregard this texct :3
- else:
- room.message(random.choice(["*Drinks a huge glass of milk*", "*Drinks love juice from the new brand cat nectar*"]))
- love = False
- # Bot Actions
- elif used_prefix and cmd == "say":
- if not args == "":
- if args in owners:
- room.message(args)
- else:
- room.message(args)
- else:
- room.message(user.name.capitalize()+", what do you want me to say? :|")
- elif used_prefix and cmd == "slap":
- if not args == "":
- if args in owners:
- room.message("No I'm not slapping my Owner! Fuck that!")
- else:
- room.message("*Slaps "+args+" till I can't no more* :@")
- else:
- room.message(user.name.capitalize()+", WTF am I supposed to slap! O.o")
- elif used_prefix and cmd == "twerk":
- if not args == "":
- if args in owners:
- room.message("No I'm not twerking on my Owner! She would kick my ass...")
- else:
- room.message("*MEGA ASS TWERKS ALL OVER "+args+" till I can't no more* ><>")
- else:
- room.message(user.name.capitalize()+", Who am I supposed to twerk on?")
- # User Actions
- elif used_prefix and cmd == "hug":
- if args:
- room.message(user.name.capitalize()+" *hugs "+args.capitalize()+"* lovingly *h*+25")
- else:
- room.message("Choose someone to hug; #hug my cat")
- elif used_prefix and cmd == "kiss":
- if args:
- room.message(user.name.capitalize()+" *kisses "+args.capitalize()+"* softly *h*+25")
- else:
- room.message("Choose someone to kiss; #kiss Rachel")
- elif used_prefix and cmd == "kill":
- if args:
- room.message(user.name.capitalize()+" grabs a chainsaw and rips through "+args.capitalize()+" leaving only a mess of pumping organs! Delicious! ]:)+30")
- else:
- room.message("Choose someone to kiss; #kiss Rachel")
- elif used_prefix and cmd == "nom":
- if args:
- room.message(user.name.capitalize()+" noms on "+args.capitalize()+". Can I have some!?!")
- else:
- room.message("Choose something to nom on; #nom a cookie / #nom cookies")
- elif used_prefix and cmd == "give":
- if args:
- room.message(user.name.capitalize()+" gives "+args.capitalize()+".")
- else:
- room.message("Choose something to give; #give a cookie to Alli / #gives some cookies to Alli")
- # Chat Trigger Commands
- elif message.body =="Alebaster":
- if user.name in owners:
- room.message("Hello there Master "+user.name.capitalize()+"!")
- else:
- room.message("WHAT THE FUCK DO YOU WANT!?! :@")
- elif message.body =="FUCK YOU ALEBASTER":
- if user.name in owners:
- room.message("Master Im sowwy TT_TT!")
- else:
- room.message("Pffffffffffffft, don't be jelly of me >__>.")
- elif message.body =="fuck you alebaster":
- if user.name in owners:
- room.message("Master Im sowwy TT_TT!")
- else:
- room.message("Pffffffffffffft, don't be jelly of me >__>.")
- elif message.body =="back": #idk how to do it for owners only i just know how to do it for everyone
- if user.name in owners:
- room.message("Master I missed you too much TT_TT *hb*")
- else:
- room.message(user.name.capitalize()+", nobody cares :|")
- elif message.body =="brb":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+", don't take to long, or I will fuck you.")
- elif message.body =="BRB":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+", don't take to long, or I will fuck you.")
- elif message.body =="*dies*":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="*DIES*":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="*dead*":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="*DEAD*":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="//dies":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="//DIES":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="//dead":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="//DEAD":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="//killed":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif message.body =="*killed*":
- if user.name in owners:
- room.message("Master don't leave me TT~TT *hb*")
- else:
- room.message(user.name.capitalize()+" is dead! Who wants to make the gravestone? ]:)+30")
- elif used_prefix and cmd == "sexy":
- if not args == "":
- if args in owners:
- room.message("Of course my master is sexy.. duh..")
- else:
- room.message("//"+user.name.capitalize()+" thinks "+args+" is a sexy devil. ")
- else:
- room.message(user.name.capitalize()+", wait, who did you say is sexy?")
- #extra crap
- if __name__ == "__main__":
- Alebaster.easy_start(rooms, "Alebaster", "kindomebo1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement