PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: dvxjunkie on 20 October, 2003, 06:51:25

Title: MinMaxSlotsMaxHubsRedirect
Post by: dvxjunkie on 20 October, 2003, 06:51:25
to use this you need to turn off ptokax built in  slot and hub settings first.

-- DC++ Max slots LUA script by aMutex, redirect code also by amutex from another script. hubs and slots added by dvxjunkie
--04.02.2003
minslots = 2
maxslots = 10
maxhubs = 10
addy = "YourRedirectAddyHere"
function NewUserConnected(curUser)
if strfind(curUser.sMyInfoString,"<++") then    
_,b, dcver = strfind(curUser.sMyInfoString,"V:(%w.%w+)")    
_,b, mode = strfind(curUser.sMyInfoString,"M:([AP])",b)    
_,b, hubs = strfind(curUser.sMyInfoString,"H:(%d+)",b)    
_,b, slots = strfind(curUser.sMyInfoString,"S:(%d+)",b)

if (tonumber(slots)curUser:SendPM("RedirectBot", "minimum slot violation. Redirecting... |$ForceMove "..addy.."|")
  else
if (tonumber(slots)>tonumber(maxslots)) then
curUser:SendPM("RedirectBot", "maximum slot violation. Redirecting... |$ForceMove "..addy.."|")     else

if (tonumber(hubs)>tonumber(maxhubs)) then
curUser:SendPM("RedirectBot", "maximum hub violation. Redirecting... |$ForceMove "..addy.."|")

end
end
end
end
end
Title:
Post by: Skrollster on 20 October, 2003, 08:16:41
soon there will be no need for this script :P



px 0.3.3.0 (http://skrollan.myftp.org/ptokax_0.3.3(1).png)
Title:
Post by: dvxjunkie on 25 October, 2003, 12:34:18
thats goos news how soon?