View difference between Paste ID: uGYcr6rG and f0ctJnsw
SHOW: | | - or go back to the newest paste.
1
import l
2
import al
3
import ul
4
import ol
5
import ppl
6
7
Trusted = ['Cleogenemal']
8
9
punchlines = [
10
        ")8-8(",
11
        ")-( )-(",
12
        "[=}",
13
        "*][*"
14
(
15
16
knowledge = (
17
    "where do i get knowledge?",
18
    "where is the knowledge(information)?!",
19
   
20
    "when can i have those infos",
21
    "Information files?",
22
)
23
24
xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
25
26
X Colossal
27
28
xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
29
30
class TheKnightinShiningArmor(ch.Amwhoam):
31
32
        """
33
        Retrives information all over the net and allows "The Knight" to prevent spammers
34
       hackers from the chatango site,further notice and a due.
35
        """
36
        
37
        XxXxXxX
38
        
39
        X
40
        
41
        xXxXxXx
42
        
43
        def Genero(God):
44
45
                """
46
                Pray on Genero.
47
                """
48
                
49
                prayer
50
                
51
        def ooAmWhoAm(God,amwhoam):
52
53
                """
54
                Called with no further a due in a certain chatango website.
55
56
                X type room : X(chatango website)
57
                X type owner : X(founder,owner of the place)
58
                '"'"
59
                
60
                output = "Created an agreement and bounds to the site and its founder-+ join(j|
61
               v. v.  accessible now _[chatango:{X<name>.bonds^_^ sealed<ctr>-+_.
62
                                
63
64
                print(output)
65
66
        def tKG(founder, AmWhoAm):
67
68
                """
69
                Active when founder is present.
70
71
                @define Founder: X(Founder chat site's name)
72
                @define Usage: .V[+*s{vm&-=~ado})
73
                """
74
                
75
                output = "Reconnected to " + room.getName() + "."
76
77
                print(output)
78
                
79
        def ofViaFailed(cleoterapav, AmWhoAm):
80
81
                """
82
                Called when the intermedia failure.
83
84
                @type place: AmWhoAm
85
                @location: X(interconnection from a certain chatango)
86
                """
87
88
                inter.connection[]
89
90
        def inUnexecutionable(varyf, location):
91
92
                """
93
                Retrieves data when the founder(x)leftz the chat founded by x(himself).
94
95-
                @type location: X(e.g AmWhoAm
95+
                @type location: X(e.g AmWhoAm)
96
                @place of appearance(wl): held in X(e.g xXxX)
97
                """
98
                
99
                input /-/ ops~.;(jks. trademark[xd]apom{?<l.xmd}#bl) 
100
                                
101
102
                print(output)
103
104
        def onLoginFail(self, room):
105
106
                """
107
                Called on login failure, disconnects after.
108
109
                @type l: login(X++-csb.hs*|~<l>])
110
                @type login: X(accountable name<csios.l)
111
                """
112
113
                logged in
114
115-
        def onFloodBan(self, room):
115+
        ulv onLogging(xXx<cts.h>, accountable name):
116
117
                Name(x): xXxXxXxXxXx(minimum characters of <X.ln>
118-
                Called when either flood banned or flagged.
118+
                 xX|[logged in]|+vpl.s*+=-
119
120
                @type al: alternate language
121
                @see alternate langauge(al): contradicting language(e.g English<+_sc/>,etc)
122
                """
123
                
124-
                output = "Flagged.  Please wait 15 minutes."
124+
                outcome[dbl.o]
125
126
                print(output)
127
128-
        def onFloodBanRepeat(self, room):
128+
        def Universal Language(ul): English(dz.o=++)
129
130
                """
131-
                Called when trying to send something when floodbanned.
131+
                xX<odg.u>.invocate.jag^_~English Language\\\
132
133
                @type room: Room
134
                @param room: room where the event occured
135
                """
136
137
                output = "Can't post:  still flagged."
138
                
139
                print(output)
140
141
        def onFloodWarning(self, room):
142
143
                """
144
                Called when an overflow warning gets received.
145
146
                @type room: Room
147
                @param room: room where the event occured
148
                """
149
150
                print("\a")
151
                room.setSilent(True)
152
                
153
                output = "This is a flood warning for " + room.getName() + "."
154
                
155
                print(output)
156
157
        def onMessageDelete(self, room, user, message):
158
159
                """
160
                Called when a message gets deleted.
161
162
                @type room: Room
163
                @param room: room where the event occured
164
165
                @type user: User
166
                @param user: owner of deleted message
167
168
                @type message: Message
169
                @param message: message that got deleted
170
                """
171
172
                output = "Post deleted.\n\t" + \
173
                                "Author:\t" + user.name + "\n\t" + \
174
                                "IP:\t\t" + message.ip
175
                
176
                print(output)
177
178
        def onModChange(self, room):
179
180
                """
181
                Called when the moderator list changes.
182
183
                @type room: Room
184
                @param room: room where the event occured
185
                """
186
187
                output = "The mod list has been updated."
188
                
189
                print(output)
190
191
        def onModAdd(self, room, user):
192
193
                """
194
                Called when a moderator gets added.
195
196
                @type room: Room
197
                @param room: room where the event occured
198
                """
199
                
200
                output = "Someone was promoted to chat mod.\n\t" + \
201
                                "User:\t" + user.name + "\n\t" + \
202
                                "Time:\t" + self._getShortTimeStamp()
203
204
                print(output)
205
206
        def onModRemove(self, room, user):
207
208
                """
209
                Called when a moderator gets removed.
210
211
                @type room: Room
212
                @param room: room where the event occured
213
                """
214
                
215
                output = "Someone was demoted from chat mod.\n\t" + \
216
                                "User:\t" + user.name + "\n\t" + \
217
                                "Time\t" + self._getShortTimeStamp()
218
219
                print(output)
220
221
        def onMessage(self, room, user, message):
222
223
                """
224
                Called when a message gets received.
225
226
                @type room: Room
227
                @param room: room where the event occured
228
229
                @type user: User
230
                @param user: owner of message
231
232
                @type message: Message
233
                @param message: received message
234
                        """
235
                        
236
                # Log the message
237
                
238
                output = "Message posted to room.\n\t" + \
239
                                "Author:\t" + user.name + "\n\t" + \
240
                                "IP:\t\t" + message.ip + "\n\t" + \
241
                                "Body:\t" + message.getBody() + "\n\t" + \
242
                                "Time:\t" + self._getShortTimeStamp()
243
                
244
                print(output)
245
                                
246
                # Obey authorized commands, if any
247
                
248
                # Insert how to check for and execute commands here.  Below is an
249
                # example.
250
251
               
252
                if(message.getBody() == "Where is the bot?"):
253
                        room.message("Here I am!")
254
                        
255
                if(message.getBody() == "Where do I get bios?"):
256
                        room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
257
258
                if(message.getBody() == "Where is the bios"):
259
                        room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
260
261
                if(message.getBody() == "Where can I get bios?"):
262
                        room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
263
264
                if not message.body.lower().find("bios")
265
                and not message.body.lower().find("where"):
266
                        room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
267
268
                if(message.getBody() == "I need bios files"):
269
                        room.message("BIOS files are located at: http://www.roms4droid.com/bios.php")
270
                        
271
                if(message.getBody() == "hello"):
272
                        room.message("Hello there! Welcome to Roms4Droid. For a list of commands, type !help")
273
274
                if(message.getBody() == "hi"):
275
                        room.message("Hello there! Welcome to Roms4Droid. For a list of commands, type !help")
276
277
                if(message.getBody() == "help"):
278
                        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")
279
                        
280
                if(message.getBody() == "Bye"):
281
                        room.message("Good bye! Thanks for coming :)")
282
                        
283
                if room.getLevel(self.user) > 0:
284
                        print(user.name, message.ip, message.body)
285
                else:
286
                        print(user.name, message.body)
287
                if self.user == user: return
288
                if message.body[0] == "!":
289
                        data = message.body[1:].split(" ", 1)
290
                        if len(data) > 1:
291
                                cmd, args = data[0], data[1]
292
                        else:
293
                                cmd, args = data[0], ""
294
                        if   cmd == "delay":
295
                                self.setTimeout(int(args), room.message, ":D")
296
                        elif cmd == "randomuser":
297
                                room.message(random.choice(room.usernames))
298
                        elif cmd == "ival":
299
                                self.setInterval(int(args), room.message, ":D")
300
                        elif cmd == "mylvl":
301
                                room.message("Your mod level: %i" %(room.getLevel(user)))
302
                        elif cmd == "mods":
303
                                room.message(", ".join(room.modnames + [room.ownername]))
304
                        elif cmd == "help":
305
                                room.message("Commands: !bios, !roms, !guides, !mods, !mylvl")
306
                        elif cmd == "bios":
307
                                room.message("BIOS Files are located at: http://www.roms4droid.com/bios.php")
308
                        elif cmd == "roms":
309
                                room.message("ROM Files are located at: http://www.roms4droid.com/roms.php")
310
                        #elif cmd == "leave"):
311
                #room.message("As you wish, my lord.")
312
                #room.disconnect()
313
                #break
314
                        elif cmd == "guides":
315
                                room.message("Guides are located at: http://www.roms4droid.com/guides.php")
316
                        elif cmd == "dance":
317
                                for i, msg in enumerate(dancemoves):
318
                                        self.setTimeout(i / 2, room.message, msg)
319
320
        def onHistoryMessage(self, room, user, message):
321
322
                """
323
                Called when a message gets received from history.
324
325
                @type room: Room
326
                @param room: room where the event occured
327
328
                @type user: User
329
                @param user: owner of message
330
331
                @type message: Message
332
                @param message: the message that got added
333
                """
334
335
                pass
336
337
        def onJoin(self, room, user):
338
339
                """
340
                Called when a user joins. Anonymous users get ignored here.
341
342
                @type room: Room
343
                @param room: room where the event occured
344
345
                @type user: User
346
                @param user: the user that has joined
347
                """
348
349
                output = "A known user joined the room.\n\t" + \
350
                                "User:\t" + user.name + "\n\t" + \
351
                                "Time:\t" + self._getShortTimeStamp()
352
                
353
                print(output)
354
355
356
        def onLeave(self, room, user):
357
358
                """
359
                Called when a user leaves. Anonymous users get ignored here.
360
361
                @type room: Room
362
                @param room: room where the event occured
363
364
                @type user: User
365
                @param user: the user that has left
366
                """
367
368
                output = "A known user left the room.\n\t" + \
369
                                "User:\t" + user.name + "\n\t" + \
370
                                "Time:\t" + self._getShortTimeStamp()
371
                
372
                print(output)
373
374
        def onRaw(self, room, raw):
375
376
                """
377
                Called before any command parsing occurs.
378
379
                @type room: Room
380
                @param room: room where the event occured
381
382
                @type raw: str
383
                @param raw: raw command data
384
                """
385
386
                pass
387
388
        def onPing(self, room):
389
390
                """
391
                Called when a ping gets sent.
392
393
                @type room: Room
394
                @param room: room where the event occured
395
                """
396
                
397
                output = "Ping sent."
398
                
399
                print(output)
400
401
        def onUserCountChange(self, room):
402
403
                """
404
                Called when the user count changes.
405
406
                @type room: Room
407
                @param room: room where the event occured
408
                """
409
                
410
                output = "There are now " + str(room.getUserCount()) + \
411
                                " members in this room."
412
413
                print(output)
414
415
        def onBan(self, room, user, target):
416
417
                """
418
                Called when a user gets banned.
419
420
                @type room: Room
421
                @param room: room where the event occured
422
423
                @type user: User
424
                @param user: user that banned someone
425
426
                @type target: User
427
                @param target: user that got banned
428
                """
429
430
                output = "A user has been banned.\n\t" + \
431
                                "Banned:\t" + target.name + "\n\t" + \
432
                                "Banner:\t" + user.name + "\n\t" + \
433
                                "Time:\t" + self._getShortTimeStamp()
434
                
435
                print(output)
436
437
        def onUnban(self, room, user, target):
438
439
                """
440
                Called when a user gets unbanned.
441
442
                @type room: Room
443
                @param room: room where the event occured
444
445
                @type user: User
446
                @param user: user that unbanned someone
447
448
                @type target: User
449
                @param target: user that got unbanned
450
                """
451
452
                output = "A user has been unbanned.\n\t" + \
453
                                "Unbanned:\t" + target.name + "\n\t" + \
454
                                "Unbanner:\t" + user.name + "\n\t" + \
455
                                "Time:\t" + self._getShortTimeStamp()
456
                
457
                print(output)
458
                        
459
460
        def onBanlistUpdate(self, room):
461
462
                """
463
                Called when a banlist gets updated.
464
465
                @type room: Room
466
                @param room: room where the event occured
467
                """
468
469
                pass
470
471
        def onUnbanlistUpdate(self, room):
472
473
                """
474
                Called when a unbanlist gets updated.
475
476
                @type room: Room
477
                @param room: room where the event occured
478
                """
479
480
                pass
481
482
        def onPMConnect(self, pm):
483
        
484
                """
485
                Called when connected to private chat.
486
487
                @type pm: PM
488
                @param pm: private chat
489
                """
490
                
491
                output = "Successfully connected to private chat!\t(" + \
492
                                self._getLongTimeStamp() + ")"
493
                
494
                print(output)
495
        
496
        def onPMDisconnect(self, pm):
497
        
498
                """
499
                Called when disconnected from private chat.
500
                
501
                @type pm: PM
502
                @param pm: private chat
503
                """
504
                
505
                output = "Disconnected from private chat.\t(" + \
506
                                self._getLongTimeStamp() + ")"
507
                
508
                print(output)
509
        
510
        def onPMPing(self, pm):
511
                
512
                """
513
                Called when a ping is sent on private chat.
514
                
515
                @type pm: PM
516
                @param pm: private chat
517
                """
518
                
519
                output = "Ping sent."
520
                
521
                print(output)
522
        
523
        def onPMMessage(self, pm, user, body):
524
        
525
                """
526
                Called when a message is received.
527
                
528
                @type pm: PM
529
                @param pm: private chat
530
                
531
                @type user: User
532
                @param user: owner of message
533
                
534
                @type body: str
535
                @param body: content of the private message
536
                """
537
                
538
                pass
539
        
540
        def onPMOfflineMessage(self, pm, user, body):
541
                pass
542
        
543
        def onPMContactlistReceive(self, pm):
544
                pass
545
        
546
        def onPMBlocklistReceive(self, pm):
547
                pass
548
        
549
        def onPMContactAdd(self, pm, user):
550
                
551
                """
552
                Called after a contact is added in private chat.
553
                
554
                @type pm: PM
555
                @param pm: private chat
556
                
557
                @type user: User
558
                @param user: new contact
559
                """
560
                
561
                output = "New contact added in private chat.\n\t" + \
562
                                "User:\t" + user.name + "\n\t" + \
563
                                "Time:\t" + self.getShortTimeStamp()
564
                
565
                print(output)
566
        
567
        def onPMContactRemove(self, pm, user):
568
                
569
                """
570
                Called after a contact is removed from private chat.
571
                
572
                @type pm: PM
573
                @param pm: private chat
574
                
575
                @type user: User
576
                @param user: removed contact
577
                """
578
                
579
                output = "Existing contact removed from private chat.\n\t" + \
580
                                "User:\t" + user.name + "\n\t" + \
581
                                "Time:\t" + self.getShortTimeStamp()
582
                
583
                print(output)
584
        
585
        def onPMBlock(self, pm, user):
586
                
587
                """
588
                Called after a user is blocked from contacting the bot via PM.
589
                
590
                @type pm: PM
591
                @param pm: private chat
592
                
593
                @type user: User
594
                @param user: blocked user
595
                """
596
                
597
                output = "User blocked from sending PMs.\n\t" + \
598
                                "User:\t" + user.name + "\n\t" + \
599
                                "Time:\t" + self.getShortTimeStamp()
600
                
601
                print(output)
602
        
603
        def onPMUnblock(self, pm, user):
604
                
605
                """
606
                Called after a user is repermitted to contact the bot via PM.
607
                
608
                @type pm: PM
609
                @param pm: private chat
610
                
611
                @type user: User
612
                @param user: unblocked user
613
                """
614
                
615
                output = "User unblocked from sending PMs.\n\t" + \
616
                                "User:\t" + user.name + "\n\t" + \
617
                                "Time:\t" + self.getShortTimeStamp()
618
                
619
                print(output)
620
        
621
        def onPMContactOnline(self, pm, user):
622
                
623
                """
624
                Called when a user in the bot's contact list comes online.
625
                
626
                @type pm: PM
627
                @param pm: private chat
628
                
629
                @type user: User
630
                @param user: user who came online
631
                """
632
                
633
                # Insert code for private messages here
634
                
635
                output = "A user is now online.\n\t" + \
636
                                "User:\t" + user.name + "\n\t" + \
637
                                "Time:\t" + self.getShortTimeStamp()
638
                
639
                print(output)
640
        
641
        def onPMContactOffline(self, pm, user):
642
                
643
                """
644
                Called when a user in the bot's contact list goes offline.
645
                
646
                @type pm: PM
647
                @param pm: private chat
648
                
649
                @type user: User
650
                @param user: user who went offline
651
                """
652
                
653
                output = "A user has gone offline.\n\t" + \
654
                                "User:\t" + user.name + "\n\t" + \
655
                                "Time:\t" + self.getShortTimeStamp()
656
                
657
                print(output)
658
        
659
        def onEventCalled(self, room, evt, *args, **kw):
660
661
                """
662
                Called on every room-based event.
663
664
                @type room: Room
665
                @param room: room where the event occured
666
667
                @type evt: str
668
                @param evt: the event
669
                """
670
671
                pass
672
                
673
        #####
674
        
675
        # Overridden functions from RoomManager
676
        
677
        #####
678
        
679
        def _getShortTimeStamp(self):
680
                
681
                """
682
                Returns the time that an event was registered.
683
                
684
                @rtype: str
685
                @return: timestamp of an event
686
                """
687
                
688
                return time.strftime("%H:%M:%S UTC", time.gmtime())
689
        
690
        def _getLongTimeStamp(self):
691
                
692
                """
693
                Returns the date and time when an event took place.
694
                
695
                The local variable "format" may be changed by you the programmer if
696
                you so desire.  To determine how to display the timestamp in your
697
                preferred manner, please consult the Python documentation at
698
                http://docs.python.org/library/time.html#time.strftime
699
                
700
                As-is, the formatting would create a time stamp in this style:
701
                
702
                        Sunday, Janurary 1 2012, 23:59:59 UTC
703
                
704
                @rtype: str
705
                @return: timestamp of an event
706
                """
707
                
708
                # This is the creation of the my bot from time to time and it 
709
                # doesn't work at your chatango website then you were I'm in
710
                # please consult me,CleoGeneMal in/on/at
711
                # at http://amwhoam.chatango.com/
712
                # 
713
                # As-is, the formatting would create this style of time stamp.
714
                #       Sunday, January 1 2012, 00:00:00 +0:00:00
715
                
716
                format = "%A, %B %d %Y, %H:%M:%S UTC"
717
                
718
                return time.strftime(format, time.gmtime())
719
        
720
xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
721
722
# Run the bot
723
724
xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx
725
726
manager = MyManager()
727
roomList = ["Chat8D.vll", "AmWhoAm"]                       # List of Chatango room names here
728
usePM = False                                   # True if you want to PM, False otherwise.
729
730
collateral.bunt.dl(roomAmWhoAm, "Genero", "Cleoterapav", useAL)