ok this is what ive got -->>
Crontab -->>
*/1 * * * * /usr/local/bin/hubfortune
pathetic but functional bash script -->>
#!/bin/bash
/usr/bin/fortune > /etc/verlihub/scripts/fortune.txt
-- Fortune
botname = "Fortune"
filename = "/etc/verlihub/scripts/fortune.txt"
fortunes = {}
-- 30 min = 60 sec * 30
maxTicks = 1800
-- switch between 1 and nil
enabledTimer = 1
Func = {}
Func.LoadStrings = function()
i = 0
for line in io.lines(filename) do
if line ~= nil then
fortunes[i] = line
i = i+1
end
end
end
function Main()
VH:AddRobot(botname, 10, "Spam Bot", "Bot/Hub", "bot@hub.com", "1$
Func.LoadStrings()
end
return 1
end
-- Timer
TimerTicks = 0
function VH_OnTimer()
if (enabledTimer) then
TimerTicks = TimerTicks + 1
if TimerTicks == maxTicks then
VH:SendDataToAll("<"..botname.."> "..fortunes[math.random(0, table.getn(fortu$
TimerTicks = 0
end
end
end
now its not right all i want to do is get the script to access a txt file i have setup and spam txt outa that every 30 mins into my hub chat anyone know how id accomplish this plz plz plz ???
give this a try.
-- Fortune
botname = "Fortune"
filename = "/etc/verlihub/scripts/fortune.txt"
fortunes = {}
-- 30 min = 60 sec * 30
maxTicks = 1800
-- switch between 1 and nil
enabledTimer = 1
Func = {}
Func.LoadStrings = function()
i = 0
for line in io.lines(filename) do
if line ~= nil then
fortunes[i] = line
i = i+1
end
end
end
function Main()
VH:AddRobot(botname, 10, "Spam Bot", "Bot/Hub", "bot@hub.com", "1$")
Func.LoadStrings()
end
-- Timer
TimerTicks = 0
function VH_OnTimer()
if (enabledTimer) then
TimerTicks = TimerTicks + 1
if TimerTicks == maxTicks then
VH:SendDataToAll("<"..botname.."> "..fortunes[math.random(0, table.getn(fortune))].."1$")
TimerTicks = 0
end
end
end
plop
hmm nope doesnt say anything at all now, ima try get back in nilles hub so i can explain better, ty man
Aka - ?????rg?