Does anyone know if there is any script that you can run in one hub that will redirect all connecting users to other hubs based upon their share?
\\3lancer
Hi,
Hpoe it helps..
--Requested by 3lancer
--Made by nErBoS
Bot = "Share-Redirecter"
redshare1 = "1.1.1.1"
redshare2 = "1.1.1.2"
share1 = "5" --GB
share2 = "10" --GB
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user, data)
local s,e,share = strfind(user.sMyInfoString, "$MyINFO $ALL [^$]+$ $[^$]*$[^$]*$([^$]+)")
share = share / (1024*1024*1024)
if(share > share1 and share < share2) then
user:SendData("$ForceMove "..redshare1.."|")
elseif(share >= share2) then
user:SendData("$ForceMove "..redshare2.."|")
else
end
end
Best regards, nErBoS
Thanks nErBoS, I'll try it right away :-)
Hmm I can't get it to work...
I've added it as it is...just saved it as lua into the scriptfolder. Shouldn't the script override the hubsettings?
Also I get this message....
Syntax Error: attempt to compare number with string
hopefully a simple correction:
--Requested by 3lancer
--Made by nErBoS
Bot = "Share-Redirecter"
redshare1 = "1.1.1.1"
redshare2 = "1.1.1.2"
share1 = 5 --GB
share2 = 10 --GB
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user, data)
local s,e,share = strfind(user.sMyInfoString, "$MyINFO $ALL [^$]+$ $[^$]*$[^$]*$([^$]+)")
share = share / (1024*1024*1024)
if(tonumber(share) > tonumber(share1) and tonumber(share) < share2) then
user:SendData("$ForceMove "..redshare1.."|")
elseif(tonumber(share) >= tonumber(share2)) then
user:SendData("$ForceMove "..redshare2.."|")
else
end
end
hope this solves your prob.
/NL
Hi,
Thanks Litch forgot that complety :P
Best regards, nErBoS
Hi,
To also evitated the nil error..
--Requested by 3lancer
--Made by nErBoS
--Corrected by NightLitch
Bot = "Share-Redirecter"
redshare1 = "1.1.1.1"
redshare2 = "1.1.1.2"
share1 = 5 --GB
share2 = 10 --GB
function Main()
frmHub:RegBot(Bot)
end
function NewUserConnected(user, data)
local s,e,share = strfind(user.sMyInfoString, "$MyINFO $ALL [^$]+$ $[^$]*$[^$]*$([^$]+)")
share = share / (1024*1024*1024)
if(tonumber(share) ~= nil) then
if(tonumber(share) > tonumber(share1) and tonumber(share) < share2) then
user:SendData("$ForceMove "..redshare1.."|")
elseif(tonumber(share) >= tonumber(share2)) then
user:SendData("$ForceMove "..redshare2.."|")
else
end
else
end
end
Best regards, nErBoS
Wicked...thanks m8:s