Leech Bot, Lua5 (thread: http://forum.ptokax.org/index.php?topic=4034.0) <- closed thread
hi@all, good work, a very meaningful script! but it shows me a small error on line 62:
LeechBot-by.jiten.lua:62: attempt to index a nil value ???
all my efforts to eliminate this error failed ::)
Hubsoft: 0.3.5.1 LUA5
Hi
i have the same problem, same hubsoft and no solution too...
Line 62 is user:SendData(sBot,"*** Error: You are not authorized to download from "..nick..".")
I don't see any error-source.
oh sry, i've forgotten i have 2 profiles more ::)
the error are on line 60
K, the problem must be that the CTM goes to an offline user somehow. Try to replace the CTMArrival to this:
CTMArrival = function(user,data)
local usr=GetItemByName(nick); if not usr then return end
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)
-- (user is blocked and can't download? OR user's profile can download from nick's? OR nick is blocked and can't upload?) AND (can immune user download from blocked nick?)
if (tBlocked[string.lower(user.sName)] or tIdxBlocked[user.iProfile][usr.iProfile] == 1 or tBlocked[string.lower(nick)]) then
if not (tImmune[string.lower(usr.sName)] and tImmune[string.lower(usr.sName)][string.lower(user.sName)]) then
user:SendData(sBot,"*** Error: You are not authorized to download from "..nick..".")
return 1
end
end
end
perfect! good job, big thx bastya :)