PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: BoyKind on 05 September, 2006, 13:41:00

Title: Mistery with a Show OP offline script ...
Post by: BoyKind on 05 September, 2006, 13:41:00
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,
}
Title: Re: Mistery with a Show OP offline script ...
Post by: Herodes on 10 September, 2006, 13:45:21
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 :)
Title: Re: Mistery with a Show OP offline script ...
Post by: BoyKind on 11 September, 2006, 00:22:44
thx man ... I found it ;)
Title: Re: Mistery with a Show OP offline script ...
Post by: dragos_sto on 28 September, 2006, 11:50:39
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) Select

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