PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: [G-T-E]Gate? on 07 May, 2004, 19:48:32

Title: DownloadBlocker Help PLezz
Post by: [G-T-E]Gate? on 07 May, 2004, 19:48:32
Iam running this script along with RoboCop 7:a to stop users from downloading from ops if they are not registered VIPs.
All of a sudden I noticed that a users managed to connect and take.
Can someone pleezz check the script out.
I want it  to now apply a block on not only OP but VIP and Master aswell plus the possibility to turn off the block on each profile(Master,Op,VIP) when I wish by using a command such as
M1=on M0=off
O1=on O0=off
V1=on V0=off

Thanks for all the help so far, been with Lua pretty long and support all ur work and sweat, well done !!!
---------------------------------------------------------------------------
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("*** You must get registered to be able to download from an OP or Admin, contact an Operator or [G-T-E]:I:N:F:O:R:C:E:R:? to get Registered")
         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("*** You must get registered to be able to download from an OP or Admin, contact an Operator or [G-T-E]:I:N:F:O:R:C:E:R:? to get Registered")
         return 1
      end
   end
end
--------------------------------------------------------------------------
Title: Pleezzzz I need help on this one
Post by: [G-T-E]Gate? on 07 May, 2004, 22:53:57
Pleezzzz I need help on the thread I posted above .
Title:
Post by: [NL]Pur on 07 May, 2004, 23:15:12
 
-- Fixed for [G-T-E]Gate? by Pur 7 may 04


function Main()
frmHub:EnableFullData(1)

Levels = {
Master = "1",
Operator = "0",
VIP = "0",
Reg = "0",
Default = "0"
}

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 isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
curUser:SendData("*** This profile is protected")
end

return 1

elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then
local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")

if isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
curUser:SendData("*** This profile is protected")
end

return 1
end

end


function isEnabled(profile)
ret = "0"
if profile then
for i, v in Levels do
if ( i == profile ) then
ret = v
end
end
end
return ret
end
 
Title: Tks
Post by: [G-T-E]Gate? on 08 May, 2004, 09:37:35
Purrrr
Thanks loads for ur relpy and appreciate the time u put for assisting me. Will give it a go.
 Have a nice weekend.

G8
Title:
Post by: [NL]Pur on 08 May, 2004, 10:39:25
yw, if it doesn't work i hear from you again :)

i had some trouble passive active thing so couldn't test it properly
Title: Extra for DLB
Post by: [G-T-E]Gate? on 08 May, 2004, 11:08:09
Works like a charm "Grand Smile"

One thing, I have remote to my server, (Hub Software) so If I want to change from 1 to 0 on a profile then I have to remotely do it. Can u , if not to much trouble fix the script  so that I can just write a cmd in main chat (unseenable by others) to activate  or deactivaite the said proflie, ie.. M1=on M0=off , O1=on O0=off V1=on V0=off.

Thanks again
Title:
Post by: [NL]Pur on 08 May, 2004, 13:01:05


-- Fixed for [G-T-E]Gate? by Pur 7 may 04
-- Added some commands 8may 04 pur

function Main()
frmHub:EnableFullData(1)

Levels = {
Master = "0",
Operator = "0",
VIP = "0",
Reg = "0",
Default = "0"
}

end

function DataArrival(curUser, data)

ddata=strsub(data,1,strlen(data)-1)
_,_,cmd, arg = strfind(ddata,"%b<>%s+(%S+)%s+(%S+)")

if (curUser.bOperator) then
if (cmd=="!Master") then
if (arg=="on") then
Levels.Master = "1"
elseif (arg=="off") then
Levels.Master = "0"
end
end

if (cmd=="!Operator") then
if (arg=="on") then
Levels.Operator = "1"
elseif (arg=="off") then
Levels.Operator = "0"
end
end

if (cmd=="!VIP") then
if (arg=="on") then
Levels.VIP = "1"
elseif (arg=="off") then
Levels.VIP = "0"
end
end

if (cmd=="!Reg") then
if (arg=="on") then
Levels.Reg = "1"
elseif (arg=="off") then
Levels.Reg = "0"
end
end
end

if (strsub(data, 1, 15) == "$RevConnectToMe" and curUser.iProfile == -1) then
local _,_,towho = strfind(data, "$RevConnectToMe%s+%S+%s+(%S+)|")

if isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
curUser:SendData("*** This profile is protected")
end

return 1

elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then
local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")

if isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
curUser:SendData("*** This profile is protected")
end

return 1
end

end


function isEnabled(profile)
ret = "0"
if profile then
for i, v in Levels do
if ( i == profile ) then
ret = v
end
end
end
return ret
end
 


not tested

-pur
Title: Purr, Help!!
Post by: [G-T-E]Gate? on 12 May, 2004, 22:01:27
Seems that joy cant last to long ,
Receiving errors on the script I got made  from Purr, see below;

Any tips or better still, solutions Pleezzz
----------------------------------------------------------------------------
No syntax errors in script file RoboCopv7.0a.lua
No syntax errors in script file MessTimes.lua
No syntax errors in script file TexterBot.lua
No syntax errors in script file RightClicker v3.0.lua
No syntax errors in script file IP=Security.lua
No syntax errors in script file DwnldBlkByPur4G8.lua
Syntax error: attempt to index a nil value
stack traceback:
   1:  function `DataArrival' at line 20 [file `...kaX-0.330.TD4 RCv7\scripts\DwnldBlkByPur4G8.lua']

Syntax error: attempt to index a nil value
stack traceback:
   1:  function `DataArrival' at line 20 [file `...kaX-0.330.TD4 RCv7\scripts\DwnldBlkByPur4G8.lua']

Syntax error: attempt to index a nil value
stack traceback:
   1:  function `DataArrival' at line 29 [file `...kaX-0.330.TD4 RCv7\scripts\DwnldBlkByPur4G8.lua']

Syntax error: attempt to index a nil value
stack traceback:
   1:  function `DataArrival' at line 29 [file `...kaX-0.330.TD4 RCv7\scripts\DwnldBlkByPur4G8.lua']

Syntax error: attempt to index a nil value
stack traceback:
   1:  function `DataArrival' at line 20 [file `...kaX-0.330.TD4 RCv7\scripts\DwnldBlkByPur4G8.lua']

Syntax error: attempt to index a nil value
stack traceback:
   1:  function `DataArrival' at line 20 [file `...kaX-0.330.TD4 RCv7\scripts\DwnldBlkByPur4G8.lua']
----------------------------------------------------------------------------


Script is as follows;

-----------------------------------------------------------------------------
function Main()
    frmHub:EnableFullData(1)

    Levels = {
        Master = "1",
        Operator = "1",
        VIP = "0",
        Reg = "0",
        Default = "0"
    }

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 isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
            curUser:SendData("*** You must get registered to be able to download from Me contact an Operator or [G-T-E]:I:N:F:O:R:C:E:R:? to get Registered")    
        end

        return 1

    elseif (strsub(data, 1, 12) == "$ConnectToMe" and curUser.iProfile == -1) then
        local _,_,towho = strfind(data, "$ConnectToMe%s+(%S+)%s+.*|")
       
        if isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
            curUser:SendData("*** You must get registered to be able to download from Me contact an Operator or [G-T-E]:I:N:F:O:R:C:E:R:? to get Registered")    
        end

        return 1
    end

end


function isEnabled(profile)
    ret = "0"
    if profile then
        for i, v in Levels do        
            if ( i == profile ) then
                ret = v
            end
        end
    end
    return ret
end
----------------------------------------------------------------------------
Title:
Post by: [G-T-E]Gate? on 13 May, 2004, 09:22:33
Here's some more info to assisst solutioner on my problem ;

[G-T-E]:I:N:F:O:R:C:E:R:? has Profile as Master ,
It seems that after a while (1hr or so ) I notice that users manage to get a slot off of me even though the script is activated.

Profile.dat TD4

0|Master|11111111111111111111111000000001
1|Operator|11111100011001111111111000000001
2|VIP|10000000000001111000000000000000
3|Reg|10000000000000000000000000000000
-----------------------------------------------------------------------------
Title:
Post by: Janhouse on 13 May, 2004, 20:10:06
What does that right clicker script do?
I saw that in your message.

QuoteNo syntax errors in script file RightClicker v3.0.lua

So can you give me that script?
Title:
Post by: [G-T-E]Gate? on 14 May, 2004, 11:25:50
Anyone  can do a check on the script problem mentioned above,
 Iam haveing to reastart the scripts every 45 minutes.
 Thanks in Advance

Gate
Title:
Post by: [G-T-E]Gate? on 14 May, 2004, 22:42:59
Still Looking for a solution on mentioned script above,
Title:
Post by: [NL]Pur on 15 May, 2004, 20:02:20
is the userstats of ptokax activated ?
Title:
Post by: [G-T-E]Gate? on 16 May, 2004, 00:47:27
No the userstats of ptokax is not activated ..