Please help convert to lua 5
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Please help convert to lua 5

Started by Op, 09 April, 2006, 15:04:16

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Op

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

jiten

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

Quote from: jiten 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".


Please blocker download user to OP

jiten

Give this a try:

--[[

	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

#5
Quote from: jiten on 09 April, 2006, 15:36:24
Give this a try:

--[[

	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



Thor

It also block all CTM included OPs and masters, so nobody can download from OPs, nor the other OPs.

SMF spam blocked by CleanTalk