PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Jaakko on 09 May, 2005, 20:55:00

Title: Hide user.
Post by: Jaakko on 09 May, 2005, 20:55:00
Is it possible to make a script that can hide someone in the hub so that he won't show in then nicklist.
I'm using DCDM++ as a bot for cleaning at my hub, but it would be better if my alter ego wouldn't show for ordinary users.
Title:
Post by: PPK on 09 May, 2005, 21:44:27
Is easy, SendToAll("$Quit nick") on hide and curUser:SendData("$Quit nick") to new users on login :)) Btw if user is not in userlist then most clients not allow upload to this user  :rolleyes:
Title:
Post by: Cêñoßy†ê on 24 May, 2005, 13:14:33
--//-- Hider by C??o?y??--//--

Bot = frmHub:GetHubBotName()
kMenu = "?~UserHider~?"

CanDo = {
[0] = 1, -- Master
[1] = 0, -- Operator
[4] = 0, -- Moderator
[5] = 0, -- Netfounder
}

OpConnected = function(user)
if CanDo[user.iProfile] == 1 and  user.bUserCommand then
user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide from userlist$<%[mynick]> !hideme %[mynick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Return to userlist$<%[mynick]> !unhideme %[mynick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide user from userlist$<%[mynick]> !hiduser %[nick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Return user to userlist$<%[mynick]> !unhiduser %[line:Nick]|")
end
end

ChatArrival = function(user, data)
local s, e, cmd,arg = string.find( data, "%b<>%s+(%S+)%s+(.*)")
if(cmd == "!hideme") then
if CanDo[user.iProfile] == 1 then
SendToAll("*** "..user.sName.." went to Ghost mode.")
SendToAll("$Quit "..user.sName)

else
user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")
end
return 1
end
local s, e, cmd,arg = string.find( data, "%b<>%s+(%S+)%s+(.*)")
if(cmd == "!unhideme") then
if CanDo[user.iProfile] == 1 then
SendToAll("*** "..user.sName.." got back from Ghost mode.")
SendToAll("$OpList "..user.sName)
else
user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")
end
return 1
end
local s, e, cmd,victim = string.find( data, "%b<>%s+(%S+)%s+(.*)")
if(cmd == "!hideuser") then
if (user.iProfile == 0) then
SendToAll("*** Ghost mode activated to "..victim)
SendToAll("$Quit "..victim)

else
user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")
end
return 1
end
local s, e, cmd,victim = string.find( data, "%b<>%s+(%S+)%s+(.*)")
if(cmd == "!unhideuser") then
if (user.iProfile == 0) then
SendToAll("*** Ghost mode disabled from "..victim)
SendToAll("$OpList "..victim)
else
user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")
end
return 1
end
end
Title:
Post by: Ubikk on 24 May, 2005, 14:18:09
Is it possible to comunicate via PM with a user that's not in the userlist?
Title:
Post by: jiten on 24 May, 2005, 14:21:17
QuoteOriginally posted by Ubikk
Is it possible to comunicate via PM with a user that's not in the userlist?
The hidden user may send PMs to anyone, but, normal users won't be able to reply as he's "offline".

Cheers
Title:
Post by: kunal on 31 May, 2005, 11:11:18
hey if a user is hidden his share also goes away
can someone modify he script so that the share of the user wont go when he is hidden
Title:
Post by: jiten on 31 May, 2005, 11:22:47
QuoteOriginally posted by kunal
hey if a user is hidden his share also goes away
can someone modify he script so that the share of the user wont go when he is hidden
If we do that, the user turns visible again.
Unless you login with a "blank" nick (with the ALT+255 character).

Cheers
Title:
Post by: Dessamator on 31 May, 2005, 11:28:47
QuoteOriginally posted by kunal
hey if a user is hidden his share also goes away
can someone modify he script so that the share of the user wont go when he is hidden

that would defeat the purpose of hidden user, the user will be visible but he/she wont have a nick  !
Title:
Post by: bastya_elvtars on 31 May, 2005, 11:38:01
Can users like this respond to searches?
Title: Typos
Post by: XPMAN on 31 May, 2005, 20:05:55
Fixed a couple typos i found that wouldnt let the rightclick work  :)


--//-- Hider by C??o?y†?--//--



Bot = frmHub:GetHubBotName()

kMenu = "•~UserHider~•"



CanDo = {

[0] = 1,-- Master

[1] = 0,-- Operator

[4] = 0,-- Moderator

[5] = 0,-- Netfounder

}



OpConnected = function(user)

if CanDo[user.iProfile] == 1 and  user.bUserCommand then

user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide from userlist$<%[mynick]> !hideme %[mynick]|")

user:SendData("$UserCommand 1 3 "..kMenu.."\\Return to userlist$<%[mynick]> !unhideme %[mynick]|")

user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide user from userlist$<%[mynick]> !hideuser %[nick]|")

user:SendData("$UserCommand 1 3 "..kMenu.."\\Return user to userlist$<%[mynick]> !unhideuser %[line:Nick]|")

end

end



ChatArrival = function(user, data)

local s, e, cmd,arg = string.find( data, "%b<>%s+(%S+)%s+(.*)")

if(cmd == "!hideme") then

if CanDo[user.iProfile] == 1 then

SendToAll("*** "..user.sName.." went to Ghost mode.")

SendToAll("$Quit "..user.sName)



else

user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")

end

return 1

end

local s, e, cmd,arg = string.find( data, "%b<>%s+(%S+)%s+(.*)")

if(cmd == "!unhideme") then

if CanDo[user.iProfile] == 1 then

SendToAll("*** "..user.sName.." got back from Ghost mode.")

SendToAll("$OpList "..user.sName)

else

user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")

end

return 1

end

local s, e, cmd,victim = string.find( data, "%b<>%s+(%S+)%s+(.*)")

if(cmd == "!hideuser") then

if (user.iProfile == 0) then

SendToAll("*** Ghost mode activated to "..victim)

SendToAll("$Quit "..victim)



else

user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")

end

return 1

end

local s, e, cmd,victim = string.find( data, "%b<>%s+(%S+)%s+(.*)")

if(cmd == "!unhideuser") then

if (user.iProfile == 0) then

SendToAll("*** Ghost mode disabled from "..victim)

SendToAll("$OpList "..victim)

else

user:SendData(Bot, "No,No,NO... You are not allowed to use this command!")

end

return 1

end

end


Title:
Post by: jiten on 31 May, 2005, 20:14:05
QuoteOriginally posted by bastya_elvtars
Can users like this respond to searches?
Tested it a while ago and they do respond.
Title: re:
Post by: CaSaNoVa on 03 June, 2005, 15:50:08
Hide share only??
Title:
Post by: bastya_elvtars on 03 June, 2005, 17:01:34
QuoteOriginally posted by CaSaNoVa
Hide share only??

Please do search first.
Title:
Post by: Dessamator on 21 June, 2005, 23:05:10
-- added hide user on reconnect -- By Dessamator
--//-- Hider by C??o?y†?--//--

Bot = frmHub:GetHubBotName()
kMenu = "•~UserHider~•"

tOP={}

CanDo = {
[0] = 1, -- Master
[1] = 0, -- Operator
[4] = 0, -- Moderator
[5] = 0, -- Netfounder
}

OpConnected = function(user)
if CanDo[user.iProfile] == 1 and  user.bUserCommand then
user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide from userlist$<%[mynick]> !hideme %[mynick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Return to userlist$<%[mynick]> !unhideme %[mynick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide user from userlist$<%[mynick]> !hideuser %[nick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Return user to userlist$<%[mynick]> !unhideuser %[line:Nick]|")
end
end

function Main()
SetTimer(1000)
StartTimer()
end

function OnTimer()
for i,v in tOP do
if GetItemByName(i) then
SendToAll("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
end
end
end


ChatArrival = function(user, data)
data=string.sub(data,1,-2)
local s, e, cmd = string.find( data, "%b<>%s+(%S+)")
local _,__,victim = string.find( data, "%b<>%s+%S+%s+(%S+)")
tCmd= {["!hideme"] =function()
user:SendData("*** "..user.sName.." went to Ghost mode.")
SendToAll("$Quit "..user.sName)
tOP[user.sName] = 1
end,
["!unhideme"] =function()
user:SendData("*** "..user.sName.." got back from Ghost mode.")
SendToAll("$OpList "..user.sName)
tOP[user.sName] = nil
end,
["!hideuser"] =function()
user:SendData("*** Ghost mode activated to "..victim)
SendToAll("$Quit "..victim)
tOP[user.sName] = 1
end,
["!unhideuser"] =function()
user:SendData("*** Ghost mode disabled from "..victim)
tOP[user.sName] = nil
if GetItemByName(victim).bOperator then
SendToAll("$OpList "..user.sName)
else
SendToAll(GetItemByName(victim).sMyInfoString)
end
end,
}
if tCmd[cmd] and CanDo[user.iProfile] then
return tCmd[cmd](),1
elseif not CanDo[user.iProfile] then
user:SendData(Bot, "you cant use this command")
return 1
end
end


slight mod  ;)
Title: Re: Hide user.
Post by: Zeel on 18 September, 2006, 21:24:50
  Script does not seem to work, I tried the !hideme and !hideuser <user> and it didnt do anything.  Am I doing something wrong?  Script reports no errors.



Edit:  I just ran the script on another test server and it worked fine.  I'm not sure why it does not run on my other server...
Title: Re: Hide user.
Post by: Herodes on 18 September, 2006, 22:09:59
Wow! nice script to play with :D

--- Inspiration hit and ~15mins of scripting on this delivered what follows ..
- I added some functionality to the cmds that resulted in the removal of [un]hideuser
- The [un]hideme cmds were renamed to [un]hide
- Added the [User|Op]Disconnected API function for removing disconnecting users (keeping the tGhosts(previously 'tOp') table clean)
- Added the listhide cmd for watching which users are in Ghost mode
- Made the relevant right click adjustments and here it is ...

I left the OnTimer function, but I have strong feelings for removing it,...
It is a bandwidth overkill,... data is being sent every second and quite a lot of them,...

[*note*] On this script I only check the Syntax,... no checks for functionality although I feel confident about it enough to post :)
--//-- Hider by Cêñoßy†ê--//--
-- added hide user on reconnect -- By Dessamator
--- touched by Herodes [18/09/2006]
-- - added the autocleaner on user disconnections
-- - added the listhide for showing a list with the ghosts

Bot = frmHub:GetHubBotName()
kMenu = "•~UserHider~•"

tGhosts={}

CanDo = {
[0] = 1, -- Master
[1] = 0, -- Operator
[4] = 0, -- Moderator
[5] = 0, -- Netfounder
}

OpConnected = function(user)
if CanDo[user.iProfile] == 1 and  user.bUserCommand then
user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide from userlist$<%[mynick]> !hide|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Return to userlist$<%[mynick]> !unhide|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Show ghosts$<%[mynick]> !listhide|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Hide this user from userlist$<%[mynick]> !hide %[nick]|")
user:SendData("$UserCommand 1 3 "..kMenu.."\\Return user to userlist$<%[mynick]> !unhide %[line:Nick]|")
end
end

function Main()
SetTimer(1000)
StartTimer()
end

function OnTimer()  ---- WHy!?!!?
for i,v in tGhost do
if GetItemByName(i) then
SendToAll("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
end
end
end


ChatArrival = function(user, data)
data=string.sub(data,1,-2)
local s, e, cmd, victim = string.find( data, "%b<>%s+[%!](%S+)%s*(%S*)")

local tCmd= {
hide = function( user, victim )
if not CanDo[user.iProfile] then user:SendData(Bot, "you cant use this command"); return 1; end
if victim then
victim = GetItemByName(victim)
if not victim then
user:SendData( '*** '..victim..' was not found,.. try again.' );
return 1;
end
tGhosts[user.sName] = 1
SendToAll( '$Quit '..victim.sName )
user:SendData( '*** You have put '..victim.sName..' into Ghost Mode.' )
victim:SendData( '*** '..user.sName..' has put you into Ghost Mode.' )
return 1;
end
tGhosts[user.sName] =  1
user:SendData( '*** You are now in Ghost Mode.' )
SendToAll( '$Quit '..user.sName )
return 1;
end,
unhide = function( user, victim )
if not CanDo[user.iProfile] then user:SendData(Bot, "you cant use this command"); return 1; end
if not victim then
if tGhosts[user.sName] then
tGhosts[user.sName] = nil
SendToAll( user.sMyInfoString )
if user.bOperator then SendToAll( '$OpList '..user.sName) end
user:SendData( '*** You are now back from Ghost Mode.' )
return 1;
end
end
victim = GetItemByName(victim)
if tGhosts[victim.sName] then
tGhosts[victim.sName] = nil
SendToAll( victim.sMyInfoString )
if victim.bOperator then SendToAll( '$OpList '..victim.sName) end
victim:SendData( '*** '..user.sName..' has gotten you back from Ghost Mode.' )
user:SendData( '*** You have taken '..victim.sName..' back from Ghost Mode.' )
return 1;
end
end,
listhide = function( user )
local m = '*** List of hidden users\r\n'
for i,v in pairs(tGhosts) do
m = m..'\t'..i..'\r\n'
end
user:SendData( m )
end,
}
if tCmd[cmd] then
return tCmd[cmd](user, victim)
end
end

function UserDisconnected( user )
if tGhosts[user.sName] then
tGhosts[user.sName] = nil
end
end

OpDisconnected = UserDisconnected;
Title: Re: Hide user.
Post by: bastya_elvtars on 18 September, 2006, 22:14:22
I love scripts that rape the DC protocol.  ::)
Title: Re: Hide user.
Post by: osse on 28 October, 2006, 12:07:08
I got this mess

lua:35: attempt to call a nil value

:(:(
Title: Re: Hide user.
Post by: 6Marilyn6Manson6 on 28 October, 2006, 12:31:23
Quote from: osse on 28 October, 2006, 12:07:08
I got this mess

lua:35: attempt to call a nil value

:(:(

Change:

function OnTimer()  ---- WHy!?!!?
for i,v in tGhost do
if GetItemByName(i) then
SendToAll("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
end
end
end


with:

function OnTimer()  ---- WHy!?!!?
for i,v in pairs(tGhost) do
if GetItemByName(i) then
SendToAll("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
GetItemByName(i):SendData("$Quit "..i)
end
end
end


and it may work