ok im planning to make a script wich does this:
1. check how many users are in this hub
2. more then 30? redirect all others till there 30
3. more then 30 pick a user check if he is in RegisteredUsers.dat not ok check this "database"
1GB{
jan
piet
}
2GB{
dirk
pietje
}
something like those 2
next step check his share is it 3GB then random redirect a user to jan, piet, dirk, pietje (adresses.)
is its share less then 1GB redirect to jan or piet randomly..
this is what it should do,
but i havent got a clue on how to get started...
hope you can give me some hints im checking the rest of the forums for clues about my new script =-)
ok i guess this isn't gonna work no replys at all....
ive got this part of script from [UK]madman
Quote
-- By [UK]Madman
-- References - Lua Language Board
var = {["bot"] = "RegToStayBot", ["time"] = 10, ["command"] = "?notreg"}, --time is in mins before redirect
times = {},
hubs = { hubaddress1, hubaddress2} -- list of possible hubs
function Main()
frmHub:RegBot(var.bot)
SetTimer(60000*(tonumber(var.time)/4))
StartTimer()
end
function NewUserConnected(Curuser)
if Curuser.iProfile == -1 then
times[Curuser.sName] = var.time
Curuser:SendData (var.bot, "You have to register to stay in this hub, you currently have: "..var.time.." mins to register!")
end
end
function UserDisconnected (Curuser)
times[Curuser.sName] = Nil
end
function OnTimer()
for key, value in times do
value = value - (var.time/4)
times[key] = value
if value == 0 then tokick = GetItemByName(key)
times[tokick] = nil
tokick:SendData (var.bot, "You did not register, so are now being redirected!")
tohub = random(getn(hubs))
tokick:SendData("$ForceMove "..hubs[tohub])
elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
towarn:SendData (var.bot, "You have not registered, you will be redirected in: "..value.." mins unless you register!")
end
end
function DataArrival(Curuser,data)
data = strsub(data, 1, strlen(data)-1)
if strsub(data, 1, 1) == "<" then
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if cmd == var.command and Curuser.bOperator then
Curuser:SendPM (var.bot, "The following users are currently not regged:")
for key, value in times do
Curuser:SendPM (var.bot, key.." Has approx "..value.." mins till being redirected!")
end
return 1
end
end
end
but it gives an error at line 5 something with "=" is wrong..
but i want to get rid of the timer function cause i dont want them to register yust get them out of my hub to some other hubs ....
next problem is when i redirect to one of my hubs johan-hub.no-ip.info:666
it gives an error by the 666 (port number) so that isn't gonna work .....
ok if that really is a problem ill fix it ... antoher way but first i want this to work and im trying and trying.... but i demolished mine so now im trying again to make it work with timer function...
Fixed above in other thread , ill try and add share size wen i get a min :o)