Regged Users Download only
 

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

Regged Users Download only

Started by Cid, 02 March, 2005, 17:25:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cid

Someone can make it work with new PtokaX, please?
Thanks in advance ;)

-- GLOBAL VARIABLES --  make changes here only
----------------------
smDebugging       = "0"   -- Default is "0" (silent mode). "1" sends msgs to OPs
smBlockSearches   = "0"   -- Default is "1" (do not block searches)
smBlockSearchExceptions = { "Homer", "Simpson" }
----------------------------------
-- Do not change anything below --
----------------------------------
smScriptVersion = "01"
smBot = frmHub:GetHubBotName() -- This line gets bot name from PtokaX hubsoftware;
                               -- therefore, your Hub Bot should be enabled.

ToBlock = { "^$ConnectToMe%s(%S+)", "^$RevConnectToMe%s(%S+)", "^$Search%s(%S+)"}

--// This function is called when hub or script starts
function Main()
  frmHub:EnableFullData(1)
  frmHub:UnregBot(smBot)
  frmHub:RegBot(smBot)
  --// If thus configured, remove search from blocking table:
  if smBlockSearches == "0" then
    for i,v in ToBlock do
      if v == "^$Search%s(%S+)" then ToBlock = nil end
    end
  end
end

function DataArrival (user, data)
  for _,blockstring in ToBlock do
    local _, _, who = strfind(data, blockstring)
    if who then return smBlock(user,data,who) end
  end
end

function smBlock(user,data,who)
  local report
  local profnam = GetProfileName(user.iProfile)
  if profnam then
    profnam = strlower(profnam)
  else
    profnam = "alien"
  end
--// Activity by Masters, OPs, VIPs and REGs are just reported to OPs:
--// Also, searches pass if they are in the exception list:
  if (user.iProfile ~= -1) or smMatchException(data) then
    report = "\t"..user.sName.." ("..profnam..") sends:\r\n\t"..data
    smDebugToOPs(report)
    return nil
  end
--// Alien (not registered) users get blocked:
  local report = "\tBlocked from "..user.sName.." ("..
        profnam.."):\r\n\t"..data
  smDebugToOPs(report)
  return 1
end

function smMatchException(data)
  if strfind (data, "^$Search%s(%S+)") then
    for _,exceptword in smBlockSearchExceptions do
      if strfind (strlower(data), strlower(exceptword)) then
        return 1
      end
    end
  end
  return nil
end

function smDebugToOPs(data)
  if smDebugging == "1" then
    SendToOps(smBot,data)
  end
end


UwV

#1
well
this one does what you want
-- link--
.. exept the reports ..
but it sends a pm in main to the blocked user .. and with a little edit  a "message blocked by bot" reply in the window of the  pm that got blocked..
maybe try that one ?
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

SMF spam blocked by CleanTalk