protected by Master Ptaczek
 

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

protected by Master Ptaczek

Started by Northwind, 19 October, 2005, 17:49:21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Northwind

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


Madman

-- 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....
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

Northwind

notwork ;-(

[ML] is OP

Only info what i see is inbuild:

You are not allowed to kick [ML]xxx


Madman

hmm.. is it placed over your Security script?
Must be over that script...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

bastya_elvtars

curUser.bOperator is what you should use.
Everything could have been anything else and it would have just as much meaning.

Northwind

#5
bastya,

do you mean that i change all "curUser" to curUser.bOperator, iam noobie so i have to ask ;-)


bastya_elvtars

#6
Replace every occurence of
curUser.iProfile == 1
to
curUser.bOperator
.
Everything could have been anything else and it would have just as much meaning.

Madman

#7
I tested it.. and it works for me..
I cant ban, gag or kick...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

bastya_elvtars

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.
Everything could have been anything else and it would have just as much meaning.

Northwind

#9
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)


bastya_elvtars

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
Everything could have been anything else and it would have just as much meaning.

Northwind

still don work... its first script and still i get ptokax inbuild error message not this new phrase


bastya_elvtars

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.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk