I know this is an odd script, but I need a script to :
Check users when they connect, and if they are registered users, skip the check, but if they are guests etc, to check if they are sharing, if so, kick them with a message.
If they're not sharing, leave them alone.
If anyone could throw that together, that'd be great.
Regards,
Zeb
Here you go....
Hope I understand you right....
------------------------------------------------
-- Tiny Share Check Bot
-- By NightLitch
-- This Script Checks all NON REGGED USERS...
-- Set Desire MINIMUM Share on Wanted Share
-- what NON REGGED should share...
------------------------------------------------
kb = 1024
mb = kb*kb
gb = kb*kb*kb
Bot = "TinyBot"
WantedShare = 6 *gb
KickMessage = "\t\t\twarning\r\n\tYOU ARE NOT A REGISTERED USER OF THIS HUB\r\n\t"..
"you are not sharing "..WantedShare/gb.." GB, You are being disconnected..."
function DataArrival (curUser, data)
if (strsub(data,1,7) == "$MyINFO") and curUser.bOperator == nil then
s,e, vShare = strfind(data,"$+(%d+)$+|+")
if vShare ~= nil then
if curUser.iProfile == -1 then
if (tonumber(vShare) < WantedShare) then
curUser:SendData(Bot, KickMessage)
curUser:Disconnect()
end
end
end
end
end
/NightLitch
Thanks a lot for posting, but if I read the script correctly, you did not quite understand me correctly.
What I was after, was :
Registered users are ignored by the script,
Unregistered users, if they are sharing >0 bytes, are kicked with the message :-)
The script if for a public hub at a large lan event, and we want people to be able to access data from the organisers, but not to be able to share themselves :-)
I know it's an odd way of doing things ;-)
But.. If I change the line :
if (tonumber(vShare) < WantedShare) then
to
if (tonumber(vShare) > WantedShare) then
and set the wanted share as 0, it should do what I want?
Thanks
Zeb
Tested :-)
Works a treat, thanks
Zeb