dcc -- Let the bot invite you to a DCC CHAT connection.
"""
+import sys
+import random, string, subprocess
import irc.bot
import irc.strings
from irc.client import ip_numstr_to_quad, ip_quad_to_numstr
-import random, string, subprocess
from makeMexicanWall import saveMerica
def randomWord(length):
if process.stderr:
print(nick + ": SPL compiling failed!, Notifying client")
- c.notice(nick, "You know what grinds my wheels?")
+ print(nick + ": " + process.stderr.decode())
+ c.notice(nick, "You know what grind my wheels?")
c.notice(nick, " " + process.stderr.decode().replace("\r", "").replace("\n", " "))
return
else:
process = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, cwd="./flagdir")
if process.stderr:
print(nick + ": not a valid sh command!")
- c.notice(nick, "You know grinds my wheels?")
+ c.notice(nick, "You know grind my wheels?")
c.notice(nick, " " + process.stderr.decode().replace("\r", "").replace("\n", " "))
else:
print(nick + ": Execution succeeded!")
def main():
- global debugOut
- debugOut = True
- #server = "localhost" #"irc.hackint.org"
- server = "irc.hackint.org"
+ global debugOut
+ if len(sys.argv) != 4:
+ print("Usage: shakedbot <server[:port]> <nickname> <start-channel>")
+ print("\ntarget is a nickname or a channel.")
+ sys.exit(1)
+
+ s = sys.argv[1].split(":", 1)
+ server = s[0]
+ if len(s) == 2:
+ try:
+ port = int(s[1])
+ except ValueError:
+ print("Error: Erroneous port.")
+ sys.exit(1)
+ else:
port = 6667
- channel = "#testing-bot"
- nickname = "shakedbot"
-
- bot = TestBot(channel, nickname, server, port)
- bot.start()
+ nickname = sys.argv[2]
+ channel = sys.argv[3]
+
+ bot = TestBot(channel, nickname, server, port)
+ bot.start()
if __name__ == "__main__":
main()