PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: gazzer on 13 April, 2004, 22:24:52

Title: HIDDEN SCRIPT
Post by: gazzer on 13 April, 2004, 22:24:52
hi lua guys, anyone have or could please make me a hidden script so hubowner is hidden in hub please.
thanks in advance gazzer
Title:
Post by: Flux on 13 April, 2004, 22:33:44
I would like to see what will be developed for that. Also do u want to still download off others and them download off you while ypou are invisible hehehe...
Title:
Post by: nErBoS on 13 April, 2004, 23:34:27
Hi,

Thank to plop for explanions
Hope it helps..

--Requested by gazzer
--Made by nErBoS

sBot = "Hider"

hide = {}

function Main()
frmHub:RegBot(sBot)
end

function DataArrival(user, data)
frmHub:EnableFullData(1)
if (strsub(data,1,12) == "$GetNickList") then
for aux, usr in GetUsersByProfile("Master") do
if (GetItemByName(usr) ~= nil and hide[usr] == 1) then
frmHub:UnregBot(usr)
end
end
frmHub:EnableFullData(0)
end
if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd=="!hide" and user.iProfile == 0) then
frmHub:UnregBot(user.sName)
hide[user.sName] = 1
return 1
elseif(cmd=="!unhide" and user.iProfile == 0) then
user:SendData(user.sMyInfoString)
hide[user.sName] = nil
return 1
end
end
end

Just a minor problem when the op use the !unhide it will appear as a user, just recoonect and it will solve that.

Best regards, nErBoS
Title:
Post by: nErBoS on 13 April, 2004, 23:46:04
Hi,

A more effective one...

--Requested by gazzer
--Made by nErBoS

sBot = "Hider"

hide = {}

function Main()
frmHub:RegBot(sBot)
end

function OpDisconnected(user, data)
frmHub:UnregBot(user.sName)
end

function DataArrival(user, data)
frmHub:EnableFullData(1)
if (strsub(data,1,12) == "$GetNickList") then
for aux, usr in GetUsersByProfile("Master") do
if (GetItemByName(usr) ~= nil and hide[usr] == 1) then
frmHub:UnregBot(usr)
hide[usr] = 1
end
end
end
if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd=="!hide" and user.iProfile == 0) then
frmHub:UnregBot(user.sName)
hide[user.sName] = 1
return 1
elseif(cmd=="!unhide" and user.iProfile == 0) then
frmHub:RegBot(user.sName)
hide[user.sName] = nil
return 1
end
end
end

Best regards, nErBoS
Title:
Post by: pHaTTy on 14 April, 2004, 01:11:36
well heres one i wrote earlier if ya get a nick taken error later on try this one ;-)


--Lance Evol v1.00
--Hider Bot, this one does not give the nick taken error ;)
--Written by Phatty 12th December 2k3

Bot = "?????R"
Hidden = {}

function NewUserConnected(user)
if Hidden == nil then
return 1
else
for i,v in Hidden do
user:SendData( "$Quit "..i )
end
end
end

function OpConnected(user)
if Hidden == nil then
return 1
else
for i,v in Hidden do
user:SendData( "$Quit "..i )
end
end
end

function DataArrival(user, data)
if(strsub(data, 1, 5) == "$Quit") then
if Hidden[user.sName] == 1 then
Hidden[user.sName] = nil
end
end

if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")

if cmd == "hide" then
if user.bOperator then
SendToAll( "$Quit "..user.sName )
Hidden[user.sName] = 1
end
elseif cmd == "unhide" then
if user.bOperator then
SendToAll( "$Hello "..user.sName )
Hidden[user.sName] = nil
end
end
end
end


later,,
Title:
Post by: tezlo on 14 April, 2004, 01:29:27
looks familiar..
btw this can never equal
if strsub(data, 1, 4) == "$Quit " then
Title:
Post by: nErBoS on 14 April, 2004, 01:35:19
Hi,

It should give the given nick because of this...

function OpDisconnected(user, data)
   frmHub:UnregBot(user.sName)
end

i think :P

Best regards, nErBoS
Title:
Post by: pHaTTy on 14 April, 2004, 03:05:18
QuoteOriginally posted by tezlo
looks familiar..
btw this can never equal
if strsub(data, 1, 4) == "$Quit " then

lol well yea i realised b4 shud be 6, but as it skips n checks the 4 first out of 6 is still works n catchs correct data, so not much differ just change to 6, or remove end space n nock to 5, dont really matter ;-)
Title:
Post by: pHaTTy on 14 April, 2004, 03:06:23
QuoteOriginally posted by nErBoS
Hi,

It should give the given nick because of this...

function OpDisconnected(user, data)
   frmHub:UnregBot(user.sName)
end

i think :P

Best regards, nErBoS

hmm u cud be right im not sure, but remove ,data ;-)
Title:
Post by: tezlo on 14 April, 2004, 03:39:46
Quotebut as it skips n checks the 4 first out of 6 is still works n catchs correct data
no it doesnt.. the interpreter isn't psychic

whereas NewUserConnected(the_cook, the_thief, his_wife, her_lover) works just fine
Title:
Post by: pHaTTy on 14 April, 2004, 10:43:20
QuoteOriginally posted by tezlo
Quotebut as it skips n checks the 4 first out of 6 is still works n catchs correct data
no it doesnt.. the interpreter isn't psychic

whereas NewUserConnected(the_cook, the_thief, his_wife, her_lover) works just fine

yep sorry ur right, ive been getting carried away with cpp n forgetting strsub not like strfind....
Title:
Post by: pHaTTy on 14 April, 2004, 10:51:52
there ya go

--Lance Evol v1.01
--Hider Bot, this one does not give the nick taken error ;)
--Written by Phatty 12th December 2k3
--little update today ehmm today issss 14th april 2k4

Bot = "?????R" ;
Hidden = {}

function NewUserConnected(user)
if Hidden == nil then
return 1; else
for i,v in Hidden do
user:SendData( "$Quit "..i ) ;
end;
end;
end;

OpConnected = NewUserConnected

function DataArrival(user, data)
if(strsub(data, 1, 5) == "$Quit") then
if Hidden[user.sName] == 1 then
Hidden[user.sName] = nil;
end
elseif strsub(data, 1, 1) == "<" then
local data=strsub(data,1,strlen(data)-1)
local s,e,cmd = strfind(data,"%b<>%s+(%S+)")

if cmd == "$hide" and user.bOperator then
SendToAll( "$Quit "..user.sName )
Hidden[user.sName] = 1;
elseif cmd == "$unhide" and user.bOperator then
SendToAll( "$Hello "..user.sName )
Hidden[user.sName] = nil;
end;
end;
end;


right away for break;