hmm this is an Anti Open Hub Standalone Script but i get this
Syntax error: attempt to index global `user' (a nil value)
stack traceback:
1: function `DataArrival' at line 2 [file `C:\hub\PtoKaX_new\scripts\antiopenhub.lua']
I'm using this
function DataArrival( sUser , sData )
if strsub( sData , 1 , 7 ) == "$MyINFO" and user.sName ~= "bobby" then
local _,_,openhubs = strfind( data , ".+H:(%d+)" );
if ( openhubs ~= "0" ) then
SendToNick( user.sName , "Du bist in einen oder mehreren Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung zur?ckgesetzt!")
user:Disconnect()
end
end
end
Infact it is in three points ... or one :) any how u see it it is noted below ( both ways :)function DataArrival( sUser , sData )
if strsub( sData , 1 , 7 ) == "$MyINFO" and [b]sUser[/b].sName ~= "bobby" then
local _,_,openhubs = strfind( data , ".+H:(%d+)" );
if ( openhubs ~= "0" ) then
SendToNick( [b]sUser[/b].sName , "Du bist in einen oder mehreren Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung zur?ckgesetzt!")
[b]sUser[/b]:Disconnect()
end
end
end
and the second is .. function DataArrival( [b]user[/b] , sData )
if strsub( sData , 1 , 7 ) == "$MyINFO" and user.sName ~= "bobby" then
local _,_,openhubs = strfind( data , ".+H:(%d+)" );
if ( openhubs ~= "0" ) then
SendToNick( user.sName , "Du bist in einen oder mehreren Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung zur?ckgesetzt!")
user:Disconnect()
end
end
end
this is the first error to check if u are copy/paste'ing,...
just keep it in mind :)
thnx herodes, i had it hooked up in Black_Pearl and couldn't find the original anymore lol.
hmm but it doesnt kick Users that r in Open Hubs :(
check what u get from the strfind ...
local s,e,openhubs = strfind(data, ",H:(%d+)")
SendToAll("User :"..user.sName.." is in "..openhubs.." open hubs ")
hmm funny, cause in Black_Pearl it worked fine the way i had it....
but as Standalone i had to change _,_,openhubs to s,e,openhubs
but how come it works one way in a bot and stand alone not? This i dont understand
from what I know using .. s,s,somevar = strfind(...) is the same with _,_,somevar = strfind(...) I always go with s,e any ways ...
but that should be a question for someone who really knows the languages inner-working :)
hmm well, maybe someone will tell me why its so *g*
guess i'll just have to wait