Mistery with a Show OP offline script ...
 

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

Mistery with a Show OP offline script ...

Started by BoyKind, 05 September, 2006, 13:41:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BoyKind

Hi ... I have a show op offline script, it's working fine, but I have a question ... How do I chat with a offline OP? Because the op that is offline, does not appear in the user list, and I can see the messages form the offline OP in mainchat like this: Private message from BoyKind: <BoyKind> hello ... How do I talk with a offline op ? Here is the script:
-- Hider Script By ?&#152;??&#351;?Hawk?&#351;??&#152;?
--28/11/2005
-- Hides Users From the user list

function Main()
	sTable["loadfile"]()
end

function NewUserConnected(user) 
	if sTable.tAllowList[user.iProfile] == 1 then 
		user:SendData("$UserCommand 1 3 "..sTable["Menu"].."\\Show Hidden User list$<%[mynick]> !showhiders&#124;")
		user:SendData("$UserCommand 1 3 "..sTable["Menu"].."\\Hide Nick from user list$<%[mynick]> !hidebot %[nick]&#124;")
		user:SendData("$UserCommand 1 3 "..sTable["Menu"].."\\Unhide Nick from user list$<%[mynick]> !unhidebot %[line:User Name]&#124;")
	end 
	for a,b in pairs(sTable.Hiders) do
		user:SendData( "$Quit "..a.."|" )
	end
end 
OpConnected = NewUserConnected

function UserDisconnected(user)
	if sTable.Hiders[user.sName] then
		sTable.Hiders[user.sName] = nil
	end
end
OpDisconnected = UserDisconnected

function ChatArrival(user, data) 
	local s, e, cmd,BotName = string.find(data, "%b<>%s+(%S+)%s*(.*)|") 
	if sTable.tAllowList[user.iProfile] == 1 and cmd and BotName and sTable.commands[cmd] then
		return sTable.commands[cmd](user, cmd, BotName)
	end
end 

sTable = {
	["Menu"] = "Hider",		--//  Sets the Name used in the right click Menu
	["Bot"] = frmHub:GetHubBotName(),	--//   Sets the Bot name to the same as set in Ptokax
	Hiders = {},

	tAllowList = { 
		[0] = 1,		--// Master Profile
		[1] = 1,		--// Ops 
		[2] = 0,		--// VIP 	--// Profiles Allowed to use the command  1 = yes  / 0 = No
		[3] = 0,		--// REG 
		[4] = 0,		--// Moderator
		[5] = 1,		--// Netfounder
		[6] = 1,		--// Owner
	}, 

	commands = {
		["!unhidebot"] = function(user, cmd, BotName)
			if sTable.Hiders[BotName] then
				if BotName == frmHub:GetOpChatName() or BotName == frmHub:GetHubBotName() then
					local MyOpsList = "$OpList "
					for aux, usr in pairs(frmHub:GetOnlineOperators()) do
						MyOpsList = MyOpsList..usr.sName.."$$"
					end
					MyOpsList = MyOpsList..BotName.."$$"

					sTable.Hiders[BotName] = nil
					SendToAll(MyOpsList.."|")
					user:SendData(sTable["Bot"],"Bot "..BotName.." added to userlist!")
				else
					local Nick = GetItemByName(BotName)
					if Nick then
						local s,e,name,desc,speed,email,share = string.find(Nick.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
						SendToAll( "$MyINFO $ALL "..name.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
						sTable.Hiders[BotName] = nil
						user:SendData(sTable["Bot"],BotName.." Has been added to userlist!") 
					end
				end
			end
			return 1 
		end, 

		["!hidebot"] = function(user, cmd, BotName)
				sTable.Hiders[BotName] = 1
				sTable["SaveTable"]()
				SendToAll( "$Quit "..BotName.."|" )
				user:SendData(sTable["Bot"],BotName.." Has been removed from userlist!") 
			return 1 
		end ,

		["!showhiders"] = function(user, cmd, BotName)
			local ttempline = "\r\n\r\n\t["..string.rep("~",17).."] "..sTable["Menu"].." ["..string.rep("~",17).."]\r\n\r\n\tNicks\r\n\r\n"
				for a , b in pairs(sTable.Hiders) do
					ttempline = ttempline.."\t"..a.."\r\n"
				end
			ttempline = ttempline.."\r\n\r\n\t="..string.rep("~",53).."="
			user:SendData(sTable["Bot"],ttempline) 
			return 1
		end,
	},

	["loadfile"] = function()
	local f,e = io.open("HiddenUsers.lst","r")
		if f then
			while 1 do
				line = f:read("*l")
					if line ==  nil then
						break
					end
					local s,e,InfoOne,InfoTwo = string.find(line, "(.+)$$$(.+)")
						if InfoOne ~= nil then
							sTable.Hiders[InfoOne]=InfoTwo
						end
			end
			 f:close(f)
		else
			f,e = io.open("HiddenUsers.lst", "w" )
			f:write()
			f:close()
		end
	end,

	["SaveTable"] = function()
		local f,e = io.open("HiddenUsers.lst", "w" )
			for aaa,bbb in pairs(sTable.Hiders) do
				f:write(aaa.."$$$"..bbb.."\n")
			 end
		 f:close()
	end,
}
With all the respect

Herodes

It is a client issue,... In the settings of your client go and check/uncheck the 'Ignore messages from users that are not online (effective against bots)' option, there must be another option but I don't recall it now,... so basically check your settings :)

BoyKind

With all the respect

dragos_sto

i make something to you
the bottom functio reg the hide user only to nick ho send pm message make hide, send the message and after message sent then hide the user
function not tested

Code: lua
function ToArrival(user, data)
 	if sTable.Hiders[user.sName] == 1 then
		local whoTo,_,msg = string.match(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.*)")
		if whoTo ~= "" and whoTo ~= nil  then
			if BotName == frmHub:GetOpChatName() or BotName == frmHub:GetHubBotName() then
				local MyOpsList = "$OpList "
				for aux, usr in pairs(frmHub:GetOnlineOperators()) do
					MyOpsList = MyOpsList..usr.sName.."$$"
				end
				MyOpsList = MyOpsList..BotName.."$$"
				SendToNick(whoTo,MyOpsList.."|")
			else
				local Nick = GetItemByName(user)
				if Nick then
					local name,desc,speed,email,share = string.match(Nick.sMyInfoString, "$MyINFO $ALL (%S+)%s+([^$]*)$ $([^$]*)$([^$]*)$([^$]+)")
					SendToNick(whoTo, "$MyINFO $ALL "..name.." "..desc.."$ $"..speed.."$"..email.."$"..share.."$")
				end
			end
			SendPmToNick(whoTo, user.sName, msg)
			SendToNick(whoTo, "$Quit "..user,sName.."|" )		
			return 0
		end
	end
end


i hope it help you

SMF spam blocked by CleanTalk