diff --git a/ai.lua b/ai.lua index effda60..3014536 100644 --- a/ai.lua +++ b/ai.lua @@ -1,7 +1,10 @@ {{ -{"I'm a real person, I swear!"}, +{"I'm a real person, I swear!","I'm most certainly not a bot! D:"}, {"are","you","bot"} },{ -{"Thisisalsoatest"}, -{"1234","9999"} +{"I really like Queens of the Stone Age","Paramore is pretty good.","Green Day is great to listen to."}, +{"music","favorite","like","?"} +},{ +{"Yes.","No.","Perhaps."}, +{"?","?"} }} diff --git a/cmds/mpd.lua b/cmds/mpd.lua new file mode 100644 index 0000000..02a543b --- /dev/null +++ b/cmds/mpd.lua @@ -0,0 +1,10 @@ +local nick,chan,tCommand,message = ... +local mpdHost = "192.168.1.17" +if tCommand[2] == "current" then + sendchan(chan,io.popen("mpc -h "..mpdHost.." current"):read("*a")) +elseif tCommand[2] == "playlist" then + io.popen("mpc -h "..mpdHost.." playlist > ~/public_html/mpd-playlist.txt") + sendchan(chan,"http://lain.shadowkat.science/~izaya/mpd-playlist.txt") +else + sendchan(chan,":mpd subcommands: current, playlist") +end diff --git a/cmds/reload.lua b/cmds/reload.lua new file mode 100644 index 0000000..ba019dd --- /dev/null +++ b/cmds/reload.lua @@ -0,0 +1,4 @@ +nick,chan,tCommand,message = ... +if checkAdmin(nick) then + _G.loadconfig() +end diff --git a/config.lua b/config.lua index 574af1d..a6bc010 100644 --- a/config.lua +++ b/config.lua @@ -13,7 +13,8 @@ hooks={ "ai.lua" }, cmds={ -"reload.lua" +reload="reload.lua", +mpd="mpd.lua" }, timers={ "highfive.lua" diff --git a/hooks/ai.lua b/hooks/ai.lua index 7bf7912..b10c9cf 100644 --- a/hooks/ai.lua +++ b/hooks/ai.lua @@ -34,7 +34,8 @@ if string.find(message,lnick) ~= nil and nick ~= "Shocky" then selection = math.random(1,#aitab) end -- print(selection) - selstring = aitab[selection][1][1] + seltab = aitab[selection][1] + selstring = seltab[math.random(1,#seltab)] if type(selstring) == "table" then for k,v in pairs(selstring) do --print(k.."="..v) diff --git a/init.lua b/init.lua index 5f4c31a..5b0f08e 100644 --- a/init.lua +++ b/init.lua @@ -33,7 +33,7 @@ function loadconfig() local s,f = pcall(load,fo:read("*a")) fo:close() if s then - table.insert(cmds,f) + cmds[k]=f print("Command "..v.." loaded") else print("Command "..v.." failed to load:")