Added mpd command, made AI hook work better, added more content to the AI, fixed some misc stuff
This commit is contained in:
parent
12edd5c5a2
commit
8021d11dd2
9
ai.lua
9
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"}
|
{"are","you","bot"}
|
||||||
},{
|
},{
|
||||||
{"Thisisalsoatest"},
|
{"I really like Queens of the Stone Age","Paramore is pretty good.","Green Day is great to listen to."},
|
||||||
{"1234","9999"}
|
{"music","favorite","like","?"}
|
||||||
|
},{
|
||||||
|
{"Yes.","No.","Perhaps."},
|
||||||
|
{"?","?"}
|
||||||
}}
|
}}
|
||||||
|
10
cmds/mpd.lua
Normal file
10
cmds/mpd.lua
Normal file
@ -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
|
4
cmds/reload.lua
Normal file
4
cmds/reload.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
nick,chan,tCommand,message = ...
|
||||||
|
if checkAdmin(nick) then
|
||||||
|
_G.loadconfig()
|
||||||
|
end
|
@ -13,7 +13,8 @@ hooks={
|
|||||||
"ai.lua"
|
"ai.lua"
|
||||||
},
|
},
|
||||||
cmds={
|
cmds={
|
||||||
"reload.lua"
|
reload="reload.lua",
|
||||||
|
mpd="mpd.lua"
|
||||||
},
|
},
|
||||||
timers={
|
timers={
|
||||||
"highfive.lua"
|
"highfive.lua"
|
||||||
|
@ -34,7 +34,8 @@ if string.find(message,lnick) ~= nil and nick ~= "Shocky" then
|
|||||||
selection = math.random(1,#aitab)
|
selection = math.random(1,#aitab)
|
||||||
end
|
end
|
||||||
-- print(selection)
|
-- print(selection)
|
||||||
selstring = aitab[selection][1][1]
|
seltab = aitab[selection][1]
|
||||||
|
selstring = seltab[math.random(1,#seltab)]
|
||||||
if type(selstring) == "table" then
|
if type(selstring) == "table" then
|
||||||
for k,v in pairs(selstring) do
|
for k,v in pairs(selstring) do
|
||||||
--print(k.."="..v)
|
--print(k.."="..v)
|
||||||
|
2
init.lua
2
init.lua
@ -33,7 +33,7 @@ function loadconfig()
|
|||||||
local s,f = pcall(load,fo:read("*a"))
|
local s,f = pcall(load,fo:read("*a"))
|
||||||
fo:close()
|
fo:close()
|
||||||
if s then
|
if s then
|
||||||
table.insert(cmds,f)
|
cmds[k]=f
|
||||||
print("Command "..v.." loaded")
|
print("Command "..v.." loaded")
|
||||||
else
|
else
|
||||||
print("Command "..v.." failed to load:")
|
print("Command "..v.." failed to load:")
|
||||||
|
Loading…
Reference in New Issue
Block a user