mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Made ircbot_message.py use a password.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
|
|
||||||
# Two arguments, channel and message.
|
# Two arguments, channel and message.
|
||||||
# EG: "nudge.py #adminchannel ADMINHELP, people are killing me!"
|
# EG: "ircbot_message.py #adminchannel ADMINHELP, people are killing me!"
|
||||||
|
|
||||||
import sys,pickle,socket
|
import sys,pickle,socket
|
||||||
|
|
||||||
@@ -11,18 +11,17 @@ def pack():
|
|||||||
data = sys.argv[2:] #The rest of the arguments is data
|
data = sys.argv[2:] #The rest of the arguments is data
|
||||||
except:
|
except:
|
||||||
data = "NO DATA SPECIFIED"
|
data = "NO DATA SPECIFIED"
|
||||||
dictionary = {"ip":ip,"data":data}
|
dictionary = {"ip":ip,"data":["PASSWORD"] + data}
|
||||||
pickled = pickle.dumps(dictionary)
|
pickled = pickle.dumps(dictionary)
|
||||||
nudge(pickled)
|
nudge(pickled)
|
||||||
def nudge(data):
|
def nudge(data):
|
||||||
HOST = "IRCBOT IP HERE"
|
HOST = "IRCBOT IP"
|
||||||
PORT = 45678
|
PORT = 45678
|
||||||
size = 1024
|
size = 1024
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.connect((HOST,PORT))
|
s.connect((HOST,PORT))
|
||||||
s.send(data)
|
s.send(data)
|
||||||
s.close()
|
s.close()
|
||||||
|
|
||||||
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
|
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
|
||||||
pack()
|
pack()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user