-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
executable file
·74 lines (64 loc) · 2.68 KB
/
Copy pathbot.py
File metadata and controls
executable file
·74 lines (64 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
import irc, os, sys, time, platform, easygui
from ctypes import c_int, WINFUNCTYPE, windll
from ctypes.wintypes import HWND, LPCSTR, UINT
masternick = ''
cmdflag = False
chanflag = True
channel = input('Enter a channel to go to: ').strip()
thebot = irc.IRC('MN1Bot', 'MN1Bot', 'MN1Bot')
thebot.IRCJoin(channel)
while True:
mydat = str(thebot.IRCRecv(4096))
print(mydat)
if 'PING' in mydat:
print("PINGPONG")
thebot.IRCSend('PONG')
if 'PRIVMSG KickBot :sekritpass' in mydat:
pmflag = True
for i in range(0, len(mydat)):
if mydat[i] == ':':
continue
if mydat[i] == ':':
masternick = mydat[:i]
thebot.IRCSend('PRIVMSG Marionumber1 :You are now the commander of me!')
if masternick + ' PRIVMSG KickBot :$chanon' in mydat and pmflag:
thebot.IRCChat('Marionumber1 has turned on channel commands')
chanflag = True
if masternick + ' PRIVMSG KickBot :$chanoff' in mydat and pmflag:
thebot.IRCChat('Marionumber1 has turned off channel commands')
chanflag = False
if 'PRIVMSG ' + channel + ' :$say' in mydat and chanflag:
for i in range(0, len(mydat)):
if mydat[i] == '$':
thebot.IRCChat(mydat[i + 5:])
break
if masternick + ' PRIVMSG KickBot :$say' in mydat and pmflag:
for i in range(0, len(mydat)):
if mydat[i] == '$':
thebot.IRCChat(mydat[i + 5:])
break
if 'PRIVMSG ' + channel + ' :$kick' in mydat and chanflag:
kicknick = mydat.split(' PRIVMSG ' + channel + ' :$kick')[0]
if 'Marionumber1' in kicknick:
thebot.IRCChat('Marionumber1 can\'t be kicked')
else:
thebot.IRCSend('KICK ' + channel + ' ' + kicknick.split('!')[0])
if masternick + ' PRIVMSG KickBot :$kick' in mydat and pmflag:
for i in range(0, len(mydat)):
if mydat[i] == '$':
kicknick = mydat[i + 6:]
if kicknick == 'Marionumber1':
thebot.IRCChat('Marionumber1 can\'t be kicked')
break
else:
thebot.IRCSend('KICK ' + channel + ' ' + kicknick)
break
if masternick + ' PRIVMSG KickBot :$raw' in mydat and pmflag:
for i in range(0, len(mydat)):
if mydat[i] == '$':
thebot.IRCSend(mydat[i + 5:])
break
if masternick + ' PRIVMSG KickBot :$quit' in mydat and pmflag:
thebot.IRCChat('Ciao!')
sys.exit()