Gag 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

Gag script

Started by Genius, 04 May, 2005, 02:34:10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Genius

Hi evryone

i need this script in lua 5 please
sory my bad inglish


-----------------------------

-- GagScript v1.1
-- Description: loOol
-- Made by guibs, 22/08/2003
-- Bugfix and optimizations by bonki 22/08/2003
-- Idea and newbie block change from Homem_do_Leme,, :)

BotName = "***Empregado-=P2P=-***"
UserLevel = {}

tSpecialChars = {
                  ["!help"] = 1,
                  ["!regme"] = 1,
        ["!rules"] = 1,
                };

tLevels = { -- Guibs, what is this? CB related conversions? ;-)
            [0] = 8,
            [1] = 5,
            [2] = 4,
            [3] = 3,
            [4] = 2,
            [5] = 6,
            [6] = 7,
            [7] = 9,
          };

function DataArrival(user, data)
  local _, _, cmd = strfind(data, "%b<>%s+(%S+)");

  if ((cmd and not tSpecialChars[strsub(cmd, 1, 1)]) and strsub(data, 1, 1) == "<" and CheckUserLevel(user) <= 2) then
    user:SendData(BotName, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe.")
    return 1;
  elseif (strsub(data,1, 4) == "$To:") then
    if (CheckUserLevel(user) <= 2) then
      _, _, whoTo = strfind(data, "$To:%s+(%S+)")
      user:SendPM(whoTo, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe")
      return 1;
    end
  end

  return 0
end
--------- Check User Level ---------

function CheckUserLevel(user)
  local userlevel = nil
  local allprofiles = GetProfiles()
  local index, profile, index2, nick

  for index, profile in allprofiles do
    local users = GetUsersByProfile(profile)
    for index2, nick in users do
      if nick == user.sName then
        userlevel = index
      end
    end
  end

  if (userlevel) then
    return tLevels[userlevel];
  else
    return 1;
  end
end


------------------------------

I need change the script for -? profile ( master/vip/reg/newbie) newbie can?t !regme but can?t talk please

[][] genius

Dessamator

#1
--Lua 5 by Dessamator
-- GagScript v1.1 
-- Description: loOol 
-- Made by guibs, 22/08/2003 
-- Bugfix and optimizations by bonki 22/08/2003 
-- Idea and newbie block change from Homem_do_Leme,, :) 

BotName = "***Empregado-=P2P=-***" 
UserLevel = {} 

tSpecialChars = { 
["!help"] = 1, 
["!regme"] = 1, 
["!rules"] = 1, 
}; 

tLevels = { -- Guibs, what is this? CB related conversions? ;-) 
[0] = 8, 
[1] = 5, 
[2] = 4, 
[3] = 3, 
[4] = 2, 
[5] = 6, 
[6] = 7, 
[7] = 9, 
}; 

function ChatArrival(user, data) 
local data = string.sub(data,1, -2)
local _, _, cmd = string.find(data, "%b<>%s+(%S+)"); 
local check =nil
	for pos,table in tSpecialChars do
		if pos==cmd then
		check = true
		end
	end
	if (cmd and not(check) and CheckUserLevel(user) <= 2) then 
		user:SendPM(BotName, "Este hub est? protegido contra utilizadores mal intencionados, pelo que s? utilizadores registados podem falar, para te registares faz !regme password e espera que um op te registe.") 
	return 1; 
	end 
return 0 
end 

ToArrival = ChatArrival

--------- Check User Level --------- 

function CheckUserLevel(user) 
local userlevel = nil 
local allprofiles = GetProfiles() 
local index, profile, index2, nick 

	for index, profile in allprofiles do 
		local users = GetUsersByProfile(profile) 
		for index2, nick in users do 
	
			if nick == user.sName then 
			userlevel = index 
			end 
		end 
	end 

	if (userlevel) then 
		return tLevels[userlevel]; 
		else 
		return 1; 
	end 
end



a small bug fix, :)
Ignorance is Bliss.

Genius

Hi again

   The script work fine. Tank You Dessamator :)

Dessamator

Ignorance is Bliss.

SMF spam blocked by CleanTalk