i have a script i cant get to work
all the time i get this error:
Syntax Error: expected;
last token read: `,' at line 44 in file `E:\pkotac build 15.11\scripts\info.lua'
Syntax Error: attempt to concat global `BotName' (a nil value)
and next question can you also make it so that the hubuptime is also shown automaticly whitout the need of sending a command?
here is the script:
--------------------------------------------------------------------------------
-- Uptime by extracted from retrobot By Skrollster
-- Retrobot is made by Tezlo
-- Hiding of command from MainChat is added by JenZen?
BotName = "hubinfo"
sek = 1000
min = sek*60
hour = min*60
days = hour*24
time = 1*hour
function Main()
SetTimer(time)
StartTimer()
end
function DataArrival(user, data)
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
--extract command
_,_,cmd=strfind(data, "%b<>%s+(%S+)")
if(cmd == "uptime") then
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
user:SendData("uptime", "*** "..days.." days, "..hrs.." hours "..min.."
minutes and "..sec.." seconds")
return 1;
end
end
function OnTimer()
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
SendToAll(BotName),
"?=============="..frmHub:GetHubName().."=================| ?|"
::HubOwner:[NL]trucker-TeQuilla-hollandse.ko
::Hub-eMail:pfokkink@hotmail.com
::Hub Address: funnyhub.no-ip.info
::HubNetwork: = ?????? Magmar ?????? Network Dutch Division !! Dutch
Located :) Dus NLers Welkom !! =
::Uptime = "..days.." days, "..hrs.." hours "..min.." minutes and
"..sec.." seconds = ?")
SendToAll(BotName, "?============="..frmHub:GetUsersCount().." of
"..frmHub:GetMaxUsers().." Users Connected==================")
end
end
----------------------------------------------------------------------------------
so if someone could fix this i would very much appriciate it .
here you go m8
-- Uptime by extracted from retrobot By Skrollster
-- Retrobot is made by Tezlo
-- Hiding of command from MainChat is added by JenZen?
-- fixed by phatty
BotName = "hubinfo"
sek = 1000
min = sek*60
hour = min*60
days = hour*24
time = 1*hour
function Main()
SetTimer(time)
StartTimer()
end
function DataArrival(user, data)
data=strsub(data,1,strlen(data)-1)
_,_,cmd=strfind(data, "%b<>%s+(%S+)")
if(cmd == "uptime") then
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
user:SendData("uptime", "*** "..days.." days, "..hrs.." hours "..min.." minutes and "..sec.." seconds")
return 1
end
end
function OnTimer()
local sec = clock()
local days = floor(sec/86400)
local hrs = floor((sec-(days*86400))/3600)
local min = floor((sec-(days*86400)-(hrs*3600))/60)
sec = floor(sec-(days*86400)-(hrs*3600)-(min*60))
SendToAll(BotName,"?=============="..frmHub:GetHubName().."=================| ?|")
SendToAll(BotName,"::HubOwner:[NL]trucker-TeQuilla-hollandse.ko")
SendToAll(BotName,"::Hub-eMail:pfokkink@hotmail.com")
SendToAll(BotName,"::Hub Address: funnyhub.no-ip.info")
SendToAll(BotName,"::HubNetwork: = ?????? Magmar ?????? Network Dutch Division !! Dutch")
SendToAll(BotName,"Located :) Dus NLers Welkom !! = ::Uptime = "..days.." days, "..hrs.." hours "..min.." minutes and "..sec.." seconds = ?")
SendToAll(BotName,"?============="..frmHub:GetUsersCount().." of "..frmHub:GetMaxUsers().." Users Connected==================")
end
l8rr,, enjoy ;)
-phatz
Phatty thnx m8
i have installed the bot and sofar no errors.
my thanx are endless :-)))
np at all m8 glad i cud help :o)