I am looking for a script that will send a welcome message in main chat of the user to all user/op that connects to the hub like this :
welcome" xxxx:.
your ip is" xxxx .
your isp is :"xxxx.
you have xxxx gb shared.
you have xxx slots for upload xxx slots for download.
you are connected to :
thanks
every user/op that connects to the hub will get this message in his mainchat window
sBotName = "Bot_Name"
frmHub:RegBot(sBotName)
function CountMASTERs()
local tmp, online = GetUsersByProfile(GetProfileName(0)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function CountOPs()
local tmp, online = GetUsersByProfile(GetProfileName(1)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function CountVIPs()
local tmp, online = GetUsersByProfile(GetProfileName(2)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function CountRegs()
local tmp, online = GetUsersByProfile(GetProfileName(3)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function OpConnected(user)
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
local tmp
tmp = "Welcome to "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\t??? Hub Address: ....\r\n"
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n"
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n"
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n"
user:SendPM(sBotName,tmp)
end
--function NewUserConnected(user)
-- local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
-- usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
function NewUserConnected(user)
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$")
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error)
if share == nil then
share = 0
end
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
local tmp
tmp = "Welcome to "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\t??? Hub Address: ....\r\n"
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..CountMASTERs().."\r\n"
tmp = tmp.."\t??? Operators Online: "..CountOPs().."\r\n"
tmp = tmp.."\t??? VIPs Online: "..CountVIPs().."\r\n"
tmp = tmp.."\t??? REGs Online: "..CountRegs().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? To see the NEWEST additions, type !tag \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Read them!! \r\n"
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n"
user:SendPM(sBotName,tmp)
end
Hope its what you wanted
Sorry not quite what you wanted but it send to everyone via PM
i fixed it to my needs and all is working fine (in mainchat as i wanted)
here is the finished script :
sBotName = "welcome"
frmHub:RegBot(sBotName)
function CountMASTERs()
local tmp, online = GetUsersByProfile(GetProfileName(0)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function CountOPs()
local tmp, online = GetUsersByProfile(GetProfileName(1)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function CountVIPs()
local tmp, online = GetUsersByProfile(GetProfileName(2)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function CountRegs()
local tmp, online = GetUsersByProfile(GetProfileName(3)), {n=0}
if tmp then for id = 0, getn(tmp) do if GetItemByName(tmp[id]) then tinsert(online, tmp[id]) end end
end return online.n
end
function OpConnected(user)
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
local tmp
local tmp
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\t??? Total Friends Online: "..frmHub:GetUsersCount().."\r\n"
user:SendData(sBotName,tmp)
end
--function NewUserConnected(user)
-- local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
-- usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
function NewUserConnected(user)
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$")
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error)
if share == nil then
share = 0
end
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
local tmp
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\t??? Total Friends Online: "..frmHub:GetUsersCount().."\r\n"
user:SendData(sBotName,tmp)
end
but i think it can be more short/ less memory....
can anyone help me make it better ????
thanks
hey m8 did try this script out but when i log on as an operator it shiws me how mutch im sharing,,,,
And when i logg on as an user it says my share is zero
Cheers =)
and oe more thungy it comes as a pm when im op... but comes in the main chat when im an user only... =)
sBotName = "Bot_Name"
frmHub:RegBot(sBotName)
function GetOnline(pro)
local user,t = GetUsersByProfile(pro),0
for index,val in user do
if GetItemByName(user) then
t = t + 1
end
end
return t
end
function OpConnected(user)
local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
local tmp
tmp = "Welcome to "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\t??? Hub Address: ....\r\n"
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n"
tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n"
tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n"
tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n"
tmp = tmp.."\ \r\n"
user:SendPM(sBotName,tmp)
end
--function NewUserConnected(user)
-- local i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)%$$")
-- usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
function NewUserConnected(user)
i,j,share = strfind(user.sMyInfoString, ".+%$(%d+)$")
-- this if routine is checking so if the share cannot be extracted , shre equals to zero. and
-- prevents nil / 1024 * 1024 * 1024 (which are causing the error)
if share == nil then
share = 0
end
usershare = format("%0.2f", tonumber(share)/(1024*1024*1024))
local tmp
tmp = "Welcome to "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Your Nick: "..user.sName.."\r\n"
tmp = tmp.."\t??? Your IP: "..user.sIP.."\r\n"
tmp = tmp.."\t??? Your share: "..usershare.."GB\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Hub Name: "..frmHub:GetHubName().."\r\n"
tmp = tmp.."\t??? Hub Address: ....\r\n"
tmp = tmp.."\t??? Hub Desc: "..frmHub:GetHubDescr().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Please Read and Abide by them! \r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Users Online: "..frmHub:GetUsersCount().."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? Masters Online: "..GetOnline("Master").."\r\n"
tmp = tmp.."\t??? Operators Online: "..GetOnline("Operator").."\r\n"
tmp = tmp.."\t??? VIPs Online: "..GetOnline("VIP").."\r\n"
tmp = tmp.."\t??? REGs Online: "..GetOnline("Reg").."\r\n"
tmp = tmp.."\ \r\n"
tmp = tmp.."\t??? To see the NEWEST additions, type !tag \r\n"
tmp = tmp.."\t??? The Hub Cmd's >>> type !help and !rules. Read them!! \r\n"
tmp = tmp.."\t??? Be sure to READ EVERYTHING in the Main chat window!! \r\n"
tmp = tmp.."\t??? If you like this hub, don't forget to add it to your favorites by typing /fav in mainchat \r\n"
user:SendPM(sBotName,tmp)
end
It works perfect... but still got the little prob with it... it aint showing users share it still stands zero (0)....
Cheers
It aint workin like it should.... still got problems with it.... when a normal user logs on it says that they share is 0.00 gb and it comes as pm for op's... can u fix that... thx...
Cheers