PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: TTB on 17 February, 2005, 19:50:23

Title: BanME >:)
Post by: TTB on 17 February, 2005, 19:50:23
Hi,

here a banme script... it's is useless... but somehow I like it


-- BANME script by TTB
-- OPs get also notification by PM (if enabled)
-- v1.0  17-02-05
-- In v2 maybe a max. in the timeban?? If someone else likes to do that, be my guest!
---------------------------------------------------------------------------

-- ## Change this to what you like ## --

Bot = "[BOT]PLAY" -- NAME of your BANME bot  >:)
hubname = "Dutch DVD hub" -- NAME of your wonderfull hub
---------------------------------------------------------------------------
Baninfocmd = "#banhelp" -- info "how do I get banned?!"
Bancmd = "#banme" -- your BANME command
Disconnectcmd = "#disconnect" -- your disconnect command
opNote = "1" -- Send notification to OPs set "1" else "0"

-- NO KILL FUNCTION! You don't want your users killed...! You can do that by yourself ;-)

-- ## Don't change below ## --

function DataArrival(curUser, data)
   if (strsub(data, 1, 1) == "<" ) then
    data=strsub(data,1,strlen(data)-1)
    s,e,cmd = strfind(data,"%b<>%s+(%S+)")
    if (cmd == Baninfocmd) then
     curUser:SendData("<"..Bot..">\r\n\r\n\t--<>--------------------------------------------------------------------------------------------------------------------------------------------------------<>--\r\n\t\t\t [ BAN Help ]\t\t\t [ BAN Help ] \r\n\t--<>--------------------------------------------------------------------------------------------------------------------------------------------------------<>--\r\n\t\t "..Disconnectcmd.." \t\t\t=\tDisconnect yourself\r\n\t\t "..Bancmd.."

Title: v2
Post by: TTB on 17 February, 2005, 20:52:01
Well.. here we go. v.2 already...

-- BANME script by TTB
-- OPs get also notification by PM (if enabled)
-- v2.0  17-02-05
-- Thanx to Piderman & Tejo, max with the timebans...
---------------------------------------------------------------------------

-- ## Change this to what you like ## --

Bot = "[BOT]PLAY" -- NAME of your BANME bot  >:)
hubname = "Dutch DVD hub" -- NAME of your wonderfull hub
---------------------------------------------------------------------------
Baninfocmd = "#banhelp" -- info "how do I get banned?!"
Bancmd = "#banme" -- your BANME command
Disconnectcmd = "#disconnect" -- your disconnect command
opNote = "1" -- Send notification to OPs set "1" else "0"
maxBan = 1440 -- 1440 min = 24 hours. No quotes needed here

-- NO KILL FUNCTION! You don't want your users killed...! You can do that by yourself ;-)

-- ## Don't change below ## --

function DataArrival(curUser, data)
   if (strsub(data, 1, 1) == "<" ) then
    data=strsub(data,1,strlen(data)-1)
    s,e,cmd = strfind(data,"%b<>%s+(%S+)")
    if (cmd == Baninfocmd) then
     curUser:SendData("<"..Bot..">\r\n\r\n\t--<>--------------------------------------------------------------------------------------------------------------------------------------------------------<>--\r\n\t\t\t [ BAN Help ]\t\t\t [ BAN Help ] \r\n\t--<>--------------------------------------------------------------------------------------------------------------------------------------------------------<>--\r\n\t\t "..Disconnectcmd.." \t\t\t=\tDisconnect yourself\r\n\t\t "..Bancmd.."
Title:
Post by: plop on 18 February, 2005, 17:43:46
QuoteOriginally posted by TTB
Hi,

here a banme script... it's is useless... but somehow I like it
if you learn from it, it isn't useless.

plop
Title:
Post by: TTB on 18 February, 2005, 17:47:18
Hi

YEAH I LEARN! :D


I have also another script... you all gonna like it, I promise... but it isn't finished. I will post it when it is finished  :D
Title: v2.1
Post by: TTB on 21 February, 2005, 00:07:04
v2.1 >>

New/modifications:

-- ------------------------------------------------------------------------
-- Bot will now be regged
-- Menu fix, that will make v2.1  :)  
-- MORE TO COME!
---------------------------------------------------------------------------


-- BANME script by TTB
-- OPs get also notification by PM (if enabled)
-- v2.1  20-02-05
-- Thanx to Piderman & Tejo, max with the timebans...
-- ------------------------------------------------------------------------
-- Bot will now be regged
-- Menu fix, that will make v2.1  :)  
-- MORE TO COME!
---------------------------------------------------------------------------

-- ## Change this to what you like ## --

Bot = "[BOT]PLAY" -- NAME of your BANME bot  >:)
hubname = "Dutch DVD hub" -- NAME of your wonderfull hub
---------------------------------------------------------------------------
Baninfocmd = "#banhelp" -- info "how do I get banned?!"
Bancmd = "#banme" -- your BANME command
Disconnectcmd = "#disconnect" -- your disconnect command
opNote = "1" -- Send notification to OPs set "1" else "0"
maxBan = 1440 -- 1440 min = 24 hours. No quotes needed here

-- NO KILL FUNCTION! You don't want your users killed...! You can do that by yourself ;-)

-- ## Don't change below ## --

function Main()
frmHub:RegBot(Bot)
end

function DataArrival(curUser, data)
   if (strsub(data, 1, 1) == "<" ) then
    data=strsub(data,1,strlen(data)-1)
    s,e,cmd = strfind(data,"%b<>%s+(%S+)")
    if (cmd == Baninfocmd) then
       local line = ""
       curUser:SendData("<"..Bot..">\r\n\r\n\t--<>--------------------------------------------------------------------------------------------------------------------------------------------------------<>--"
       ..line.."\r\n\t\t\t [ BAN Help ]\t\t\t [ BAN Help ]\r\n\t"
       ..line.."--<>--------------------------------------------------------------------------------------------------------------------------------------------------------<>--"
       ..line.."\r\n\t\t "..Disconnectcmd.." \t\t=\tDisconnect yourself"
       ..line.."\r\n\t\t "..Bancmd.."


I try to build now v3.0, with these options:

Timeban with your own leave message (reason)
Set the minimum of the ban
Kill command by user (fake or real)
Title: v3.1
Post by: TTB on 28 February, 2005, 04:33:16
Hi,

here v3.1

-- -----------------------------------------------------------------------
-- BANME script by TTB
-- -----------------------------------------------------------------------
-- OPs get also notification by PM (if enabled)
-- v3.1  28-02-05
-- Also thanx to Piderman & Tejo
-- -----------------------------------------------------------------------
-- Added -> set the minimum of the ban
-- Added -> Kill command by user (fake or real)
-- Changed -> MENU :)
-- Changed -> OP notification
-- ------------------------------------------------------------------------
-- To do -> timeban with your own leave message (reason)
-- ------------------------------------------------------------------------
-- NOTE: If opNote = "2" your BOT (regmybot setting) won't be registered!!
-- ------------------------------------------------------------------------

-- ## Change this to what you like ## --

-->> Bot & Hubname
Bot = "[BOT]PLAY" -- NAME of your BANME bot  >:)
hubname = "Dutch DVD hub" -- NAME of your wonderful hub

-->> Your commands
Baninfocmd = "#banhelp" -- info "how do I get banned?!"
Bancmd = "#banme" -- your BANME command
Disconnectcmd = "#disconnect" -- your disconnect command
Killcmd = "#killme" -- your KILL command

-->> OP Notification
opNote = "2" -- "0" no notification to OP's
-- "1" notification to your defined Bot (1st setting)
-- "2" notification to OP-Chat

-->> Time of your Timebans
minBan = 1 -- Default = 1 min. minimum Timeban. No quotes needed here
maxBan = 1440 -- 1440 min = 24 hours. No quotes needed here

-->> BE CAREFUL WITH THIS SETTING!
kill = "2" -- "0" = disabled (default)
-- "1" = enabled (user will be KILLED!!)
-- "2" = disconnect the user (user will be shocked..)

-->> REG your bot if you don't use the name of a BOT that already exists!
regmybot = "0" -- REG your BANME bot? -> "1" (default) else "0"
-- Please read the NOTE above!!!

-->> Now you are finished with the configuration :)


-- ## Don't change below ## --

--> REGBOT <--
function Main()
 if (opNote ~= "2") then
  if (regmybot == "1") then
frmHub:RegBot(Bot)
  end
 end
end

--> DATA <--
function DataArrival(curUser, data)
   if (strsub(data, 1, 1) == "<" ) then
    data=strsub(data,1,strlen(data)-1)
    s,e,cmd = strfind(data,"%b<>%s+(%S+)")
    if (cmd == Baninfocmd) then
     if curUser.bOperator then
      curUser:SendData(Bot, Header..MainInfo..OPInfo)
     else
      curUser:SendData(Bot, Header..MainInfo)
     end
     return 1
    elseif (cmd == Disconnectcmd) then
     local s,e,reason= strfind(data,"%b<>%s+%S+%s+(.*)")
     DiscMe(curUser, data)
     return 1
    elseif (cmd == Killcmd) then
     KillMe(curUser)
     return 1
    elseif (cmd == Bancmd) then
     local s,e,time= strfind(data,"%b<>%s+%S+%s+(%A+)")
      if time == nil then
       curUser:SendData(Bot, "Syntax error! Please use: "..Bancmd.."

The final version of this script will be also changed in LUA5... I have only one thing to do left, timeban with leave message. I hope I can make some time to make that.

Just wondering also who uses this script... I didn't get any reply's. I know the script is more funny then functional...

*edit* Disconnect bug fixed...

Greetz