line errors in script
 

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

line errors in script

Started by kazi, 20 October, 2004, 21:55:24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kazi

function Main() 
    frmHub:EnableFullData(1) 

    Levels = {
        Master = "1",
        Operator = "1",
        VIP = "1",
        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 so contact an OP 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 so contact an OP 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

**Trying to get this script working in ptokax 0.3.3.0 but i get all kinda line erros , need this script to be modified for ptokax 0330?


**errormessage: Syntax error: `end' expected (to close `function' at line 37);
  last token read: `' at line 45 in string "function Main()
 ..."

thanx in advance

Themaster

#1
plz make [ C O D E] [ / C O D E] and make that line is error color so it easy to see
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

kazi

Sorry mate.. didn t know how to do that.. tx. hope its clear now.

Themaster

what is the line 37 ???
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

kazi

[COLOR=green]end [/COLOR]  


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

I think its the "green" end  I think the script sees it as end of all functions? but a new function is started underneith.

Psycho_Chihuahua

perhaps this works, have NOT tested

function Main() 
    frmHub:EnableFullData(1) 
    Levels = {Master = "1",Operator = "1",VIP = "1",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 so contact an OP 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 so contact an OP 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
end
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Themaster

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

try this
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

kazi

#7
many thanx Psycho_Chihuahua

the script is accepted by hubsoftware, the only thing is non regged users who try to dl form vip, op  or master  dont get the message :(

this error is see in ptokax now

stack traceback:
   1:  function `DataArrival' at line 14 [file `...iles\Ptokax 0.330

Psycho_Chihuahua

try changing
if isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="1" then
to
if isEnabled(GetProfileName(GetItemByName(towho).iProfile))=="-1" then

not sure if oit's correct thoug, just a wild guess  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

kazi

ok, have done that, the error message is not appearing anymore.

ok what happens now  is this:

if users are not regged  they cant dl nothing  not even filelists of anyone,  they get from everyone  con
nection timeout.   as soon as they enter the hub as a reg user  they can dl everything of everybody.

there are two things in my opinion that is not good:

1) they dont get the message
2) they should be able to download filelists from other NON regged users.  but as far as I can see now  all connections are blocked.

at the bottom at this script  it says

function isEnabled(profile)
    ret = "0"
    if profile then
        for i, v in Levels do        
            if ( i == profile ) then
                ret = v
            end
        end
end
end
   the ret = "0"     what does that mean?  

thanks again

SMF spam blocked by CleanTalk