Author Topic: Please help convert to lua 5  (Read 3463 times)

0 Members and 1 Guest are viewing this topic.

Op

  • Guest
Please help convert to lua 5
« on: 09 April, 2006, 15:04:16 »
function Main()
frmHub:EnableFullData(1)
end

function DataArrival(curUser, data)
if (strsub(data, 1, 15) == "$RevConnectToMe" and curUser.iProfile == -1) then
local _,_,towho = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")
if GetItemByName(towho) and GetItemByName(towho).bOperator then
curUser:SendData("*** Tienes que estar registrado para descargar de un OP/You must get registered to be able to download from an OP")
return 1
end
elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then
local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
if GetItemByName(towho) and GetItemByName(towho).bOperator then
curUser:SendData("*** Tienes que estar registrado para descargar de un OP/You must get registered to be able to download from an OP")
return 1
end
end
end
« Last Edit: 09 April, 2006, 15:10:13 by Op »

PtokaX forum

Please help convert to lua 5
« on: 09 April, 2006, 15:04:16 »

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 577
  • Karma: +71/-5
Re: Please convert to lua 5
« Reply #1 on: 09 April, 2006, 15:09:56 »
There are several scripts already converted to LUA 5.0/5.1 that support this.

Search the forum for: "Leech block" or "Leech Bot".

Op

  • Guest
Re: Please convert to lua 5
« Reply #2 on: 09 April, 2006, 15:13:46 »
There are several scripts already converted to LUA 5.0/5.1 that support this.

Search the forum for: "Leech block" or "Leech Bot".


Please blocker download user to OP

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 577
  • Karma: +71/-5
Re: Please help convert to lua 5
« Reply #3 on: 09 April, 2006, 15:36:24 »
Give this a try:

Code: [Select]
--[[

Operator Download Blocker - LUA 5.0/5.1 by jiten (4/9/2006)

]]--

CTMArrival = function(user,data)
local sFind
if string.sub(data,1,4) == "$Rev" then sFind = "(%S+)|$" elseif string.sub(data,1,4) == "$Con" then sFind = "%S+%s+(%S+)" end
local s,e,nick = string.find(data,sFind)
local nick = GetItemByName(nick)
if nick and nick.bOperator then
return user:SendData(frmHub:GetHubBotName(),"*** Error: You are not authorized to download from an Operator!"), 1
end
end

ConnectToMeArrival = CTMArrival
RevConnectToMeArrival = CTMArrival

Op

  • Guest
Re: Please help convert to lua 5
« Reply #4 on: 09 April, 2006, 16:08:10 »
thank you  ;D

Op

  • Guest
Re: Download blocker of master to OP
« Reply #5 on: 09 April, 2006, 16:42:12 »
Give this a try:

Code: [Select]
--[[

Operator Download Blocker - LUA 5.0/5.1 by jiten (4/9/2006)

]]--

CTMArrival = function(user,data)
local sFind
if string.sub(data,1,4) == "$Rev" then sFind = "(%S+)|$" elseif string.sub(data,1,4) == "$Con" then sFind = "%S+%s+(%S+)" end
local s,e,nick = string.find(data,sFind)
local nick = GetItemByName(nick)
if nick and nick.bOperator then
return user:SendData(frmHub:GetHubBotName(),"*** Error: You are not authorized to download from an Operator!"), 1
end
end

ConnectToMeArrival = CTMArrival
RevConnectToMeArrival = CTMArrival

Download blocker user to OP, yes

Download blocker of master to OP, of OP to OP :(

Please help


« Last Edit: 09 April, 2006, 17:06:45 by Op »

Offline Thor

  • Scripter
  • Lord
  • ******
  • Posts: 290
  • Karma: +45/-5
    • Hungarian Direct Connect Site
Re: Please help convert to lua 5
« Reply #6 on: 09 April, 2006, 16:53:20 »
It also block all CTM included OPs and masters, so nobody can download from OPs, nor the other OPs.

PtokaX forum

Re: Please help convert to lua 5
« Reply #6 on: 09 April, 2006, 16:53:20 »