Mutor,
I'm wondering....
Can you rebuilt this script for Ptokax Latest Version.
I have discovered you had the script with Share Restrict 1.0 LUA 5.1 [Strict] but it's incompatible with the version right now.
I'm really appreciate it.
This is your code previously.
--[[
Share Restrict 1.0 LUA 5.1 [Strict]
By Mutor 08/03/07
Requested by sphinx_spb
Restricts downloads and searches by share amount.
- Separate minimum share limits for xfer & search
- Returns fraudulent search result for blocked users
- Exclude block by profile and or nick
- Option to tempban for > preset attempt count
]]
-- A name for the bot
local Bot = frmHub:GetHubBotName()
-- Minimum share required to transfer files
local XferMin = 5
-- Minimum share required to search the hub
local SearchMin = 8
-- Max transfer attempts before user is disconnected [0 = disable]
local MaxTry = 0
-- Exclude by Nicks
local Exclude = {
["zMutor"] = 1,
["OtherNick"] = 1,
}
-- Exlude by profiles
-- [#] = 0/1, (0 = Exlude profile from block, 1 = Block this profiles transfer/search)
local Profiles = {
[-1] = 1, -- Unregistered User
[0] = 1, -- Master
[1] = 1, -- Operator
[2] = 0, -- VIP
[3] = 1, -- Registered User
[4] = 0, -- Moderator
[5] = 0, -- NetFounder
[6] = 0, --Owner
}
local Nicks = {}
Main = function()
XferMin,SearchMin = (XferMin * (1024^3)),(SearchMin * (1024^3))
end
ConnectToMeArrival = function(user, data)
if not Exclude[user.sName] then
if not Profiles[user.iProfile] or Profiles[user.iProfile] == 1 then
local s = ""
if MaxTry > 0 then
if not Nicks[user.sName:lower()] then
Nicks[user.sName:lower()] = 1
else
Nicks[user.sName:lower()] = Nicks[user.sName:lower()] + 1
end
s = "("..Nicks[user.sName:lower()].." / ".. MaxTry..")"
if Nicks[user.sName:lower()] > MaxTry then
Nicks[user.sName:lower()] = nil
return user:SendData(Bot,"You failed to heed "..MaxTry.." warnings "..
"about attempting transfers. you will now be disconnected from the hub."),
user:TempBan(0, "Continued attempted transfer "..MaxTry.."x",Bot,0),1
end
end
if user.iShareSize < XferMin or not user.bConnected then
return user:SendData(Bot,"Sorry "..user.sName..", "..frmHub:GetHubName().." requires "..
"you to share "..FmtSz(XferMin).." to enable file transfers."),
user:SendData(Bot,"Your share of "..FmtSz(user.iShareSize).." is "..
FmtSz(XferMin - user.iShareSize).." short of the limit."),
user:SendData(Bot,"Please remove the transfer from your download queue "..
"or you will be disconnected from the hub. "..s),1
end
end
end
end
RevConnectToMeArrival = ConnectToMeArrival
SearchArrival = function (user, data)
if not Exclude[user.sName] then
if not Profiles[user.iProfile] or Profiles[user.iProfile] == 1 then
if user.iShareSize < SearchMin or not user.bConnected then
local hn,ip,pt = frmHub:GetHubName(),frmHub:GetHubIp(),frmHub:GetHubUdpPort()
local s,e,search = string.find(data,"([^?]+)|$")
search = search or "Invalid String"
local res = "Unknown Path"..string.char(92)..user.sName..", search is "..
"disabled for you :P "..string.rep("\t",75)..search
user:SendData("$SR "..frmHub:GetHubBotName().." "..res..
" 0 0/0"..hn.." ("..ip..":"..pt..")")
user:SendData(Bot,"Sorry "..user.sName..", "..frmHub:GetHubName().." requires "..
"you to share "..FmtSz(SearchMin).." to enable searching.")
user:SendData(Bot,"Your share of "..FmtSz(user.iShareSize).." is "..
FmtSz(SearchMin - user.iShareSize).." short of the limit.")
return 1
end
end
end
end
FmtSz = function(int)
local i,u,x=tonumber(int) or 0,{"","K","M","G","T","P"},1
while i > 1024 do i,x = i/1024,x+1 end return string.format("%.2f %sB.",i,u[x])
end
My Best Regards,
SKy
Thank you very much :D