hide user
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

hide user

Started by kalle370, 24 April, 2008, 20:14:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kalle370

commands:
hideme on/off

Script:
Auto hide whit join: set profile
Show hide me users set profile
hideme set profile


[OnLy]-PiTiCu

#1
Script for HideOp:

script for 0.3.6.0 converted for NewAPI

-- This script is converted with PtokaX LUA API Converter v0.9 at 04/25/08 20:34:45


Bot = SetMan.GetString(21)
kMenu = "HideOp"

tGhosts={}

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

OpConnected = function(user)
	Core.GetUserAllData(user)
	if (CanDo[user.iProfile] == 1 and  user.bUserCommand) then
		Core.SendToNick(user.sNick,"$UserCommand 1 3 "..kMenu.."\\Hide from userlist$<%[mynick]> !hideme&#124;")
		Core.SendToNick(user.sNick,"$UserCommand 1 3 "..kMenu.."\\Return to userlist$<%[mynick]> !unhideme&#124;")
		Core.SendToNick(user.sNick,"$UserCommand 1 3 "..kMenu.."\\Show ghosts$<%[mynick]> !listhide&#124;")
		Core.SendToNick(user.sNick,"$UserCommand 1 3 "..kMenu.."\\Hide this user from userlist$<%[mynick]> !hide %[nick]&#124;")
		Core.SendToNick(user.sNick,"$UserCommand 1 3 "..kMenu.."\\Return user to userlist$<%[mynick]> !unhide %[line:Enter Nick]&#124;")
	end
end

function OnStartup()

end

function OnTimer(tmr)  ---- WHy!?!!?
	for i,v in pairs(tGhosts) do
		if Core.GetUser(i,true) then
			Core.SendToAll("$Quit "..i)
			Core.Core.SendToNick(i.sNick,"$Quit "..i)
			Core.Core.SendToNick(i.sNick,"$Quit "..i)
		end
	end
end



ChatArrival = function(user,data)
	Core.GetUserAllData(user)
	local _,_,cmd = string.find( data, "%b<>%s+!(%S+)(.*)|")

	local tCmd= {
		hide = function( user, data)
			doArg1(data)
			if not CanDo[user.iProfile] then Core.SendToNick(user.sNick,"<"..Bot.."> *** You are not allowed to use this command.") 
				return true;
			elseif arg then
				local sUser = Core.GetUser(arg,true)
				if not sUser then
					Core.SendToNick(user.sNick, "*** "..sUser.." was not found,.. try again." );
					return true;
				else
					tGhosts[arg] = 1
					Core.SendToAll("$Quit "..sUser.sNick )
					Core.SendToNick(user.sNick, "*** You have put "..arg.." into Ghost Mode." )
					Core.SendToNick(sUser.sNick, "*** "..user.sNick.." has put you into Ghost Mode." )
					return true;
				end
			else
				Core.SendToNick(user.sNick,"*** Error! - You need to enter a Nick to Ghost!")
				return true
			end
		end,

		hideme = function(user,data)
			if not CanDo[user.iProfile] then 
				Core.SendToNick(user.sNick,"<"..Bot.."> *** You are not allowed to use this command.") 
				return true;
			else
				tGhosts[user.sNick] = 1
				Core.SendToNick(user.sNick, "*** You are now in Ghost Mode." )
				Core.SendToAll( "$Quit "..user.sNick )
				return true;
			end
		end,

		unhide = function( user, data )
			if not CanDo[user.iProfile] then Core.SendToNick(user.sNick,"<"..Bot.."> *** You are not allowed to use this command.") 
				return true;
			end
			doArg1(data)
			if arg then
				if tGhosts[arg] then
					tGhosts[arg] = nil
					local sUser = Core.GetUser(arg,true)
					Core.SendToAll( sUser.sMyInfoString )
					if sUser.bOperator then Core.SendToAll( '$OpList '..sUser.sNick) end
					Core.SendToNick(sUser.sNick, '*** '..user.sNick..' has gotten you back from Ghost Mode.' )
					Core.SendToNick(user.sNick, '*** You have taken '..sUser.sNick..' back from Ghost Mode.' )
					return true;
				else
					Core.SendToNick(user.sNick,"*** Error! - No user named "..arg.." in Ghost Mode!")
					return true
				end
			else
				Core.SendToNick(user.sNick,"*** Error! - You need to enter a Nick to Unhide!")
				return true
			end
		end,

		unhideme = function(user,data)
			if not CanDo[user.iProfile] then Core.SendToNick(user.sNick,"<"..Bot.."> you cant use this command"); return true; end
			if tGhosts[user.sNick] then
				tGhosts[user.sNick] = nil
				Core.SendToAll( user.sMyInfoString )
				if user.bOperator then Core.SendToAll( "$OpList "..user.sNick) end
				Core.SendToNick(user.sNick, "*** You are now back from Ghost Mode." )
				return true;
			else
				Core.SendToNick(user.sNick,"*** Error! - You're not in Ghost Mode.")
			end
		end,

		listhide = function(user)
			local m = "*** List of hidden users\r\n"
			for sUser in pairs(tGhosts) do
				m = m..'\t'..sUser..'\r\n'
			end
			Core.SendToNick(user.sNick, "\r\n\t"..m )
			return true
		end,
	}
	if tCmd[cmd] then
		return tCmd[cmd](user, data)
	end
end

function doArg1(data)
	s,e,cmd,arg = string.find(data, "%b<>%s+!(%S+)%s+(.+)|" ) 
	return arg
end

function UserDisconnected(user)
	Core.GetUserAllData(user)
	if tGhosts[user.sNick] then 
		tGhosts[user.sNick] = nil
	end
end

OpDisconnected = UserDisconnected;  
 
RegDisconnected = UserDisconnected



sorry for my bad english.  Script is working
[OnLy]-PiTiCu

Giorgos

It shows the hidden user/s if you just reconnect and it also sends the !unhideme command to the mainchat when you are not hidden.

Is it supposed to do the former? Fix plz? =)

Annie

I'm using this script and have noticed that when you hide op newly connecting users can see you.  Can it be done so that they cant    thanks  :)

SMF spam blocked by CleanTalk