Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # If you have any doubts with bot making ,pm me on Aluf
- # impots and defs are only published
- # I am done with my old commands and also bot making ,pm me
- # I no longer use the account BQ, i lost its password,if somehow anyone uses it ,its not me
- # Account BQ was jacked,i believe the jacker did that for fun since I have never seen the account BQ active after that
- # Take Care :)+50
- ########################################################################
- ########################################################################
- #### Posts © Aluf ####
- #### http://Aluf.chatango.com ####
- #### ####
- _____ .__ _____ ####
- / _ \ | | __ ___/ ____\ ####
- / /_\ \| | | | \ __\ ####
- / | \ |_| | /| | ####
- \____|__ /____/____/ |__| © Aluf-[www.pastebing.tk] ####
- \/ ####
- #### Message me anytime for any doubts .CC's i post might not ####
- #### be working everytime,so message me for fresh cc's . ####
- #### Website : www.pastebing.tk ####
- #### If you need suggestion for the pastebin bots of chatango ####
- #### message me,lol i have run all the bots here myself,so ####
- #### i guess ,i know which is the worst and best . ####
- #### Do not ask for my bot code on pm ,i quit years back . ####
- #### If you have doubts regarding other codes on my pastebin ####
- #### Still message me on Aluf or tyt or 93. [93 FOR COMPLAINS] ####
- #### I Have been getting a lot of messages lately for cc's ####
- #### and the worst part is many want to know to hack cc ####
- #### I cannot help you with that ,you have to find a way yourself ####
- #### but ofc you can always ask for cc's but don't ask me how to ####
- ____ _ _ _____ ####
- / _ \/ \ / \ /\/ / ####
- | / \|| | | | ||| __\ ####
- | |-||| |_/\| \_/|| | ####
- \_/ \|\____/\____/\_/ © PMR [ Add me before messaging ] ####
- ########################################################################
- import ch
- import subprocess
- import random
- import sys
- import os
- import re
- import cgi
- import traceback
- import threading
- import socket
- import time
- import urllib
- import helperCmd
- import datetime
- import binascii
- import youtube
- import json
- import winsound
- import __future__
- import math
- from xml.etree import cElementTree as ET
- lockdown = False
- startTime = time.time()
- filename = "status.txt"
- file = open(filename, 'w')
- print("[INF]Setting status to online...")
- time.sleep(2)
- file.write("Online")
- file.close()
- if sys.version_info[0] > 2:
- import urllib.request as urlreq
- else:
- import urllib2 as urlreq
- owners = ['Aluf']
- prefix = "!"
- ## DEFINITIONS
- dictionary = dict() #dictionary
- f=open("definitions.txt", "r") # read-only
- print("[INFO]LOADING DEFINITIONS...")
- time.sleep(1)
- for line in f.readlines():#for line in f
- try:
- if len(line.strip())>0:
- word, definition, name = json.loads(line.strip()) #load line
- dictionary[word] = json.dumps([definition, name])#dump into dectionary[]
- except:
- print("[ERROR]Can't load definition: %s" % line)
- f.close()
- ## NICKNAMES
- nicks=dict()#empty list
- f=open ("Nicks.txt","r")#r=read w=right
- print ("[INFO] Loading Nicks....")#print
- time.sleep(1)#sleep for one second
- for line in f.readlines():#loop through eachline and read each line
- try:#try code
- if len(line.strip())>0:#strip the whitespace checkgreater than 0
- user , nick = json.loads(line.strip())
- nicks[user] = json.dumps(nick)
- except:
- print("[error] Can't load nick %s" % line)
- f.close()
- #ROOMS#
- rooms = []
- f = open("rooms.txt", "r") # read-only
- print("[INFO]LOADING ROOMS...")
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: rooms.append(name.strip())
- f.close()
- #END#
- ##WHITELIST
- whitelist = []
- f = open("whitelist.txt", "r") # read-only
- print("[INFO]LOADING WHITELIST-LVL-1...")
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: whitelist.append(name.strip())
- f.close()
- #END #
- ##MASTERS
- permitted = []
- f = open("permitted.txt", "r") # read-only
- print("[INFO]LOADING MASTERS-LVL-3...")
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: permitted.append(name.strip())
- f.close()
- # END #
- ##HALF MASTERS
- hpermitted = []
- f = open("hpermitted.txt", "r") # read-only
- print("[INFO]LOADING HALFMASTERS-LVL-2....")
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: hpermitted.append(name.strip())
- f.close()
- #END #
- ## OWNER LVL 4
- spermitted = []
- f = open("spermitted.txt", "r") # read-only
- print("[INFO]LOADING OWNER-LVL-4...")
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: spermitted.append(name.strip())
- f.close()
- # END #
- # SN Notifs
- notif = []
- f = open("notif.txt", "r")
- print("[INF]Loading Notifs...")
- for name in f.readlines():
- if len(name.strip())>0: notif.append(name.strip())
- f.close
- ## Last Seen History
- filename = "roomhist.txt"#the text file you need to have in same place as bot
- hist = dict()
- f = open(filename, 'r') #open status.txt and make a writing variable called file
- print("[INF]LOADING ROOMHIST")#print to console
- time.sleep(1)#pause for one second
- for line in f.readlines():
- if len(line.strip())>0:
- nama, waktu, ruang, body = json.loads(line.strip())
- hist[nama] = json.dumps([waktu, ruang, body])
- f.close()#close the file
- ## Send Notes
- sasaran = dict()
- f = open ("notes.txt", "r") #read-only
- print("[INF] Loading Notes")
- time.sleep(1)
- for line in f.readlines():
- try:
- if len(line.strip())>0:
- to, body, sender = json.loads(line.strip())
- sasaran[to] = json.dumps([body, sender])
- except:
- print("[Error] Notes load fails : %s" % line)
- f.close()
- #Blacklist# lvl -1
- blacklist = []
- f = open("blacklist.txt", "r") # read-only
- print("[INF]Loading level -1...")
- time.sleep(1)
- for name in f.readlines():
- if len(name.strip())>0: blacklist.append(name.strip())
- f.close()
- #END #
- #########################
- #Change user.name into nick or return user.name
- #########################
- def sntonick(username):
- user = username.lower()
- if user in nicks:
- nick = json.loads(nicks[user])
- return nick.title()
- else:
- return user.capitalize()
- class bot(ch.RoomManager):
- def onInit(self):
- self.setNameColor("808080")
- self.setFontColor("FF6600")
- self.setFontFace("8")
- self.setFontSize(11)
- self.enableBg()
- self.enableRecording()
- def googleSearch(self, search):
- encoded = urllib.parse.quote(search)
- rawData = urllib.request.urlopen("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="+encoded).read().decode("utf-8")
- jsonData = json.loads(rawData)
- searchResults = jsonData["responseData"]["results"]
- for data in searchResults:
- title = data["title"]
- print(title)
- link = data["url"]
- if "youtube" in link:
- full = "http://www.youtube.com/watch?v="+link[35:]
- return('I found: %s <br> %s' % (title, full))
- else:
- full = link
- return('I found: %s <br> %s' % (title, full))
- break
- def tebayoku_new(self):
- try:
- import urllib.request
- with urllib.request.urlopen("http://tebayoku.blogspot.com/") as url:
- udict = url.read().decode()
- udict = udict.replace('\r', '').replace('\n', '')
- judul = re.findall("<h2 class='post-title entry-title'>(.+?)</h2>", udict, re.S)
- l=[]
- num = 1
- for i in judul:
- x = '<br/>(%s) <u>%s</u>' %(num,i)
- l.append("<a target='_blank'>"+x+"</a>")
- num = num+1
- string = ' '.join(l[0:10])
- return string
- except Exception as e:
- return str(e)
- def onConnect(self, room):
- print("Connected to "+room.name)
- def onReconnect(self, room):
- print("Reconnect to "+room.name)
- def onFloodingWarning(self, room):
- room.reconnect()
- def getAccess(self, user):
- if user.name.lower() == "Aluf": return 2
- else: return 0
- def getAccess(self, user):
- if user.name in users: return 1 # user-list
- else: return 0
- def getUptime():
- # do return startTime if you just want the process start time
- return time.time() - startTime
- #### SYSTEM UPTIME
- def uptime():
- total_seconds = float(getUptime())
- # Helper vars:
- MINUTE = 60
- HOUR = MINUTE * 60
- DAY = HOUR * 24
- # Get the days, hours, etc:
- days = int( total_seconds / DAY )
- hours = int( ( total_seconds % DAY ) / HOUR )
- minutes = int( ( total_seconds % HOUR ) / MINUTE )
- seconds = int( total_seconds % MINUTE )
- # Build up the pretty string (like this: "N days, N hours, N minutes, N seconds")
- string = ""
- if days > 0:
- string += str(days) + " " + (days == 1 and "day" or "days" ) + ", "
- if len(string) > 0 or hours > 0:
- string += str(hours) + " " + (hours == 1 and "hour" or "hours" ) + ", "
- if len(string) > 0 or minutes > 0:
- string += str(minutes) + " " + (minutes == 1 and "minute" or "minutes" ) + ", "
- string += str(seconds) + " " + (seconds == 1 and "second" or "seconds" )
- return string;
- def getAccess(self, user):
- if user.name in spermitted: return 4 # owner-JP
- elif user.name in permitted: return 3 # masters
- elif user.name in hpermitted: return 2 # half-masters
- elif user.name in whitelist: return 1 # White-list
- else: return 0
- #################
- #GLOBALS
- #################
- global activated
- global lockdown
- def onMessage(self, room, user, message):
- print(user.name+": "+message.body)
- 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
- ##RoomHist
- nama = user.name
- hist[nama] = json.dumps([(time.strftime("%d/%m/%y- %H:%M:%S", time.localtime(time.time()))), room.name, message.body])
- # SN Notif
- if user.name in blacklist: return
- if user.name in notif and user.name in sasaran:
- room.message(user.name+", you got a note left unread. type .rn to read it")
- notif.remove(user.name)
Advertisement
Add Comment
Please, Sign In to add comment