Browse Source

Updated ai.lua, attempted to add a timeout mechanism (it doesn't work)

pull/1/head
Izaya 7 years ago
parent
commit
17f1d09e76
  1. 3
      ai.lua
  2. 6
      config.lua
  3. 17
      init.lua

3
ai.lua

@ -5,6 +5,9 @@
{"I really like Queens of the Stone Age","Paramore is pretty good.","Green Day is great to listen to."},
{"music","favorite","like","?"}
},{
{"tsunbot a shit","tsunbot should pull a ThatAnon","tsunbot should self-terminate."},
{"tsunbot","tsunbot","tsunbot","tsunbot","tsunbot","tsunbot","tsunbot","tsunbot","tsunbot","tsunbot",}
},{
{"Yes.","No.","Perhaps."},
{"?","?"}
}}

6
config.lua

@ -1,5 +1,5 @@
{server="irc.quakenet.org",
nick="yukichan",
{server="irc.freenode.net",
nick="yukichan2",
hostname="lain",
servername="lain",
realname="yuki",
@ -20,7 +20,7 @@ timers={
"highfive.lua"
},
debug=false,
autojoin=true,
autojoin=false,
prefix=":",
username="yuki",
port=6667,

17
init.lua

@ -152,6 +152,14 @@ function parsemsg(nick,chan,message)
sendchan(chan,"Bye! o/")
writeln("QUIT :Blame telstra.")
print("Killed by "..nick)
os.exit(0)
end
elseif tCommand[1] == "restart" then
if checkAdmin(nick) then
sendchan(chan,"Bye! o/")
writeln("QUIT :Blame telstra.")
print("Killed by "..nick)
os.exit(1)
end
elseif cmds[tCommand[1]] ~= nil then
local fail, errors = pcall(cmds[tCommand[1]],nick,chan,tCommand,message)
@ -229,9 +237,12 @@ function main()
if line ~= nil and line ~= "timeout" then
print(line)
pcall(parse,line)
elseif line == "timeout" and os.time() > _G.lastping + config.timeout then
print("Connection to IRC timed out, aborting.")
break
else
--[[ if (line == "timeout" or line == nil) and os.time() > _G.lastping + config.timeout then
print(line)
print("Connection to IRC timed out, aborting.")
os.exit(1)
end]]--
end
for k,v in ipairs(timers) do
local fail, errors = pcall(v,line)

Loading…
Cancel
Save