Author Topic: blocker script  (Read 2174 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.T

  • Member
  • ***
  • Posts: 48
  • Karma: +7/-2
blocker script
« on: 15 April, 2009, 13:05:07 »
anybody that can convert this to new api
Code: [Select]
cmdBlock = "!block"
cmdUBlock = "!unblock"


tBlocked = {}
tCanCommand = {
[-1] = 0,
[0] = 1,
[1] = 1,
[2] = 0,
[3] = 0,
[4] = 0,
[5] = 1,
}

NewUserConnected = function(User)
if tCanCommand[User.iProfile] == 1 then
User:SendData("$UserCommand 1 3 Block user' Downloads$<%[mynick]> "..cmdBlock.." %[nick]&#124;|")
User:SendData("$UserCommand 1 3 Unblock user' Downloads$<%[mynick]> "..cmdUBlock.." %[nick]&#124;|")

end
end
OpConnected = NewUserConnected


ConnectToMeArrival = function(User,Data)
if tBlocked[User.sName] ~= nil then return 1 end
end
RevConnectToMeArrival = ConnectToMeArrival
MultiConnectToMeArrival = ConnectToMeArrival

ChatArrival = function(User,Data)
local _,_,sCmd,sArgs = string.find(Data, "%b<>%s(%S+)%s+(%S+)|")
if sCmd == cmdBlock and tCanCommand[User.iProfile] == 1 then
tBlocked[sArgs] = 1
SendToAll(frmHub:GetHubBotName(), "The nickname "..sArgs.." is now blocked from downloading in this hub")
return 1
elseif sCmd == cmdUBlock and tCanCommand[User.iProfile] == 1 then
if tBlocked[sArgs] ~= nil then
tBlocked[sArgs] = nil
SendToAll(frmHub:GetHubBotName(), "The nickname "..sArgs.." is no longer blocked and can download again")
else
User:SendPM(frmHub:GetHubBotName(), "That nickname ( "..sArgs.." ) wasn't blocked")
end
return 1
end
end
« Last Edit: 16 April, 2009, 23:31:58 by Mutor »

PtokaX forum

blocker script
« on: 15 April, 2009, 13:05:07 »

Offline ?StIfFLEr??

  • Triple Ace
  • **
  • Posts: 241
  • Karma: +17/-63
Re: blocker script
« Reply #1 on: 24 April, 2009, 11:01:18 »
I think this script is with similar function is already on forums...
try searching there if u really need it...

PtokaX forum

Re: blocker script
« Reply #1 on: 24 April, 2009, 11:01:18 »