PtokaX forum

Archive => Archived 5.0 boards => Help with scripts => Topic started by: Op on 25 May, 2006, 14:53:00

Title: Help please convert to lua 5
Post by: Op on 25 May, 2006, 14:53:00
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 **" )
Title: Re: Help please convert to lua 5
Post by: Herodes on 25 May, 2006, 16:18:16
Its a client script .. those were Lua 5 from the start ..

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