PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: Northwind on 19 October, 2005, 17:49:21

Title: protected by Master Ptaczek
Post by: Northwind on 19 October, 2005, 17:49:21
Hello i just looked some phrases from YnHUb and there was interesting phrase... so little funny...

can somebody make script which  says:

-When operator  try to kick, ban or gag master profile user

"You silly mortal, this user is protected by Master Ptaczek himself"

-and when operator try to kick, ban or gag other operators script says

"No can do, all operators are protected by Master PPK himself"

respects... nw
Title:
Post by: Madman on 19 October, 2005, 18:29:49
-- Op and Master Protect script
-- Made by Madman
-- Requested by Northwind

function ChatArrival(curUser, data)
local data = string.sub(data, 1, string.len(data)-1)
local s,e,cmd = string.find(data, "%b<>%s+%p(%S+)")
cmd = string.lower(cmd)
if cmd and curUser.bOperator then
if cmd == "kick" or cmd == "gag" or cmd == "ban" then
local s,e,Nick = string.find(data, "%b<>%s+%p%S+%s+(%S+)")
if Nick then
vUser = GetItemByName(Nick)
if curUser.iProfile == 1 and vUser.iProfile == 0 then
curUser:SendData(frmHub:GetHubBotName(), "You silly mortal, this user is protected by Master Ptaczek himself") return 1
elseif curUser.iProfile == 1 and vUser.iProfile == 1 then
curUser:SendData(frmHub:GetHubBotName(), "No can do, all operators are protected by Master PPK himself") return 1
end
end
end
end
end

function ToArrival(curUser, data)
local s,e,cmd = string.find(data, "%b<>%s+%p(%S+)")
if cmd then
ChatArrival(curUser, data) return 1
end
end

Give this a try....
Title:
Post by: Northwind on 19 October, 2005, 19:06:01
notwork ;-(

[ML] is OP

Only info what i see is inbuild:

You are not allowed to kick [ML]xxx
Title:
Post by: Madman on 19 October, 2005, 20:35:30
hmm.. is it placed over your Security script?
Must be over that script...
Title:
Post by: bastya_elvtars on 19 October, 2005, 20:37:44
curUser.bOperator is what you should use.
Title:
Post by: Northwind on 20 October, 2005, 01:33:08
bastya,

do you mean that i change all "curUser" to curUser.bOperator, iam noobie so i have to ask ;-)
Title:
Post by: bastya_elvtars on 20 October, 2005, 02:16:39
Replace every occurence of curUser.iProfile == 1 to curUser.bOperator.
Title:
Post by: Madman on 20 October, 2005, 02:46:43
I tested it.. and it works for me..
I cant ban, gag or kick...
Title:
Post by: bastya_elvtars on 20 October, 2005, 02:54:25
QuoteOriginally posted by madman
I tested it.. and it works for me..
I cant ban, gag or kick...

But bOperator works for masters and all goddamn robocop profiles as well. That's why I recommended it.
Title:
Post by: Northwind on 20 October, 2005, 20:00:26
Ptokax version is 0.3.3.21c...

lol  :D  what i do wrong, now it is first script and i get this...

[20:56] Syntax D:\0.3.3.21c.nt.dbg\scripts\00-op-master-protect.lua:15: bad argument #1 to `lower' (string expected, got nil)
Title:
Post by: bastya_elvtars on 20 October, 2005, 20:12:16
Try this:

-- Op and Master Protect script
-- Made by Madman
-- Requested by Northwind
-- Fixed by bastya_elvtars

function ChatArrival(curUser, data)
  local data = string.sub(data, 1, string.len(data)-1)
  local s,e,cmd = string.find(data, "%b<>%s+%p(%S+)")
  if cmd and curUser.bOperator then
    cmd = string.lower(cmd)
    if cmd == "kick" or cmd == "gag" or cmd == "ban" then
      local s,e,Nick = string.find(data, "%b<>%s+%p%S+%s+(%S+)")
      if Nick then
        vUser = GetItemByName(Nick)
        if curUser.iProfile == 1 and vUser.iProfile == 0 then
          curUser:SendData(frmHub:GetHubBotName(), "You silly mortal, this user is protected by Master Ptaczek himself") return 1
        elseif curUser.iProfile == 1 and vUser.iProfile == 1 then
          curUser:SendData(frmHub:GetHubBotName(), "No can do, all operators are protected by Master PPK himself") return 1
        end
      end
    end
  end
end

function ToArrival(curUser, data)
  local s,e,cmd = string.find(data, "%b<>%s+%p(%S+)")
  if cmd then
    ChatArrival(curUser, data)
  end
end
Title:
Post by: Northwind on 21 October, 2005, 00:36:44
still don work... its first script and still i get ptokax inbuild error message not this new phrase
Title:
Post by: bastya_elvtars on 21 October, 2005, 00:44:18
QuoteOriginally posted by Northwind
still don work... its first script and still i get ptokax inbuild error message not this new phrase

Will extend to support builtin kick.