Ban Assistance Dialog

By GrimReaper on Nov 16, 2010

Screenshots

This is a Ban Assist Dialog.

It is a Menubar, Channel and nicklist menu item, There are a few Pre-Defined Kick messages integrated into the dialog.

Update: Updated with Teen's idea.. made the code a few line's smaller which is always better ;p Thanks Teen.

Update #2: Added the Extended mode ban's and when you first load the dialog on a network, It will version the server to check what it is running, I have only added for it to work on InspIRCd and Unreal server's. Anything else will show up as Unknown and will only allow +b with no extended ban.

You /may/ have to restart/Re-Connect to the network to get the Ext Ban type's to show up. :/

menu channel,menubar,nicklist {
  Ban Assist:dialog $iif($dialog(ban_assist),-v,-m ban_assist) ban_assist
}
dialog ban_assist {
  title "Ban Assist Dialog by Danneh"
  size -1 -1 203 130
  option dbu
  box "Nicknames:", 1, 3 3 66 108
  list 4, 6 10 59 97, size
  box "Options:", 5, 73 3 127 108
  combo 6, 101 14 95 50, size drop
  text "Ban Type:", 7, 76 15 25 8
  text "Example:", 8, 76 43 25 8
  text "", 9, 76 50 120 8
  text "Custom Kick message:", 10, 76 73 53 8, hide
  edit "", 11, 76 79 120 10, hide autohs
  button "Kick", 12, 77 94 37 12
  button "Kick/Ban", 13, 118 94 37 12
  button "Ok", 14, 50 115 37 12, ok
  button "Cancel", 15, 109 115 37 12, cancel
  text "Kick Message:", 16, 76 61 34 8
  combo 17, 110 60 86 50, size drop
  button "Ban Only", 18, 159 94 37 12
  combo 19, 110 29 86 50, size drop
  text "Ext Ban Type:", 20, 76 30 34 8
  menu "File", 2
  item "Close", 3, 2
}
on *:DIALOG:ban_assist:init:*: {
  if (!$ini(ircd.ini,$network,version)) { .version }
  if ($readini(ircd.ini,$network,version) == UnrealIRCd) { didtok $dname 19 124 Normal|~q:|~n:|~q: and ~n: }
  if ($readini(ircd.ini,$network,version) == InspIRCd) { didtok $dname 19 124 Normal|m:|n:|O:|m: and n: }
  if ($readini(ircd.ini,$network,version) == Unknown) { did -a $dname 19 Normal }
  didtok $dname 6 124 1|2|3|4|5
  didtok $dname 17 124 Spamming|Abusive Language|Caps|No PM Permission|Personal Attacks|Bad Attitude|Custom
  var %a = 1
  while (%a <= $nick($active,0)) {
    did -a $dname 4 $nick($active,%a)
    inc %a
  }
}
on *:DIALOG:ban_assist:menu:3: { dialog -x ban_assist }
on *:DIALOG:ban_assist:sclick:4,6,12,13,17-19: {
  if (($did == 4) && ($did(6).sel)) { did -ra $dname 9 $address($did(ban_assist,4).seltext,$did(6).sel) }
  if ($did == 6) { did -ra $dname 9 $address($did(ban_assist,4).seltext,$did(6).sel) }
  if ($did == 12) {
    if ($did(17) != Custom) {
      did -h $dname 10,11
      if ($did(ban_assist,4).seltext == $null) { noop $input(Please select a nick to kick.,o) }
      else {
        if ($did(17) == Spamming) { kick $active $did(ban_assist,4).seltext Spamming is not tolerated here. }
        elseif ($did(17) == Abusive Language) { kick $active $did(ban_assist,4).seltext Please watch your language. We want everyone to feel welcome here. }
        elseif ($did(17) == Caps) { kick $active $did(ban_assist,4).seltext Talking in caps is considered yelling, annoying, and rude. Please turn them off. Thanks. }
        elseif ($did(17) == No PM Permission) { kick $active $did(ban_assist,4).seltext You may not PM/DCC/Notice/Query/CTCP users without their expressed permission. }
        elseif ($did(17) == Personal Attacks) { kick $active $did(ban_assist,4).seltext Personal attacks are not tolerated here. }
        elseif ($did(17) == Bad Attitude) { kick $active $did(ban_assist,4).seltext Your attitude is not conducive to the desired environment. }
      }
    }
    if ($did(17) == Custom) { 
      did -v $dname 10,11
      if ($did(11) == $null) { noop $input(Please enter a Custom Kick Message.,o) }
      else { kick $active $did(ban_assist,4).seltext $did(11) }
    }
  }
  if ($did == 13) {
    if ($did(17) != Custom) {
      did -h $dname 10,11
      if ($did(ban_assist,4).seltext == $null) { noop $input(Please select a nick to kick.,o) }
      else {
        if ($did(ban_assist,19).seltext == Normal) { 
          if ($did(17) == Spamming) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext Spamming is not tolerated here. }
          elseif ($did(17) == Abusive Language) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext Please watch your language. We want everyone to feel welcome here. }
          elseif ($did(17) == Caps) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext Talking in caps is considered yelling, annoying, and rude. Please turn them off. Thanks. }
          elseif ($did(17) == No PM Permission) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext You may not PM/DCC/Notice/Query/CTCP users without their expressed permission. }
          elseif ($did(17) == Personal Attacks) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext Personal attacks are not tolerated here. }
          elseif ($did(17) == Bad Attitude) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext Your attitude is not conducive to the desired environment. }
        }
        else {
          if ($did(19).seltext == ~q:) { var %a = mode $active +b ~q: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == ~n:) { var %a = mode $active +b ~n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == ~q: and ~n:) { var %a = mode $active +bb ~q: $+ $address($did(ban_assist,4).seltext, $did(6)) ~n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == m:) { var %a = mode $active +b m: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == n:) { var %a = mode $active +b n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == O:) { var %a = mode $active +b O: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == m: and n:) { var %a = mode $active +b m: $+ $address($did(ban_assist,4).seltext, $did(6)) n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(19).seltext == Normal) { var %a = mode $active +b $address($did(ban_assist,4).seltext, $did(6)) }
          elseif ($did(17) == Spamming) { var %b = kick $active $did(ban_assist,4).seltext Spamming is not tolerated here. }
          elseif ($did(17) == Abusive Language) { var %b = kick $active $did(ban_assist,4).seltext Please watch your language. We want everyone to feel welcome here. }
          elseif ($did(17) == Caps) { var %b = kick $active $did(ban_assist,4).seltext Talking in caps is considered yelling, annoying, and rude. Please turn them off. Thanks. }
          elseif ($did(17) == No PM Permission) { var %b = kick $active $did(ban_assist,4).seltext You may not PM/DCC/Notice/Query/CTCP users without their expressed permission. }
          elseif ($did(17) == Personal Attacks) { var %b = kick $active $did(ban_assist,4).seltext Personal attacks are not tolerated here. }
          elseif ($did(17) == Bad Attitude) { var %b = kick $active $did(ban_assist,4).seltext Your attitude is not conducive to the desired environment. }
          %a | %b
        }
      }
    }
    if ($did(17) == Custom) { 
      did -v $dname 10,11
      if ($did(11) == $null) { noop $input(Please enter a Custom Kick Message.,o) }
      else { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) | kick $active $did(ban_assist,4).seltext $did(11) }
    }
  }
  if ($did == 17) { 
    if ($did(17) != Custom) { did -h $dname 10,11 }
    elseif ($did(17) == Custom) { did -v $dname 10,11 }
  }
  if ($did == 18) {
    if ($did(ban_assist,4).seltext == $null) { noop $input(Please select a nick to Ban.,o) }
    elseif ($did(19).seltext != Normal) {
      if ($did(19).seltext == ~q:) { mode $active +b ~q: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == ~n:) { mode $active +b ~n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == ~q: and ~n:) { mode $active +bb ~q: $+ $address($did(ban_assist,4).seltext, $did(6)) ~n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == m:) { mode $active +b m: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == n:) { mode $active +b n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == O:) { mode $active +b O: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == m: and n:) { mode $active +b m: $+ $address($did(ban_assist,4).seltext, $did(6)) n: $+ $address($did(ban_assist,4).seltext, $did(6)) }
      elseif ($did(19).seltext == Normal) { mode $active +b $address($did(ban_assist,4).seltext, $did(6)) }
    }
  }
}
RAW 002:*:{ 
  if (!$ini(ircd.ini,$network,version)) {
    if (Unreal isin $2-) { writeini ircd.ini $network version UnrealIRCd }
    if (InspIRCd isin $2-) { writeini ircd.ini $network version InspIRCd }
    elseif (!$istok(Unreal|InspIRCd,$2-,124)) { writeini ircd.ini $network version Unknown }
  }
}
RAW 351:*:{
  if (!$ini(ircd.ini,$network,version)) {
    if (Unreal isin $2-) { writeini ircd.ini $network version UnrealIRCd }
    elseif (InspIRCd isin $2-) { writeini ircd.ini $network version InspIRCd }
    elseif (!$istok(Unreal|InspIRCd,$2-,124)) { writeini ircd.ini $network version Unknown }
  }
}

Comments

Sign in to comment.
Callumlord   -  Mar 26, 2011

Great, love it :)

 Respond  
Cheiron   -  Nov 18, 2010

loaded the new code up and went to test on my bot.. not sure if its cause it has a vhost or not... but the extended bans did not show on the dialogue when expanded

 Respond  
GrimReaper   -  Nov 18, 2010

Updated with the idea from PuNkTuReD.. Still need to implement Teen's idea. but figuring it out will be the problem. lol well for me anyways >_>

 Respond  
Aucun50   -  Nov 17, 2010

That's a different way of going about it, personally I like the same thing over and over but that's just me ;) Either way it's works and that's what matters.

 Respond  
Jethro   -  Nov 17, 2010

Auncun50, I personally don't fancy the mass if statements, let alone the repetition of a routine. I know that goto isn't favored by many folks, and it indeed can make a code look untidy. But there is another way involving the use of $replace, which I believe will be more clearly and legible:

else {
  var %a Spamming is not tolerated here.
  var %b Please watch your language. We want everyone to feel welcome here.
  var %c Talking in caps is considered yelling, annoying, and rude. Please turn them off. Thanks. 
  var %d You may not PM/DCC/Notice/Query/CTCP users without their expressed permission.
  var %e Personal attacks are not tolerated here.
  var %f Your attitude is not conducive to the desired environment.
  kick $active $did(ban_assist,4).seltext $replace($did(17),spamming,%a,abusive language,%b,caps,%c,no pm permission,%d,personal attacks,%e,bad attitude,%f)
}

And doing it this way still uses less bytes - 256 bytes in comparison to the original.

 Respond  
Aucun50   -  Nov 17, 2010

Imo Jethro_, that looks sloppy. I like the if's over goto loops.

 Respond  
Cheiron   -  Nov 17, 2010

with the extended bans though , i can see a potential problem as they will only affect regular users (no +%@&) so that will have to be addressed. but yeah. would be an interesting option to see

 Respond  
PuNkTuReD   -  Nov 17, 2010

would be sweet if it has other bans like ~q ~c ~n etc

 Respond  
Jethro   -  Nov 17, 2010

Looks like you can use goto for this part of code, which will save the use of repetitive if conditions and some bytes:> else {
if ($did(17) == Spamming) { kick $active $did(ban_assist,4).seltext Spamming is not tolerated here. }
if ($did(17) == Abusive Language) { kick $active $did(ban_assist,4).seltext Please watch your language. We want everyone to feel welcome here. }
if ($did(17) == Caps) { kick $active $did(ban_assist,4).seltext Talking in caps is considered yelling, annoying, and rude. Please turn them off. Thanks. }
if ($did(17) == No PM Permission) { kick $active $did(ban_assist,4).seltext You may not PM/DCC/Notice/Query/CTCP users without their expressed permission. }
if ($did(17) == Personal Attacks) { kick $active $did(ban_assist,4).seltext Personal attacks are not tolerated here. }
if ($did(17) == Bad Attitude) { kick $active $did(ban_assist,4).seltext Your attitude is not conducive to the desired environment. }
}to:

else {
  var %x kick $active $did(ban_assist,4).seltext | goto $did(17)
  :spamming | %x Spamming is not tolerated here. | halt
  :abusive language | %x Please watch your language. We want everyone to feel welcome here. | halt
  :caps | %x Talking in caps is considered yelling, annoying, and rude. Please turn them off. Thanks.  | halt
  :no pm permission | %x You may not PM/DCC/Notice/Query/CTCP users without their expressed permission. | halt
  :personal attacks | %x Personal attacks are not tolerated here. | halt
  :bad attitude | %x Your attitude is not conducive to the desired environment. | halt
}
 Respond  
Cheiron   -  Nov 17, 2010

nice update and a job well done.

 Respond  
GrimReaper   -  Nov 17, 2010

Thanks for the feedback guys. :) I have updated the code with Teen's idea. If you think of anything else that /could/ be done to it. Just lemme know. :p

 Respond  
PuNkTuReD   -  Nov 17, 2010

nice script mate.
should shorten it using teens suggestion tho

 Respond  
cupcake   -  Nov 16, 2010

LoL too funny ..

 Respond  
Jethro   -  Nov 16, 2010

Has anyone said something like biting into the moist, foam-like texture of a cupcake, getting his or her mouth all watering just by imagining it? Wait, for a minute there, this sound's got some kind of innuendo to it...

 Respond  
cupcake   -  Nov 16, 2010

Yes, that would be cute think of a cupcake being eaten until crumbs ...thats another one of my nicks. Everytime i go to a channel someone tries to eat me...LOL cupcake AKA crumbs, you find one let me know blackvenomm666

 Respond  
Cheiron   -  Nov 16, 2010

nice clean dialogue there GrimReaper as per your norm.. i have one suggestion howver for you that you may wish to look at. for the ban mask .. you currently select a number .. but it might be prudent to include somewhere on the dialogue the format of the number ...

ie !ident@hostmask , !@.isp , etc etc against the number so they know what type of ban does what when they are selecting.

otherwise .. sweeeeeeet.. gets a 10 and a like

 Respond  
blackvenomm666   -  Nov 16, 2010

what if you got an image of a cupcake that disspears little by little as if its being eaten cupcake? that would be pretty nifty

 Respond  
cupcake   -  Nov 16, 2010

Can't take it anymore ..love that image GrimReaper, makes me wanna get a animated image, only problem not much i can do with a cupcake...could have it's cherry pop off. That sounded bad..anyway cool image only second one i liked alot, other is jackster35-1.
Your image has made me laugh more then once ..omg my life is boring :(

 Respond  
GrimReaper   -  Nov 16, 2010

Thanks guys. :)

Teen I will see what I can do about implementing that. :)

 Respond  
_Teen_   -  Nov 16, 2010

i made an edit using this

if (($did == 4) && ($did(6).sel)) { did -ra $dname 9 $address($did(ban_assist,4).seltext,$did(6).sel) }
  if ($did == 6) { did -ra $dname 9 $address($did(ban_assist,4).seltext,$did(6).sel) }

and worked

by the way, would be a nice idea, if there is a combo to choose the rooms =)

 Respond  
Sorasyn   -  Nov 16, 2010

GETITOFFGETITOFFGETITOFF Lol.

Nice snippet :D

 Respond  
GrimReaper   -  Nov 16, 2010

One screenshot added. :p

I'm glad you like it cupcake ^_^

 Respond  
cupcake   -  Nov 16, 2010

Post a small image of the snippet helps people...had fun kicking and banning myself in another script...LOL by the way good job again:)

 Respond  
GrimReaper   -  Nov 16, 2010

Thanks cupcake. I generally /try/ to make thing's for other's user's so they find it useful. If I don't find it usefull I won't make it. :p

 Respond  
cupcake   -  Nov 16, 2010

Been playing with it in my testing room, good job. Need to put up a image so people can see, new people looking.

 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.