Help please convert to lua 5
 

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

Help please convert to lua 5

Started by Op, 25 May, 2006, 14:53:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Op

Please convert to lua 5 thank

--// vim:ts=4:sw=4:noet
--//
--// the second argument decides in which order the scripts are run
--// use numbers when you need order, else you can just use a _unique_ identifier

-- the array of forbidden things
trigs = { "fuck", "weingarten","ip.com","ass.org","dns2go","yhub","servemp3.net","mine,nu"}

-- the kick/ban reason which the user in question gets
Reason = "has been kicked because of Offensive Language / Advertising."

-- the command you want 2 trigger
DoCommand = "!kickuser"

dcpp:setListener( "pm", "adver",
  function( hub, user, text )
     local s = string.lower( text )
     if not user:isOp() and not user:msgHandled( "adver" ) then
        for i=1,table.getn(trigs) do
           if string.find(s, trigs) then
              local ownNick = hub:getOwnNick()
              DC():SendHubMessage( hub:getId(), "<"..ownNick.."> "..DoCommand.." "..user:getNick().." "..Reason.."|" )
              --hub:sendChat(hub, (trigs{i].." is not a nice word 2 say :)") )
              break
           end
        end
        user:setMsgHandled( "adver" )
     end
  end                                                       
)

DC():PrintDebug( "  ** Loaded antiadver.lua **" )

Herodes

Its a client script .. those were Lua 5 from the start ..

try finding a client that is lua-able. ..

SMF spam blocked by CleanTalk