Ircing :: Writing a tcl script

Hey… i have been made manager of #Karachi on undernet Yey Cheeze!!

Asif transfered #Karachi to me as he got busy with his routine life. so now i am the manager

“Mein hoon DON”

“Mein hoon DON” :p

I have made ajji incharge of every thing out there ! He is being craving me for setting up bots but i truly don’t have that much time but today.. finally i got sick of those freaking bots out there on #Karachi and decided to code a script that will most probably wipe out the problem of floods in #Karachi!

Couple of months back undernet had introduced a new channel mode i.e. mode +D

Which is

If a channel is set to +D users joining the channel wont be shown until something “happens to them”. This means, a user joins the channel and remains “hidden” till he speaks, gets opped/voiced etc. Only at this point the join will be displayed. This mode is to prevent the disruption of channel discussions where lots of users are joining.

If the channel is set to -D again and there are still “hidden” users left, the server will set mode +d until the last one is visible or left the channel.

“Hidden” users are shown by /names -d #channel.

If you /whois a user who is in a channel with +D set and the user is not “visible” there yet, you’ll see that channel prefixed by a < sign. i.e. <#delaychannel NOTE: mode +D isn’t available on all servers yet, it will come with ircu2.10.12

How ever as far as i see its been available on all of the servers now !

So what next #karachi is already on Mode +m Users get voiced and then they are able to speak Adding mode +D would be great if we are able to find a way by which Only those users who are not banned in bot can get voice !! and the rest don’t.

Having this idea in my mind got a couple of codes and they were far huge and i was not able to understand single one of them … So i decided to write my own with a little code snippet about raw commands in my hand from “” I started of coding .

In which i got confused couple of times /msg’ed Guvnor but he was of no use :p Now coming back to the script

Here comes the code.

# Inital concept was taken out from forum cheers to them!!
# The script is still in beta phases!
# Dont rip if you use it atleast give some credit.
# Works on Undernet to make it work on other networks you have to tweak with raws
set modeD(channel) "#Karachi"
# set the mode to either 'o' or 'v', nothing else!
set modeD(mode) "v"
bind time - "* * * *" modeD:time
bind raw - 355 modeD:raw353
bind raw - 315 modeD:raw353
bind raw - 352 modeD:raw352

proc modeD:raw352 {from raw arg} {
global modeD
set host [lindex $arg 3]
set host "*!*@$host"
set nick [lindex $arg 5]
if { [isban $host $modeD(channel)] || [isban [maskhost $host] $modeD(channel)] || [isban $host]|| [isban [maskhost $host]] } {
#If Reached here The user is in blacklist host!
putquick "MODE $modeD(channel) +v $nick"
putcmdlog "MODE $modeD(channel) +v $nick"


proc modeD:time {min hour day month year} {
global modeD
if {[validchan $modeD(channel)]} {
if {[regexp {D|d} [lindex [getchanmode $modeD(channel)] 0]]} {
putquick "NAMES -d $modeD(channel)" -next
putcmdlog "Doing -d "

proc modeD:raw353 {from raw arg} {
global modeD
putcmdlog "I am in modeD:raw353"
set channel [lindex [split $arg] 2]
putcmdlog "$arg"
if {[set mode $modeD(mode)] == ""} {
set mode "v"
if {![string equal -nocase $channel $modeD(channel)]} { return }
putcmdlog "$arg"
set list2 [lindex [split $arg :] 1]
putcmdlog "$list2"
foreach user [lindex [split $arg :] 1] {
if {$user != "" && (![onchan $user $channel] || (![isop $user $channel] && ![isvoice $user $channel]))} {
putquick "WHO $user"
putlog "Voice In +D mode Created by fyre aka Azeem.- Especially for #Karachi"

The above code snippet can do the Job !!! It works on undernet! 🙂 and Works Fine on my channel! If any one of you intend to use it .. Don’t remove the credits!! Alteast or give some credit if you use it or change it.. 😀

Signing off!!



~ by Azeem on December 3, 2007.

2 Responses to “Ircing :: Writing a tcl script”

  1. heh hanafi handed over to you eh? i gotta figure out what to do with #p as well.

  2. Yeah hand it ova to youth 😀 b/w you can use the above script i got rid of most of flood related issues via it.!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: