mirror of
https://github.com/Death916/combo.git
synced 2026-04-10 03:04:41 -07:00
cleanup
This commit is contained in:
parent
8f2f210cdb
commit
b1dec9a488
1 changed files with 10 additions and 5 deletions
11
combo.py
11
combo.py
|
|
@ -3,7 +3,8 @@ import time
|
||||||
|
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
server = "chat.freenode.net"
|
server = "chat.freenode.net"
|
||||||
channel = "##idk"
|
channel2 = "##idk"
|
||||||
|
channel = "#r.trees"
|
||||||
nick = "combo"
|
nick = "combo"
|
||||||
admin = "Death916"
|
admin = "Death916"
|
||||||
logout = "bye " + nick
|
logout = "bye " + nick
|
||||||
|
|
@ -31,7 +32,7 @@ def join(chan):
|
||||||
def ping():
|
def ping():
|
||||||
sock.send(bytes("PONG :pingis\n", "UTF-8"))
|
sock.send(bytes("PONG :pingis\n", "UTF-8"))
|
||||||
|
|
||||||
def send(msg, target=channel):
|
def send(msg, target):
|
||||||
sock.send(bytes("PRIVMSG " + target + " :" + msg + "\n", "UTF-8"))
|
sock.send(bytes("PRIVMSG " + target + " :" + msg + "\n", "UTF-8"))
|
||||||
|
|
||||||
#def combo():
|
#def combo():
|
||||||
|
|
@ -40,6 +41,7 @@ def send(msg, target=channel):
|
||||||
def main():
|
def main():
|
||||||
connect()
|
connect()
|
||||||
join(channel)
|
join(channel)
|
||||||
|
join(channel2)
|
||||||
auth()
|
auth()
|
||||||
while 1:
|
while 1:
|
||||||
ircmsg = sock.recv(3300).decode("UTF-8")
|
ircmsg = sock.recv(3300).decode("UTF-8")
|
||||||
|
|
@ -59,7 +61,10 @@ def main():
|
||||||
combo += 1
|
combo += 1
|
||||||
|
|
||||||
if message.rstrip() == "!combo":
|
if message.rstrip() == "!combo":
|
||||||
send(last_nick + " is on a " + str(combo) + " message streak")
|
if combo < 5:
|
||||||
|
send(last_nick + " is on a " + str(combo) + " message streak", channel)
|
||||||
|
elif combo >= 6:
|
||||||
|
send(last_nick + " is on a " + str(combo) + " message streak. they're talkin to themselves", channel)
|
||||||
|
|
||||||
if name.lower() == admin.lower() and message.rstrip() == exit_code:
|
if name.lower() == admin.lower() and message.rstrip() == exit_code:
|
||||||
sock.send(bytes("QUIT \n", "UTF-8"))
|
sock.send(bytes("QUIT \n", "UTF-8"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue