PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: [KATZ]ice on 12 April, 2005, 20:01:32

Title: redirect array
Post by: [KATZ]ice on 12 April, 2005, 20:01:32
yeah, i know, there are already scripts for this.

but i want it plain and easy, no pinging or whatever

just, user join, gets send to a hub
next user joins gets send to the next
and so on, then as a finish, just the process all over again

ok, that'z the easy part i guess

before sending a user to a hub, it first get checked if it has enough share for that hub (this sould be ajustable in the script) if he/she doesn't he/she will get send to a hub, which is standard for those problems

Cheers ICE
Title:
Post by: [KATZ]ice on 18 April, 2005, 23:26:01
hmm, ok, i tried a bunch of scripts, tried to edit it, result: World disaster..., PLZ HELP :P

Cheers IE
Title:
Post by: jiten on 19 April, 2005, 15:43:47
Try this one:
-- Requested by 3lancer and converted to Lua 5 by jiten
-- Made by nErBoS
-- Corrected by NightLitch
-- added endless amount of hubs by plop
-- modded for setting user levels to be redirected by bastya_elvtars (nice crew in here)
-- CheckUserLevel originally by Nathanos
-- CheckUserLevel eliminated by plop

Bot = "Share-Redirecter"

-- biggest hub 1st, share size in GB
tHubs = {
{ ["share"] = 10,  ["domain"] = "hub1.no-ip.com", ["name"] = "Our 10GB MinShare Hub" },
{ ["share"] = 5, ["domain"] = "hub2.no-ip.com", ["name"] = "Our 5GB MinShare Hub" }
}

function Main()
frmHub:RegBot(Bot)
end

function NewUserConnected(user, data)
share = user.iShareSize
if(tonumber(share)) then
share = tonumber(share) / (1024*1024*1024)
for i=1,table.getn(tHubs) do
if share > tHubs[i]["share"] then
user:Redirect(tHubs[i]["domain"], tHubs[i]["name"])
end
end
end
end

Best regards,

jiten
Title:
Post by: [KATZ]ice on 19 April, 2005, 17:14:09
it comes close, but it's not what i want, if i have 30 GB, i'll always get redirected to hub 1, but i want it to be redirected to the other hubs as well, so the target hub needs to change every time some one joins, but when i have 7 GB, it does change as well, but just not to the first hub....

This is to prevent me from joining a hub, which i can't enter anyways

Thx

Cheers ICE