Kick/chan protection

By brottor on Aug 25, 2005

This snippet will pop up anytime you are kicked. Or you can select it from any menu.
It is a dialog that will set %kickchan and %kicknick when someone is kicked in any channel. It has various options, including an away system and a shitlist.
When you open the snippet for the first time it will prompt you if you want it to create a readme file using /write. If you hit Ok then it will prompt you if you want to view the readme file or not.

menu @* {
  close:/window -c $active
}
menu * {
  kick/chanprot:/dialog -md kick kick
}
on *:kick:*: {
  if ($nick = chanserv) {
    cs unban $chan
    cs akick $chan del $me
    cs invite $chan
    join $chan
    HALT
  }
  else {
    set %kickchan $chan
    set %kicknick $nick
    window @kickchannick
    aline -c @kickchannick $nick kicked $knick in $chan on $fulldate
  }
  if ($knick == $me) {
    dialog -md kick kick
  }
}
dialog kick {
  Title "kick"
  size -1 -1 250 300
  option pixels
  tab "kickstuff",6, 1 1 250 300
  button "k&ick",1, 10 50 70 50, tab 6
  button "b&an",2, 170 50 70 50, tab 6
  button "aki&ck",3, 90 50 70 50, tab 6
  button "joi&n",4, 10 100 70 50, tab 6
  button "in&vite",5, 170 100 70 50, tab 6
  button "&unban",8, 90 100 70 50, tab 6
  tab "chanprotection",7
  button "mode&rated",9, 10 50 70 50, tab 7
  button "&private",10, 170 50 70 50, tab 7
  button "invite(only&)",11, 90 50 70 50, tab 7
  button "unmo&derated",12, 10 100 70 50, tab 7
  button "un&private",13, 170 100 70 50, tab 7
  button "uninvite&(only)",14, 90 100 70 50, tab 7
  button "&secret",15, 10 160 70 50, tab 7
  button "unse&cret",16, 10 210 70 50, tab 7
  button "li&mit",17, 170 160 70 50, tab 7
  button "u&nlimit",18, 170 210 70 50, tab 7
  button "k&ey",19, 90 160 70 50, tab 7
  button "unke&y",20, 90 210 70 50, tab 7
  tab "control",25
  button "op",26, 10 50 70 50, tab 25
  button "deop",27, 10 100 70 50, tab 25
  button "admin",28, 90 50 70 50, tab 25
  button "deadmin",29, 90 100 70 50, tab 25
  button "voice",30, 10 160 70 50, tab 25
  button "devoice",31, 10 210 70 50, tab 25
  button "halfop",32, 90 160 70 50, tab 25
  button "dehalfop",33, 90 210 70 50, tab 25
  button "aop",34, 170 50 70 50, tab 25
  button "deaop",35, 170 100 70 50, tab 25
  button "sop",36, 170 160 70 50, tab 25
  button "unsop",37, 170 210 70 50, tab 25
  button "add access",50, 1 30 60 25, tab 25  
  button "rmv access",67, 61 30 60 25, tab 25
  button "clr accss lst",52, 121 30 60 25, tab 25
  button "lst access",85, 181 30 60 25, tab 25
  tab "awaystuff",21
  button "go away",22, 10 50 70 50, tab 21
  button "go away(msg)",23, 10 100 70 50, tab 21
  button "comeback",24, 125 150 100 100, tab 21
  tab "shitlist",38
  button "addashit",39, 10 50 70 50, tab 38
  button "delashit",40, 170 100 70 50, tab 38
  button "listshits",94,100 100 50 200, tab 38
}
on *:dialog:kick:sclick:94: {
  if (%exvar == $null) {
    echo -a No one is on your shitlist!
  }
  else {
    echo -a %exvar
  }
}
on *:dialog:kick:sclick:85: {
  cs access $active list
}
on *:dialog:kick:sclick:50: {
  cs access $active add $$?="who's are you giving access in $chan to?" $$?="how much access?"
}
on *:dialog:kick:sclick:67: {
  cs access $active del $$?="who are you removing from $active $+ 's access list?"
}
on *:dialog:kick:sclick:52: {
  cs access $active clear
  echo -a ACCESS FOR $ACTIVE CLEARED!
}
on *:dialog:kick:sclick:39: {
  addexvar $$?="who do u want to add to your shitlist?"
}
on *:dialog:kick:sclick:40: {
  if (%exvar == $null) {
    echo -a There is noone on your shitlist yet!
    HALT
  }
  else {
    remexvar $$?="who do u wish to remove from your shitlist?" | echo -a removed
    if (%exvar) {
      echo -a shitlist contains: %exvar
    }
  }
}
menu nicklist {
  shitlist stuff
  .add $1 to your shitlist:/addexvar $$1
  .rem $1 from your shitlist: {
    if (%exvar) {
      if ($$1 isin %exvar) {
        remexvar $1
        echo -a Removed $$1 from your shitlist...
        HALT
      }
      else { 
        echo -a $$1 isnt on your shitlist yet!
      }
      if (%exvar) {
        echo -a %exvar
      }
      else {
        echo -a No one is on your shitlist now.
      }
    }
  }
}
#ChanProtReadmetxtwriting off
on *:dialog:kick:init:0: {
  echo -s $$?="If you want a readme file for this script put ANYTHING in the box and hit 'ok' otherwise hit cancel withought putting anything in the box"
  write ChanProtReadme.txt First things first thank you for using my script. Ok then, the kickstuff (1st tab) is pretty much
  write ChanProtReadme.txt channel protection when someone kicks someone it sets %kickchan and %kicknick to the channel and nick.
  write ChanProtReadme.txt The kick and ban buttons will kick and ban the person on that channel. The rest of then will unakick
  write ChanProtReadme.txt you, invite you, unban you, and /join the channel.
  write ChanProtReadme.txt 
  write ChanProtReadme.txt The 'chanprotection' (tab 2) will add or remove modes to the active channel.
  write ChanProtReadme.txt 
  write ChanProtReadme.txt The 'control' (tab 3) gives voice/halfops/ops/admins/and access to people. The access is ChanServ only. The AOPS/SOPS are ChanServ only.
  write ChanProtReadme.txt 
  write ChanProtReadme.txt The 'awaystuff' (tab 4) sets you away or sets you back.
  write ChanProtReadme.txt 
  write ChanProtReadme.txt The 'shitlist' (tab 5,final tab) adds and removes people from your shitlist.
  disable #ChanProtReadmetxtwriting
  echo -s $$?="If you want to run the readme type ANYTHING in the box and press 'ok' now. Otherwise hit cancel.(the readme is now in your mIRC directory named 'ChanProtReadme.txt"
  run ChanProtReadme.txt
}
#ChanProtReadmetxtwriting end
on *:dialog:kick:init:0: {
  echo -a opened Brottor's Kick and Channel protection!
}
on *:dialog:kick:close:0: {
  echo -a closed Brottor's Kick and Channel Protection!
}
on *:dialog:kick:sclick:1: {
  kick %kickchan %kicknick No kicking!
}
on *:dialog:kick:sclick:2: {
  ban %kickchan %kicknick
}

on *:dialog:kick:sclick:3: {
  cs akick %kickchan del $me
}
on *:dialog:kick:sclick:4: {
  join %kickchan
}
on *:dialog:kick:sclick:5: {
  cs invite %kickchan $me
}
on *:dialog:kick:sclick:8: {
  cs unban %kickchan $me
}
on *:dialog:kick:sclick:17: {
  mode $active +l $$?="what limit would you like to set?"
}
on *:dialog:kick:sclick:18: {
  mode $active -l
}
on *:dialog:kick:sclick:19: {
  mode $active +k $$?="what key would you like to set?"
}
on *:dialog:kick:sclick:20: {
  mode $active -k $$?="what key would you like to take out?"
}
on *:dialog:kick:sclick:9: {
  mode $active +m
}
on *:dialog:kick:sclick:10: {
  mode $active +p
}
on *:dialog:kick:sclick:11: {
  mode $active +i
}
on *:dialog:kick:sclick:12: {
  mode $active -m
}
on *:dialog:kick:sclick:13: {
  mode $active -p
}
on *:dialog:kick:sclick:14: {
  mode $active -i
}
on *:dialog:kick:sclick:15: {
  mode $active +s
}
on *:dialog:kick:sclick:16: {
  mode $active -s
}
on *:dialog:kick:sclick:22: {
  set %iamaway on
  amsg I am away
  window @away
}
on *:dialog:kick:sclick:23: {
  set %awaymessage $$?="why are you going away?"
  amsg I am away: %awaymessage
  window @away
}
on *:dialog:kick:sclick:24: {
  amsg I am back %awaymessage
  unset %awaymessage
  unset %iamaway
}
on *:dialog:kick:sclick:26: {
  mode $active +o $$?="who do u want to op?"
}
on *:dialog:kick:sclick:27: {
  mode $active -o $$?="who do u want to deop?"
}
on *:dialog:kick:sclick:28: {
  mode $active +a $$?="who do u want to admin?"
}
on *:dialog:kick:sclick:29:  {
  mode $active -a $$?="who do u want to deadmin?"
}
on *:dialog:kick:sclick:30: {
  mode $active +v $$?="who do u want to voice?"
}
on *:dialog:kick:sclick:31: {
  mode $active -v $$?="who do u want to devoice?"
}
on *:dialog:kick:sclick:32: {
  mode $active +h $$?="who do u want to halfop?"
}
on *:dialog:kick:sclick:33: {
  mode $active -h $$?="who do u want to dehalfop?"
}
on *:dialog:kick:sclick:34: {
  cs aop $active add $$?="who do u wish to add to aop list?"
}
on *:dialog:kick:sclick:35: {
  cs aop $active del $$?="who do u wish to del from aop list?"
}
on *:dialog:kick:sclick:36: {
  cs sop $active add $$?="who do u wish to add to sop list?"
}
on *:dialog:kick:sclick:37: {
  cs sop $active del $$?="who do u wish to del from sop list?"
}
menu * {
  awaystuff
  .goaway
  ..standard I am away:/set %iamaway on | amsg i am away! | window @away | aline @away I went away on $fulldate | timer 0 1 /inc %seconds | timer 0 60 /inc %mins
  ..away (msg):/set %awaymessage $$?="why are you 'away'?" | amsg I am away: %awaymessage | window @away | aline @away I went away on $fulldate | timer 0 1 /inc %seconds | timer 0 60 /inc %mins
  .comeback
  ..comeback!: {
    unset %iamaway
    amsg I am back %awaymessage
    unset %awaymessage
    aline @away I came back on $fulldate after %seconds secs of being away
    aline @away that is %mins minutes
    unset %seconds
    unset %mins
    timer1 off
    timer2 off
  }
}

on *:text:*:*: {
  if (%iamaway == on) && ($chan == $null) {
    msg $nick I am away!
    aline -c @away $nick said: $1- on $fulldate in $chan
  }
  elseif ($me isin $1-) && (%iamaway == on) && (%alreadysaidaway != on) {
    msg $chan I am away!
    set %alreadysaidaway on
    aline -c @away $nick said: $1- on $fulldate in $chan
    timer 1 100 /unset %alreadysaidaway
  }
  elseif ($me isin $1-) && (%awaymessage != $null) && (%alreadysaidaway != on) {
    msg $chan $me is away: %awaymessage
    set %alreadysaidaway on
    timer 1 100 /unset %alreadysaidaway
  }
  elseif (%awaymessage != $null) && ($chan == $null) {
    msg $nick $me is away: %awaymessage
    set %alreadysaidaway on
    timer 1 100 /unset %alreadysaidawaypm
  }
}

on *:join:#: {
  if ($me isop #) && ($nick isin %exvar) {
    inc %shitkicks
    kick $chan $nick SHITlisted! < %shitkicks >
    ban $chan $address,2
  }
}
alias addexvar { 
  if ($$1 isin %exvar) {
    echo -a $1 is already on your shitlist!
    HALT
  }
  else {
    %exvar = $addtok(%exvar,$1,32) 
    echo -a Your shitlist contains: %exvar so far.
  } 
  else { set %exvar $1 | echo -a Your shitlist has: %exvar so far. }
} 
alias remexvar { 
  if (%exvar) { 
    if ($1 isin %exvar) { 
      %exvar = $remtok(%exvar,$v1,32) 
      if (%exvar) {
        echo -a Your shitlist has: %exvar on it.
      }
      else {
        echo -a Shitlist is empty...
      }
    } 
  }
}

Comments

Sign in to comment.
vampslim   -  Jan 26, 2006

sucks.

 Respond  
brottor   -  Aug 29, 2005

lol kk

 Respond  
Yoinx   -  Aug 29, 2005

yeah I was just letting you know, even though everyone makes an issue of it. Its just an asthetics issue more than making the code work. If you like them in there, I say leave em in

 Respond  
brottor   -  Aug 29, 2005

i took them out didnt i yoinx?

 Respond  
Yoinx   -  Aug 29, 2005

The /\'s wont hurt the code, they just make it look sloppy.

 Respond  
xDaeMoN   -  Aug 29, 2005

Corne already posted a sample of commands in your snippet that has \"/\" which is not really needed since it\'s in the remotes section.

 Respond  
brottor   -  Aug 29, 2005

??????? what?

 Respond  
Corne   -  Aug 28, 2005

/echo, /cs, /inc, /(un)set

 Respond  
brottor   -  Aug 28, 2005

supergeo what unnecessary /s?

 Respond  
supergeo   -  Aug 25, 2005

Er.. remove the unnecessary /\'s

 Respond  
brottor   -  Aug 25, 2005

heh nice making scripts @ school

 Respond  
F*U*R*B*Y*   -  Aug 25, 2005

code looks alright but i just took a quick look i\'m currently @ skool

 Respond  
brottor   -  Aug 25, 2005

Any comments bugs or anything?

 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.