Channel Blacklist for bots

Platform:  mIRC
Published  Jun 09, 2010
Updated  Jun 23, 2010
This is a simple blacklist script for bots or yourself.

!blacklist <chan> ;; adds a channel to the blacklist
!deblacklist <chan> ;; removes a channel of the blacklist
!blist <none or chan> ;; returns the blacklisted channels and if the channel your on or the requested channel is blacklisted at the moment.

Its obvious that the channel isnt blacklisted if you can trigger the command on the channel itself. I included it anyways.


Change #staffchan in your own channel.

goes fast by: CTRL + F then put searchterm #staffchan and replace with #ownchannel

Post bellow for fixes and feedback.
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;; **Blacklist Script** ;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
;;; ;;;;;;; ;;;;;;;;; ;;;;;;;;;; *Version 1.12* ;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *Made By: BielieĀ© ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;; ;;;;;;;;; ;;;;;; *Change #Staffchan ;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; in ur own channel* ;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;
;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;

#blacklist on
on $*:text:/^[!.@]blacklist/:#:{
if (%flood [ $+ [ $nick ] ]) { return }
set -eu3 %flood [ $+ [ $nick ] ] $true
;;; %random is a value for the writeini's. Without it, it doesnt work
var %random = 1
;;only ops may use this command. Change this to anything u like. (Example: !ishop !isvoice)
if ($nick !isop #staffchan) {
notice $nick You have to be an op to use this command.
halt
}

;;its possible to change the notice.
if ($2- == $null) {
notice $nick Please provide a channel to add.
halt
}

;;its possible to change the notice.The others shouldent be changed.
if (%blacklist [ $+ [ $2- ] ]) {
notice $nick This channel already is on the blacklist! Type !deblacklist <#channel> to remove it.
set %blacklist [ $+ [ $2- ] ] $true
writeini -n Blacklist.ini Blacklist $2- %random
halt
}

;;its possible to change the notice.The others shouldent be changed.
if (!%blacklist [ $+ [ $2- ] ]) {
notice $nick Added $2- to the blacklist. The bot wont join this channel untill its deleted.
scon -a msg $2- 14This channel has been added to the 6blacklist14. Parting in6 3 14seconds....
.timer 1 3 scon -a part $2- 2Blacklisted
set %blacklist [ $+ [ $2- ] ] $true
writeini -n Blacklist.ini Blacklist $2- %random
halt
}
}
on $*:text:/^[!.@]deblacklist/:#:{
if (%flood [ $+ [ $nick ] ]) { return }
set -eu3 %flood [ $+ [ $nick ] ] $true

;;only ops may use this command. Change this to anything u like. (Example: !ishop !isvoice)
if ($nick !isop #staffchan) {
notice $nick You have to be an op to use this command.
halt
}
;;its possible to change the notice.
if ($2- == $null) { notice $nick $color1 $+ Please provide a channel to delete. | halt }

;;its possible to change the notice.The others shouldent be changed.
if (%blacklist [ $+ [ $2- ] ]) {
notice $nick $2- is now deleted of the blacklist.
unset %blacklist [ $+ [ $2- ] ]
/remini blacklist.ini Blacklist $2-
halt
}

;;its possible to change the notice.The others shouldent be changed.
if (!%blacklist [ $+ [ $2- ] ]) {
notice $nick I couldnt find $2 on the blacklist.
unset %blacklist [ $+ [ $2- ] ]
/remini blacklist.ini Blacklist $2-
halt
}
}

;;its possible to change the notice.The others shouldent be changed.
on $*:text:/^[!.@]blist/:#:{
if (%flood [ $+ [ $nick ] ]) { return }
set -eu3 %flood [ $+ [ $nick ] ] $true

var %blacklistedchannels = $ini(blacklist.ini,blacklist)

;;its possible to change the notice.The others shouldent be changed.
if ($2- == $null) && (%blacklist [ $+ [ $chan ] ]) {
notice $nick I have currently ( $+ %blacklistedchannels $+ ) channel(s) blacklisted. Retreiving info for channel: $chan $+ . Please wait........
.timer 1 2 notice $nick $chan is on the blacklist. If this isn't right please contact a moderator of #staffchan $+ .
halt
}

;;its possible to change the notice.The others shouldent be changed.
if ($2- == $null) && (!%blacklist [ $+ [ $chan ] ]) {
notice $nick I have currently ( $+ %blacklistedchannels $+ ) channel(s) blacklisted. Retreiving info for channel: $chan $+ . Please wait........
.timer 1 2 notice $nick $chan is not on the blacklist. If this isn't right please contact a moderator of #staffchan $+ .
halt
}

;;its possible to change the notice.The others shouldent be changed.
if (%blacklist [ $+ [ $2 ] ]) {
notice $nick I have currently ( $+ %blacklistedchannels $+ ) channel(s) blacklisted. Retreiving info for channel: $2- $+ . Please wait........
.timer 1 2 notice $nick $2- is on the blacklist. If this isn't right please contact a moderator of #staffchan $+ .
halt
}

;;its possible to change the notice.The others shouldent be changed.
if (!%blacklist [ $+ [ $2 ] ]) {
notice $nick I have currently ( $+ %blacklistedchannels $+ ) channel(s) blacklisted. Retreiving info for channel: $2- $+ . Please wait........
.timer 1 2 notice $nick $2- is not on the blacklist. If this isn't right please contact a moderator of #staffchan $+ .
halt
}
}

;;its possible to change the msg.The others shouldent be changed.
on me:*:JOIN:#: {
if ($chan == %blacklist) {
msg # Sorry but this channel is blacklisted. Parting in 3 seconds....... []2(If you think this isnt right please join #staffchannel)
timer 1 3 part # Blacklisted channel
halt
}
}
#blacklist end

Comments

Sign in to comment.
Bielie   -  Dec 17, 2010
yeah i know :p I guess he meant that i have the same build as a java coder.. But anyways thx for that information :)
 Respond  
Jethro   -  Dec 16, 2010
Bielie wrote:
How can you look like a java coder? You code like a java coder not look like it....
java and msl are two different languages. They have their own grammatical rules to follow. One universal language I know of is regex, which virtually supports all of the scripting languages.
 Respond  
Bielie   -  Dec 16, 2010
How can you look like a java coder? You code like a java coder not look like it....
Anyways i love clean scripting and commenting cuz i want to know what i thought when i made it and want to understand my own scripts 2 years later or more...

Poop :{| mustage
 Respond  
Grant-   -  Sep 10, 2010
You look like a java coder
 Respond  
napa182   -  Sep 10, 2010
Saga_99 Said:
if you record it as $ 2 - join when not recognized by the missing symbol is better to put

on me:*:JOIN:#: {
if ($nick == $me) {
if ($ chan isin% blacklist) {
msg # Sorry but this channel is blacklisted. Parting in 3 seconds....... []2(If you think this isnt right please join #staffchannel)
.timer 1 3 /part # Blacklisted channel
halt

}
}
}


lolwut???
Saga_99 you seem to make no sense...
also next time you post a bit of code... please use code tags. It just makes it easier to read.
code tags ex:
Code
 


 Respond  
Saga_99   -  Sep 10, 2010
if you record it as $ 2 - join when not recognized by the missing symbol is better to put

on me:*:JOIN:#: {
if ($nick == $me) {
if ($ chan isin% blacklist) {
msg # Sorry but this channel is blacklisted. Parting in 3 seconds....... []2(If you think this isnt right please join #staffchannel)
.timer 1 3 /part # Blacklisted channel
halt

}
}
}

^^
 Respond  
Jethro   -  Jun 10, 2010
Bielie, you missed a colon next to the #
on me:*:JOIN:#: {
Although the event can work without it, it still looks complete this way.
 Respond  
jaytea   -  Jun 10, 2010
heya sphex. if you want to perform the check i mentioned in my last post, then you can indeed use that
 Respond  
Bielie   -  Jun 10, 2010
so jaytea whats ur conclusion? Do i use on me:*:JOIN:#: { or not?

BTW u might know me from #MSL im Sphex
 Respond  
jaytea   -  Jun 10, 2010
the 'me' prefix to which Jethro_ is referring is an undocumented feature which is used as he demonstrated (on me:levels:etc) and equivalent to checking if ($nick == $me) inside the event. the extra field is probably due to the fact that using 'me' in the level field should refer to a custom userlevel named 'me'.
 Respond  
Bielie   -  Jun 10, 2010
jethro the script works? Except for the on me:join:#:{ event?

It doesnt make sense but i changed it anyway
 Respond  
Gummo   -  Jun 10, 2010
The syntax for a join event is
Code
 

'me' is a special level, so I can't see how adding a random extra :* would make it work.
 Respond  
Jethro   -  Jun 10, 2010
Wait. After looking at the code closely, I've realized it's still incorrect regarding the on me join. :/ I'm sorry to say, it doesn't work for me the way you put it until I change it to the format I mentioned.
 Respond  
Jethro   -  Jun 10, 2010
why do you need so many text events when you could have used one?
 Respond  
Bielie   -  Jun 09, 2010
Any errors or improvements can be posted bellow.
 Respond  
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.