added combo counter

This commit is contained in:
Death916 2018-07-23 21:06:51 -07:00
parent 64c0939b94
commit f20e8d9f4d

View file

@ -8,12 +8,15 @@ nick = "combo"
admin = "Death916"
logout = "bye " + nick
password = "combo916"
combo = 0
last_nick = ""
def connect():
sock.connect((server, 6667))
sock.send(bytes("USER " + nick +" "+ nick + " " + nick + " " + nick + "\n", "UTF-8"))
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):
sock.send(bytes("JOIN " + chan + "\n", "UTF-8"))
@ -29,12 +32,13 @@ def ping():
def send(msg, target=channel):
sock.send(bytes("PRIVMSG " + target + " :" + msg + "\n", "UTF-8"))
def combo():
s
#def combo():
def main():
connect()
join(channel)
auth()
while 1:
ircmsg = sock.recv(3300).decode("UTF-8")
ircmsg = ircmsg.strip('\n\r')
@ -43,8 +47,20 @@ def main():
name = ircmsg.split('!',1)[0][1:]
message = ircmsg.split('PRIVMSG', 1)[1].split(':',1)[1]
if len(name) < 17:
if message.find():
pass
global last_nick
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:
ping()
ping()
if __name__ == '__main__':
main()