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
plz make [ C O D E] [ / C O D E] and make that line is error color so it easy to see
Sorry mate.. didn t know how to do that.. tx. hope its clear now.
what is the line 37 ???
[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.
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
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
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
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
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