Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import l
- import al
- import ul
- import ol
- import ppl
- Trusted = ['Cleogenemal']
- punchlines = [
- ")8-8(",
- ")-( )-(",
- "[=}",
- "*][*"
- (
- knowledge = (
- "where do i get knowledge?",
- "where is the knowledge(information)?!",
- "when can i have those infos",
- "Information files?",
- )
- xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
- X Colossal
- xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
- class TheKnightinShiningArmor(ch.Amwhoam):
- """
- Retrives information all over the net and allows "The Knight" to prevent spammers
- hackers from the chatango site,further notice and a due.
- """
- XxXxXxX
- X
- xXxXxXx
- def Genero(God):
- """
- Pray on Genero.
- """
- prayer
- def ooAmWhoAm(God,amwhoam):
- """
- Called with no further a due in a certain chatango website.
- X type room : X(chatango website)
- X type owner : X(founder,owner of the place)
- '"'"
- output = "Created an agreement and bounds to the site and its founder-+ join(j|
- v. v. accessible now _[chatango:{X<name>.bonds^_^ sealed<ctr>-+_.
- print(output)
- def tKG(founder, AmWhoAm):
- """
- Active when founder is present.
- @define Founder: X(Founder chat site's name)
- @define Usage: .V[+*s{vm&-=~ado})
- """
- output = "Reconnected TO " + room.getName() + "."
- print(output)
- def ofViaFailed(cleoterapav, AmWhoAm):
- """
- Called WHEN the intermedia failure.
- @TYPE place: AmWhoAm
- @location: X(interconnection FROM a certain chatango)
- """
- inter.connection[]
- def inUnexecutionable(varyf, location):
- """
- Retrieves data WHEN the founder(x)leftz the chat founded BY x(himself).
- @TYPE location: X(e.g AmWhoAm
- @place OF appearance(wl): held IN X(e.g xXxX)
- """
- input /-/ ops~.;(jks. trademark[xd]apom{?<l.xmd}#bl)
- print(output)
- def onLoginFail(self, room):
- """
- Called ON login failure, disconnects after.
- @TYPE room: Room
- @param room: room WHERE the event occured
- """
- pass
- def onFloodBan(self, room):
- """
- Called WHEN either flood banned OR flagged.
- @TYPE room: Room
- @param room: room WHERE the event occured
- """
- output = "Flagged. Please wait 15 minutes."
- print(output)
- def onFloodBanRepeat(self, room):
- """
- Called WHEN trying TO send something WHEN floodbanned.
- @TYPE room: Room
- @param room: room WHERE the event occured
- """
- output = "Can't post: still flagged."
- print(output)
- def onFloodWarning(self, room):
- """
- Called when an overflow warning gets received.
- @type room: Room
- @param room: room where the event occured
- """
- print("\a")
- room.setSilent(True)
- output = "This is a flood warning for " + room.getName() + "."
- print(output)
- def onMessageDelete(self, room, user, message):
- """
- Called when a message gets deleted.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: owner of deleted message
- @type message: Message
- @param message: message that got deleted
- """
- output = "Post deleted.\n\t" + \
- "Author:\t" + user.name + "\n\t" + \
- "IP:\t\t" + message.ip
- print(output)
- def onModChange(self, room):
- """
- Called when the moderator list changes.
- @type room: Room
- @param room: room where the event occured
- """
- output = "The mod list has been updated."
- print(output)
- def onModAdd(self, room, user):
- """
- Called when a moderator gets added.
- @type room: Room
- @param room: room where the event occured
- """
- output = "Someone was promoted to chat mod.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self._getShortTimeStamp()
- print(output)
- def onModRemove(self, room, user):
- """
- Called when a moderator gets removed.
- @type room: Room
- @param room: room where the event occured
- """
- output = "Someone was demoted from chat mod.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time\t" + self._getShortTimeStamp()
- print(output)
- def onMessage(self, room, user, message):
- """
- Called when a message gets received.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: owner of message
- @type message: Message
- @param message: received message
- """
- # Log the message
- output = "Message posted to room.\n\t" + \
- "Author:\t" + user.name + "\n\t" + \
- "IP:\t\t" + message.ip + "\n\t" + \
- "Body:\t" + message.getBody() + "\n\t" + \
- "Time:\t" + self._getShortTimeStamp()
- print(output)
- # Obey authorized commands, if any
- # Insert how to check for and execute commands here. Below is an
- # example.
- if(message.getBody() == "Where is the bot?"):
- room.message("Here I am!")
- if(message.getBody() == "Where do I get bios?"):
- room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
- if(message.getBody() == "Where is the bios"):
- room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
- if(message.getBody() == "Where can I get bios?"):
- room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
- if not message.body.lower().find("bios")
- and not message.body.lower().find("where"):
- room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
- if(message.getBody() == "I need bios files"):
- room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
- if(message.getBody() == "hello"):
- room.message("Hello there! Welcome to Roms4Droid. For a list of commands, type !help")
- if(message.getBody() == "hi"):
- room.message("Hello there! Welcome to Roms4Droid. For a list of commands, type !help")
- if(message.getBody() == "help"):
- room.message("Need Help? Visit our online how-to guides: http://www.roms4droid.com/guides.php or post a topic in the forum: http://www.roms4droid.com/forum/index.php")
- if(message.getBody() == "Bye"):
- room.message("Good bye! Thanks for coming :)")
- if room.getLevel(self.user) > 0:
- print(user.name, message.ip, message.body)
- else:
- print(user.name, message.body)
- if self.user == user: return
- if message.body[0] == "!":
- data = message.body[1:].split(" ", 1)
- if len(data) > 1:
- cmd, args = data[0], data[1]
- else:
- cmd, args = data[0], ""
- if cmd == "delay":
- self.setTimeout(int(args), room.message, ":D")
- elif cmd == "randomuser":
- room.message(random.choice(room.usernames))
- elif cmd == "ival":
- self.setInterval(int(args), room.message, ":D")
- elif cmd == "mylvl":
- room.message("Your mod level: %i" %(room.getLevel(user)))
- elif cmd == "mods":
- room.message(", ".join(room.modnames + [room.ownername]))
- elif cmd == "help":
- room.message("Commands: !bios, !roms, !guides, !mods, !mylvl")
- elif cmd == "bios":
- room.message("BIOS Files are located at: http://www.roms4droid.com/bios.php")
- elif cmd == "roms":
- room.message("ROM Files are located at: http://www.roms4droid.com/roms.php")
- #elif cmd == "leave"):
- #room.message("As you wish, my lord.")
- #room.disconnect()
- #break
- elif cmd == "guides":
- room.message("Guides are located at: http://www.roms4droid.com/guides.php")
- elif cmd == "dance":
- for i, msg in enumerate(dancemoves):
- self.setTimeout(i / 2, room.message, msg)
- def onHistoryMessage(self, room, user, message):
- """
- Called when a message gets received from history.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: owner of message
- @type message: Message
- @param message: the message that got added
- """
- pass
- def onJoin(self, room, user):
- """
- Called when a user joins. Anonymous users get ignored here.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: the user that has joined
- """
- output = "A known user joined the room.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self._getShortTimeStamp()
- print(output)
- def onLeave(self, room, user):
- """
- Called when a user leaves. Anonymous users get ignored here.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: the user that has left
- """
- output = "A known user left the room.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self._getShortTimeStamp()
- print(output)
- def onRaw(self, room, raw):
- """
- Called before any command parsing occurs.
- @type room: Room
- @param room: room where the event occured
- @type raw: str
- @param raw: raw command data
- """
- pass
- def onPing(self, room):
- """
- Called when a ping gets sent.
- @type room: Room
- @param room: room where the event occured
- """
- output = "Ping sent."
- print(output)
- def onUserCountChange(self, room):
- """
- Called when the user count changes.
- @type room: Room
- @param room: room where the event occured
- """
- output = "There are now " + str(room.getUserCount()) + \
- " members in this room."
- print(output)
- def onBan(self, room, user, target):
- """
- Called when a user gets banned.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: user that banned someone
- @type target: User
- @param target: user that got banned
- """
- output = "A user has been banned.\n\t" + \
- "Banned:\t" + target.name + "\n\t" + \
- "Banner:\t" + user.name + "\n\t" + \
- "Time:\t" + self._getShortTimeStamp()
- print(output)
- def onUnban(self, room, user, target):
- """
- Called when a user gets unbanned.
- @type room: Room
- @param room: room where the event occured
- @type user: User
- @param user: user that unbanned someone
- @type target: User
- @param target: user that got unbanned
- """
- output = "A user has been unbanned.\n\t" + \
- "Unbanned:\t" + target.name + "\n\t" + \
- "Unbanner:\t" + user.name + "\n\t" + \
- "Time:\t" + self._getShortTimeStamp()
- print(output)
- def onBanlistUpdate(self, room):
- """
- Called when a banlist gets updated.
- @type room: Room
- @param room: room where the event occured
- """
- pass
- def onUnbanlistUpdate(self, room):
- """
- Called when a unbanlist gets updated.
- @type room: Room
- @param room: room where the event occured
- """
- pass
- def onPMConnect(self, pm):
- """
- Called when connected to private chat.
- @type pm: PM
- @param pm: private chat
- """
- output = "Successfully connected to private chat!\t(" + \
- self._getLongTimeStamp() + ")"
- print(output)
- def onPMDisconnect(self, pm):
- """
- Called when disconnected from private chat.
- @type pm: PM
- @param pm: private chat
- """
- output = "Disconnected from private chat.\t(" + \
- self._getLongTimeStamp() + ")"
- print(output)
- def onPMPing(self, pm):
- """
- Called when a ping is sent on private chat.
- @type pm: PM
- @param pm: private chat
- """
- output = "Ping sent."
- print(output)
- def onPMMessage(self, pm, user, body):
- """
- Called when a message is received.
- @type pm: PM
- @param pm: private chat
- @type user: User
- @param user: owner of message
- @type body: str
- @param body: content of the private message
- """
- pass
- def onPMOfflineMessage(self, pm, user, body):
- pass
- def onPMContactlistReceive(self, pm):
- pass
- def onPMBlocklistReceive(self, pm):
- pass
- def onPMContactAdd(self, pm, user):
- """
- Called after a contact is added in private chat.
- @type pm: PM
- @param pm: private chat
- @type user: User
- @param user: new contact
- """
- output = "New contact added in private chat.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self.getShortTimeStamp()
- print(output)
- def onPMContactRemove(self, pm, user):
- """
- Called after a contact is removed from private chat.
- @type pm: PM
- @param pm: private chat
- @type user: User
- @param user: removed contact
- """
- output = "Existing contact removed from private chat.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self.getShortTimeStamp()
- print(output)
- def onPMBlock(self, pm, user):
- """
- Called after a user is blocked from contacting the bot via PM.
- @type pm: PM
- @param pm: private chat
- @type user: User
- @param user: blocked user
- """
- output = "User blocked from sending PMs.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self.getShortTimeStamp()
- print(output)
- def onPMUnblock(self, pm, user):
- """
- Called after a user is repermitted to contact the bot via PM.
- @type pm: PM
- @param pm: private chat
- @type user: User
- @param user: unblocked user
- """
- output = "User unblocked from sending PMs.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self.getShortTimeStamp()
- print(output)
- def onPMContactOnline(self, pm, user):
- """
- Called when a user in the bot's contact list comes ONLINE.
- @TYPE pm: PM
- @param pm: PRIVATE chat
- @TYPE USER: USER
- @param USER: USER who came ONLINE
- """
- # Insert code for private messages here
- output = "A USER IS now ONLINE.\n\t" + \
- "USER:\t" + user.name + "\n\t" + \
- "TIME:\t" + self.getShortTimeStamp()
- print(output)
- def onPMContactOffline(self, pm, user):
- """
- Called WHEN a USER IN the bot's contact list goes offline.
- @type pm: PM
- @param pm: private chat
- @type user: User
- @param user: user who went offline
- """
- output = "A user has gone offline.\n\t" + \
- "User:\t" + user.name + "\n\t" + \
- "Time:\t" + self.getShortTimeStamp()
- print(output)
- def onEventCalled(self, room, evt, *args, **kw):
- """
- Called on every room-based event.
- @type room: Room
- @param room: room where the event occured
- @type evt: str
- @param evt: the event
- """
- pass
- #####
- # Overridden functions from RoomManager
- #####
- def _getShortTimeStamp(self):
- """
- Returns the time that an event was registered.
- @rtype: str
- @return: timestamp of an event
- """
- return time.strftime("%H:%M:%S UTC", time.gmtime())
- def _getLongTimeStamp(self):
- """
- Returns the date and time when an event took place.
- The local variable "format" may be changed by you the programmer if
- you so desire. To determine how to display the timestamp in your
- preferred manner, please consult the Python documentation at
- http://docs.python.org/library/time.html#time.strftime
- As-is, the formatting would create a time stamp in this style:
- Sunday, Janurary 1 2012, 23:59:59 UTC
- @rtype: str
- @return: timestamp of an event
- """
- # This is the creation of the my bot from time to time and it
- # doesn't WORK AT your chatango website THEN you were I'm in
- # please consult me,CleoGeneMal in/on/at
- # at http://amwhoam.chatango.com/
- #
- # As-is, the formatting would create this style of time stamp.
- # Sunday, January 1 2012, 00:00:00 +0:00:00
- format = "%A, %B %d %Y, %H:%M:%S UTC"
- return time.strftime(format, time.gmtime())
- xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
- # Run the bot
- xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
- manager = MyManager()
- roomList = ["Chat8D.vll", "AmWhoAm"] # List of Chatango room names here
- usePM = False # True if you want to PM, False otherwise.
- collateral.bunt.dl(roomAmWhoAm, "Genero", "Cleoterapav", useAL)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement