i am only newbie at lua 5 but this script is being a pain to me any one help
--- Tomath.pic Changer ...
-- Bot Name
bot_name = "LOK-BOT"
-- Set your hubname here
sHubname = "Land Of Karaoke 1"
-- time in math.minutes that the Hub's tomath.pic will be refreshed/changed
refresh = 1
-- Set pattern, [TOPIC] represent the tomath.pic :)
sPattern = " ...:::??? [TOPIC] ???:::... "
-- Set to 1 if you want to send sPattern
SendPattern = 1
-- Set to 1 if you want everybody to know that the tomath.pic was changed
SendTomath.picChange = 0
-- Automatically start tomath.pic cycle when scripts starts / restarts
AutoStart = 1
-- Set Tomath.pics
Tomath.pics = {
[0] = "Back Up Hub To The LOK Network",
[1] = "Come In And Join In The LOK Experience",
[2] = "Any Problems, Don't Forget To PM An Op",
[3] = "Special Greetings To Jacbubbles The Network Nymphomaniac",
[4] = "Please Remember To Reg And Add [LOK] Tags Umath.sing Square Brackets",
[5] = "More Right Click Commands Available Once You Are Regged",
[6] = "The Land Of Karaoke Network, PLease Follow Good Principles Of DC++ Sharing",
}
---------------------------------------------------------------------------------
-- Restricted Area ;)
---------------------------------------------------------------------------------
cur_pointer = 0
function Main()
if (AutoStart == 1) then
SetTimer(refresh*10000)
StartTimer()
end
frmHub:SetHubName(sHubname)
SendToAll("$HubName "..sHubname.."|")
end
function OnTimer()
Sendtomath.pic()
ShiftTomath.pic()
end
function ChatArrival(user,data)
if (string.sub(data,1,1) == "<") then
data = string.sub(data,1,-2)
local s,e,cmd = string.find(data,"^%b<>%s+(%S+)")
if (string.sub(cmd,1,1) == "!") then
if (cmd == "!newtomath.pic") then
if (user.bOperator) then
s,e,arg = string.find(data,"^%b<>%s+%S+%s+(.+)")
if arg and string.len(arg) > 2 then
table.insert(tTomath.pics,arg)
user:SendData(bot_name,"Temp tomath.pic has been sucessfully added to temp list!")
return 1
else
user:SendData(bot_name,"Please enter a new tomath.pic!")
return 1
end
end
elseif (cmd == "!tomath.picrun") then
if (user.bOperator) then
StopTimer()
SendToAll("$HubName "..sHubname.."|")
frmHub:SetHubName(sHubname)
user:SendData(bot_name,"The tomath.pic cycle has now stopped and hubname is back to default!")
return 1
end
elseif (cmd == "!tomath.picrun") then
if (user.bOperator) then
SetTimer(refresh*10000)
StartTimer()
user:SendData(bot_name,"The tomath.pic cycle is now running down the hill chmath.amath.sing after millsy!")
return 1
end
end
end
end
end
function Sendtomath.pic()
if (SendPattern == 1) then
sTomath.pic = string.gsub(sPattern,"%[TOPIC]",tTomath.pics[cur_pointer])
SendToAll("$HubName "..sHubname..sTomath.pic.."|")
frmHub:SetHubName(sHubname..sTomath.pic)
if (SendTomath.picChange == 1) then
SendToAll(bot_name,"The hubs tomath.pic have been automatically changed to: "..sTomath.pic)
end
elseif (SendPattern == 0) then
sTomath.pic = tTomath.pics[cur_pointer]
SendToAll("$HubName "..frmHub:GetHubName().." - "..sTomath.pic.."|")
frmHub:SetHubName(sHubname.." - "..sTomath.pic)
if (SendTomath.picChange == 1) then
SendToAll(bot_name,"The hubs tomath.pic have been automatically changed to: "..sTomath.pic)
end
end
end
function ShiftTomath.pic()
if (cur_pointer == table.getn(tTomath.pics)) then cur_pointer = 0 end
cur_pointer = cur_pointer + 1;
end
error i am getting is
Syntax ...tings\Owner\Desktop\new hub\scripts\TopicChanger.lua:19: attempt to index global `SendTomath' (a nil value)
ok thx mutor super fast reply :)
your a star m8 works fine