PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Conversion Requests => Topic started by: Annie on 17 June, 2008, 08:45:16

Title: FLAG
Post by: Annie on 17 June, 2008, 08:45:16
hiya ive got a lua of a flag that goes up timed in main I was wondering could somebody convert it for me please so it works with the new hub software, thanks :D

--[[
*********************  name: Line builder in main chat 5.0-5.1 *********************
********************* by [NL]Daddy-Bear?  made in 2006  *********************

]]

--  *********************   Settings   *********************

k = 0 -- Yust a ccounter don't chance
kk = 2 -- Yust a ccounter don't chance
delay = 50000 -- Interval between announcements.   (1000 = 4.75 min)
CommOn = "+lon" -- Start the script.
CommOff = "+loff" -- Stop the script.
StartOn = "1" -- Start script by starting this lua  ["1"=yes "0"=no]

-- *********************   End off Settings   *********************

Bot = "" -- Name for bot

function Main()
frmHub:RegBot(Bot)
SetTimer(50)  -- Yust a ccounter don't chance  !!!
if StartOn == "1" then
StartTimer()
end
end

function ChatArrival(user, data)
s,e,cmd = string.find(data, "%b<>%s+(%S+)(%S+)")
if (cmd==CommOn) and user.bOperator then
user:SendData(Bot,"\r\n\r\n\t--<< Text script has started >>--\r\n\r\n")
StartTimer()
return 1
elseif (cmd==CommOff) and user.bOperator then
StopTimer()   
user:SendData(Bot,"\r\n\r\n\t--<< Text script has stopped >>--\r\n\r\n")
return 1
end
end

function OnTimer()
k = k + 1
if k == 300 * kk then
SendToAll("")
end
if k == 301 * kk then
SendToAll("  UK HUB ")
end
if k == 302 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 303 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 304 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 305 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 306 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 307 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 308 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 309 * kk then
SendToAll(" :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 310 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 311 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 312 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 313 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 314 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 315 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 316 * kk then
SendToAll(" ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::")
end
if k == 317 * kk then
SendToAll("  Welcome to  ")
end
if k == 318 * kk then
SendToAll("")
end
if k == 319 * kk then
SendToAll("")
end

-- Here is a  delay between the two lines  (time is the count from 310 to 600)
if k == 996* kk then
SendToAll("")
end
if k == 997* kk then
SendToAll("") 
end
if k == 998* kk then 
SendToAll("")
end
if k == 999* kk then
SendToAll("")
end
if k == 1000* kk then
SendToAll("")
end
if k == 1001* kk then
SendToAll("")
              end
if k == 1002* kk then
SendToAll("")
end
if k == 1003* kk then
SendToAll("")
end
if k == 1004* kk then
SendToAll("")
end 
if k == delay then k = 0
        end
end