BlackList script using .ini's

By GrimReaper on May 15, 2013

So, I was thinking earlier today, I haven't written a proper mIRC script in a while.. So I decided to restart using my mIRC bot to which I will code again from scratch.

I have since written a BlackList script using .ini files.

Triggers:

!BLAdd Nick <Kick Message (Optional)>
!BLDel Nick

I will eventually be updating it more so you can check the list via PM, And that if the user is not on the channel OR Network, You are able to remove it manually via the host which is saved in the file.

(NOTE:) Just in case people don't know, I use both the nick Peer and GrimReaper while I am on GeekShed.. I tend to vary which one I use every now and again.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Black List script by Peer ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;        Start Setup        ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Replace the ! for a character of your choice!
alias -l BLChar { return ! }

; This is the Default Kick Message, Please change it to your desired message.
alias -l BLDefKM { return You have been added to my BlackList.. Good bye. }

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;         End Setup         ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

on *:TEXT:*:#: {
  if ($nick isop $chan) {
    if ($1 == $+($BLChar,BLAdd)) {
      if (!$2) { msg $chan Error: Please enter a NickName to add to the BlackList. }
      elseif ($ini(BlackList.ini,$+($network,.,$chan),$BLADR($2))) { msg $chan Error: The NickName provided has already been added to the BlackList. }
      else {
        writeini $iif($ini(BlackList.ini,$+($network,$chan),$BLADR($2)),-n) BlackList.ini $+($network,.,$chan) $BLADR($2) $iif($3,$3-,$BLDefKM)
        $iif($2 ison $chan,mode $chan +b $address($2,2))
        $iif($2 ison $chan,kick $chan $2 $readini(BlackList.ini,$+($network,.,$chan),$BLADR($2)))
        msg $chan The User $+(,$2,) has been added to my BlackList with the host  $+ $BLADR($2) $+  .
      }
    }
    elseif ($1 == $+($BLChar,BLDel)) {
      if (!$2) { msg $chan Error: Please enter a NickName to remove from the BlackList. }
      elseif (!$ini(BlackList.ini,$+($network,.,$chan),$BLADR($2))) { msg $chan Error: The NickName provided is not present in the BlackList. }
      else {
        remini BlackList.ini $+($network,.,$chan) $BLADR($2) 
        mode $chan -b $address($2,2)
        msg $chan The User $+(,$2,) has been removed from my BlackList with the host  $+ $BLADR($2) $+  .
      }
    }
  }
}

on @*:JOIN:#: {
  if ($ini(BlackList.ini,$+($network,.,$chan),$BLADR($nick))) {
    mode $chan +b $address($nick,2)
    kick $chan $nick $readini(BlackList.ini,$+($network,.,$chan),$BLADR($nick))
  }
}

alias -l BLADR { return $remove($address($1,2),$chr(33),$chr(42)) }

Comments

Sign in to comment.
blackvenomm666   -  May 15, 2013

looks good grim keep up the good work bud

GrimReaper  -  May 16, 2013

Thanks bud, It's been a while since I coded in mIRC from scratch, Usually I just modify other people's codes or fix other codes for people. So I thought I better get back into it.

H0LLYWOOD  -  May 18, 2013

it would be awesome if you could incorporate which server the bot is banning someone on. Since my personal bot is on multiple networks with the same channel name. Also, I cant get the !BLDel to work for the life of me. Otherwise. Great job. I will soon be stealing this. :D

GrimReaper  -  May 19, 2013

I will work at it H0LLYWOOD, I do have an idea on how to get it to work like that. So it should be easy to accomplish. I shall get to work at it after I finish work later on. :)

H0LLYWOOD  -  Jun 20, 2013

Bump =D

GrimReaper  -  Jun 20, 2013

Hey @H0LLYWOOD, I will work on the script now. :) It's not that much of an edit.

GrimReaper  -  Jun 20, 2013

Ok, Updated. I set it to work on multiple networks with the same channel name. :)

Warriorii  -  Jul 16, 2013

Well just call me a dummy but i cant figure out how to copy it. i'm using internet explorer 8 if that makes a difference. it doesn't look the same as it was before so i figured Hawkee changed it. I can't hi-lite it either

blackvenomm666  -  Jul 21, 2013

use google chrome it's better

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.