mirror of
https://github.com/Death916/combo.git
synced 2026-04-10 03:04:41 -07:00
added combo counter
This commit is contained in:
parent
64c0939b94
commit
f20e8d9f4d
1 changed files with 24 additions and 8 deletions
30
combo.py
30
combo.py
|
|
@ -8,12 +8,15 @@ nick = "combo"
|
||||||
admin = "Death916"
|
admin = "Death916"
|
||||||
logout = "bye " + nick
|
logout = "bye " + nick
|
||||||
password = "combo916"
|
password = "combo916"
|
||||||
|
combo = 0
|
||||||
|
last_nick = ""
|
||||||
def connect():
|
def connect():
|
||||||
sock.connect((server, 6667))
|
sock.connect((server, 6667))
|
||||||
sock.send(bytes("USER " + nick +" "+ nick + " " + nick + " " + nick + "\n", "UTF-8"))
|
sock.send(bytes("USER " + nick +" "+ nick + " " + nick + " " + nick + "\n", "UTF-8"))
|
||||||
sock.send(bytes("NICK " + nick + "\n", "UTF-8" + "\n"))
|
sock.send(bytes("NICK " + nick + "\n", "UTF-8" + "\n"))
|
||||||
sock.send("PRIVMSG" + " NICKSERV :identify " + password +"\n")
|
|
||||||
|
def auth():
|
||||||
|
sock.send(bytes("PRIVMSG" + " NICKSERV :identify " + password +"\n"," UTF-8"))
|
||||||
|
|
||||||
def join(chan):
|
def join(chan):
|
||||||
sock.send(bytes("JOIN " + chan + "\n", "UTF-8"))
|
sock.send(bytes("JOIN " + chan + "\n", "UTF-8"))
|
||||||
|
|
@ -29,12 +32,13 @@ def ping():
|
||||||
def send(msg, target=channel):
|
def send(msg, target=channel):
|
||||||
sock.send(bytes("PRIVMSG " + target + " :" + msg + "\n", "UTF-8"))
|
sock.send(bytes("PRIVMSG " + target + " :" + msg + "\n", "UTF-8"))
|
||||||
|
|
||||||
def combo():
|
#def combo():
|
||||||
s
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
connect()
|
connect()
|
||||||
join(channel)
|
join(channel)
|
||||||
|
auth()
|
||||||
while 1:
|
while 1:
|
||||||
ircmsg = sock.recv(3300).decode("UTF-8")
|
ircmsg = sock.recv(3300).decode("UTF-8")
|
||||||
ircmsg = ircmsg.strip('\n\r')
|
ircmsg = ircmsg.strip('\n\r')
|
||||||
|
|
@ -43,8 +47,20 @@ def main():
|
||||||
name = ircmsg.split('!',1)[0][1:]
|
name = ircmsg.split('!',1)[0][1:]
|
||||||
message = ircmsg.split('PRIVMSG', 1)[1].split(':',1)[1]
|
message = ircmsg.split('PRIVMSG', 1)[1].split(':',1)[1]
|
||||||
if len(name) < 17:
|
if len(name) < 17:
|
||||||
if message.find():
|
global last_nick
|
||||||
pass
|
if last_nick != name:
|
||||||
|
global combo
|
||||||
|
combo = 1
|
||||||
|
last_nick = name
|
||||||
|
else:
|
||||||
|
if name == last_nick:
|
||||||
|
combo += 1
|
||||||
|
send(name + " is on a " + str(combo) + "combo")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ircmsg.find("PING :") != -1:
|
if ircmsg.find("PING :") != -1:
|
||||||
ping()
|
ping()
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue