READ THE RULES
0 Members and 1 Guest are viewing this topic.
--[[ HideMe 1.0 LUA 5.1x [Strict] [API 2] By Mutor 04/29/08 Yet another hide script for operators, allows ops to remove/restore themselves from/to the user list. - Command permission for operators only - Provides context menu command to hide/reveal nick - Option to hide from all users or only non operators - Hidden users data saved to file for hub/script restarts]]-- Preset your hidden nicks here or use user commands after script startHidden = {"Mutor","YourNick"}-- Hide from all users? true/false [false = Hide from non ops, ops may always list hidden users]local HideFromAll = true--local Scp = "HideMe 1.0"local file = "Hidden.dat"local Tmr = 0OnStartup = function() if loadfile(file) then dofile(file) else Save(Hidden) end Hide() endUserConnected = function(user) Hide(user) endRegConnected = UserConnectedOpConnected = function(user) local uc = "$UserCommand 1 3 "..SetMan.GetString(0).."\\"..Scp.."\\".. "Hide/Reveal Yourself$<%[mynick]> "..SetMan.GetString(29):sub(1,1).."hide||" uc = uc..uc:gsub("Hide/Reveal Yourself","List Hidden Operators"):gsub("hide","listhidden") Core.SendToUser(user,uc)endMyINFOArrival = function(user,data) if Check(user.sNick:lower()) and Tmr == 0 then Tmr = TmrMan.AddTimer(750) end endOnTimer = function(Id) if Id == Tmr then TmrMan.RemoveTimer(Tmr) Tmr = 0 Hide() end endChatArrival = function(user,data) if Core.GetUserValue(user,11) then local _,_,cmd = data:lower():find("%b<> ["..SetMan.GetString(29).."](%a+)|") local _,_,to = string.find(data,"^$To: (%S+) From:") if cmd then local msg,bot,bool = "",SetMan.GetString(21),false cmd = cmd:lower() if cmd == "hide" then msg,bool = "hidden",true local ret = Check(user.sNick:lower()) if ret then table.remove(Hidden,ret) msg = "revealed" Hide(nil,user.sNick) else table.insert(Hidden,user.sNick) Hide() end Save(Hidden) msg = "The nick: "..user.sNick.." is now "..msg..".|" elseif cmd == "listhidden" then msg,bool = "There are no hidden users at this time.",true if next(Hidden) then msg = "\n\n\tListing ["..tostring(#Hidden).."] Hidden Users\n\n\t" msg = msg..table.concat(Hidden,"\n\t").."\n\n" end end if bool and msg:len() > 0 then if to then Core.SendPmToUser(user,bot,msg) else Core.SendToUser(user,"<"..bot.."> "..msg) end return true end end endendToArrival = ChatArrivalCheck = function(nick) for i,v in ipairs(Hidden) do if nick == v:lower() then return i end endendHide = function(user,op) if op then local usr = Core.GetUser(op) if usr then return Core.SendToAll(Core.GetUserValue(usr,1).."|") end end for i,v in ipairs(Hidden) do local msg = "$Quit "..v.."|" if user then Core.SendToUser(user,msg) else if HideFromAll then Core.SendToAll(msg) else Core.SendToProfile(-1,msg) for i,v in ipairs(ProfMan.GetProfiles()) do if not ProfMan.GetProfile(i-1).tProfilePermissions.bIsOP then Core.SendToProfile(i-1,msg) end end end end endendSave = function(tab) local f,e = io.open(file,"wb") if f then local s = "" if next(tab) then for i,v in pairs(tab) do s = s..string.format("%q",v).."," end s = "{"..s:sub(1,-2).."}" else s = "{}" end if s:len() > 0 then f:write("Hidden = "..s) end f:flush() f:close() endend
There is no problem with the user commands in BCDC 0.699d nor will there be in any client that properly handles user commands.Again it sounds like the pipe character issue. Post at the clientdevelopers site and let's stop repeating the same issues withnon protocol compliant clients here. I will not ever write a work-around for a lack of proper client protocol support.
--[[ HideMe 1.0b LUA 5.1x [Strict] [API 2] By Mutor 04/29/08 Yet another hide script for operators, allows ops to remove/restore themselves from/to the user list. - Command permission for operators only - Provides context menu command to hide/reveal nick - Option to hide from all users or only non operators - Hidden users data saved to File for hub/script restarts +Changes from 1.0 05/23/08 +Added method to reveal nick as operator. Requested by roblov +Added resend interval setting variable]]-- Preset your hidden nicks here or use user commands after script startHidden = {"Mutor","YourNick"}-- Hide from all users? true/false [false = Hide from non ops, ops may always list hidden users]local HideFromAll = true-- Interval in ms, where MyINFO will be resentInt = 750--local Scp,File,Tmr = "HideMe 1.0b","Hidden.dat",0OnStartup = function() if loadfile(File) then dofile(File) else Save(Hidden) end Hide() Int = math.max(Int,250) endOnExit = function() Restore() endUserConnected = function(user) Hide(user) endRegConnected = UserConnectedOpConnected = function(user) local uc = "$UserCommand 1 3 "..SetMan.GetString(0).."\\"..Scp.."\\".. "Hide/Reveal Yourself$<%[mynick]> "..SetMan.GetString(29):sub(1,1).."hide||" uc = uc..uc:gsub("Hide/Reveal Yourself","List Hidden Operators"):gsub("hide","listhidden") Core.SendToUser(user,uc) Hide(user)endMyINFOArrival = function(user,data) if Check(user.sNick:lower()) and Tmr == 0 then Tmr = TmrMan.AddTimer(750) end endOnTimer = function(Id) if Id == Tmr then TmrMan.RemoveTimer(Tmr) Tmr = 0 Hide() end endChatArrival = function(user,data) if Core.GetUserValue(user,11) then local _,_,cmd = data:lower():find("%b<> ["..SetMan.GetString(29).."](%a+)|") local _,_,to = data:find("^$To: (%S+) From:") if cmd then local msg,bot,bool = "",SetMan.GetString(21),false cmd = cmd:lower() if cmd == "hide" then msg,bool = "hidden",true local ret = Check(user.sNick:lower()) if ret then table.remove(Hidden,ret) msg = "revealed" Hide(nil,user.sNick) Restore(user.sNick) else table.insert(Hidden,user.sNick) Hide() end Save(Hidden) msg = "The nick: "..user.sNick.." is now "..msg..".|" elseif cmd == "listhidden" then msg,bool = "There are no hidden users at this time.",true if next(Hidden) then msg = "\n\n\tListing [ "..tostring(#Hidden).." ] Hidden Users\n\n\t" msg = msg..table.concat(Hidden,"\n\t").."\n\n" end end if bool and msg:len() > 0 then if to then Core.SendPmToUser(user,bot,msg) else Core.SendToUser(user,"<"..bot.."> "..msg) end return bool end end endendToArrival = ChatArrivalCheck = function(nick) for i,v in ipairs(Hidden) do if nick == v:lower() then return i end end return false endHide = function(user,op) if op then local usr = Core.GetUser(op) if usr then return Core.SendToAll(Core.GetUserValue(usr,1).."|") end end for i,v in ipairs(Hidden) do local msg = "$Quit "..v.."|" if user then Core.SendToUser(user,msg) else if HideFromAll then Core.SendToAll(msg) else Core.SendToProfile(-1,msg) for i,v in ipairs(ProfMan.GetProfiles()) do if not ProfMan.GetProfile(i-1).tProfilePermissions.bIsOP then Core.SendToProfile(i-1,msg) end end end end endendRestore = function(arg) local o,t = "$OpList ",{} for _,user in ipairs(Core.GetOnlineOps()) do u,ul = user.sNick,user.sNick:lower() if arg then if not Check(ul) then table.insert(t,u) end else table.insert(t,u) end end if next(t) then o = o..table.concat(t,"$$").."$$" end Core.SendToAll(o.."|")endSave = function(tab) local f,e = io.open(File,"wb") if f then local s = "" if next(tab) then for i,v in pairs(tab) do s = s..string.format("%q",v).."," end s = "{"..s:sub(1,-2).."}" else s = "{}" end if s:len() > 0 then f:write("Hidden = "..s) end f:flush() f:close() endend