All pastes #1323101 Raw Edit

ArbiterHighlight

public text v1 · immutable
#1323101 ·published 2009-01-30 21:04 UTC
rendered paste body
; Written by Arbiter (not_thebest@hotmail.com) with help from xnemesis. Credit is given where needed.
; Written in mIRC version 6.21 and may malfunction in newer versions.
; Email me any bug reports or suggestions or talk to me in #Tittyhump on SwiftIRC (irc.SwiftIRC.net)
; Script version: 1.6

on *:DEOP:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($opnick == $me) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) You lost OP status. }
      if (%highlight.yeah == on) {
        if ($appactive == $false) {
          if ($window(@Highlights)) { closewin | showpopup $nick took your OP status in $chan on $network }
          else { showpopup $nick took your OP status in $chan on $network }
        }
        else { 
          echo -at $c.(*** Highlight: $nick took your OP status in $chan on $network)
        }
      }
    }
  }
}
on *:DEHELP:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($hnick == $me) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) You lost HALFOP status. }
      if (%highlight.yeah == on) {
        if ($appactive == $false) {
          if ($window(@Highlights)) { closewin | showpopup $nick took your HALFOP status in $chan on $network }
          else { showpopup $nick took your HALFOP status in $chan on $network }
        }
        else { 
          echo -at $c.(*** Highlight: $nick took your HALFOP status in $chan on $network)
        }
      }
    }
  }
}
on *:DEVOICE:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($vnick == $me) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) You lost VOICE status. }
      if (%highlight.yeah == on) {
        if ($appactive == $false) {
          if ($window(@Highlights)) { closewin | showpopup $nick took your VOICE status in $chan on $network }
          else { showpopup $nick took your VOICE status in $chan on $network }
        }
        else { 
          echo -at $c.(*** Highlight: $nick took your VOICE status in $chan on $network)
        }
      }
    }
  }
}
on *:VOICE:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($vnick == $me) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) You recived VOICE status. }
      if (%highlight.yeah == on) {
        if ($appactive == $false) {
          if ($window(@Highlights)) { closewin | showpopup $nick gave you VOICE status in $chan on $network }
          else { showpopup $nick gave you VOICE status in $chan on $network }
        }
        else { 
          echo -at $c.(*** Highlight: $nick gave you VOICE status in $chan on $network)
        }
      }
    }
  }
}
on *:HELP:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($hnick == $me) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) You recived HALFOP status. }
      if (%highlight.yeah == on) {
        if ($appactive == $false) {
          if ($window(@Highlights)) { closewin | showpopup $nick gave you HALFOP status in $chan on $network }
          else { showpopup $nick gave you HALFOP status in $chan on $network }
        }
        else { 
          echo -at $c.(*** Highlight: $nick gave you HALFOP status in $chan on $network)
        }
      }
    }
  }
}
on *:OP:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($opnick == $me) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) You recived OP status. }
      if (%highlight.yeah == on) {
        if ($appactive == $false) {
          if ($window(@Highlights)) { closewin | showpopup $nick gave you OP status in $chan on $network }
          else { showpopup $nick gave you OP status in $chan on $network }
        }
        else { 
          echo -at $c.(*** Highlight: $nick gave you OP status in $chan on $network)
        }
      }
    }
  }
}
on *:NOTICE:*:?:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($highlighttrig($1-) == yes) || ($+(*,$me,*) iswm $1-) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,NOTICE,/,$network,:) $replace($strip($1-),$chr(34),$chr(39)) }
      if (%highlight.yeah == on) {
        if ($fullscreen == 0) {
          if ($hget(saidnicks)) { hfree saidnicks }
          if ($($+(%,highlightspam.,$address($nick,2)),2) >= %highlight.times) { 
            .ignore -u60 $nick 2 
            if ($appactive == $false) {
              if ($window(@Highlights)) { closewin | showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
              else { showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
            }
            else { echo -at $c.(*** $nick triggerd your highlight spam protection! Ignoring user for 60 seconds.) }
            unset $+(%,highlightspam.,$address($nick,2)) 
            halt
          }
          if ($appactive == $false) {
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
            if ($window(@Highlights)) { closewin | showpopup $nick highlighted you in notice on $network saying $strip($qt($1-)) }
            else { showpopup $nick highlighted you in notice on $network saying $strip($qt($1-)) }
          }
          else { 
            echo -at $c.(*** Highlight: $nick highlighted you in notice on $network saying $strip($qt($1-)))
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
          }
        }
        else {
          if !$hget(saidnicks,$nick) && %highlight.notice == on {
            .notice $nick I currently have a full-screen application running and may not respond to $&
              to your highlight for some time. Your highlight message has been logged.
            hadd -m saidnicks $nick nohighlight
          }
        }
      }
    }
  }
}
on *:ACTION:*:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($highlighttrig($1-) == yes) || ($+(*,$me,*) iswm $1-) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) $replace($strip($1-),$chr(34),$chr(39)) }
      if (%highlight.yeah == on) {
        if ($fullscreen == 0) {
          if ($hget(saidnicks)) { hfree saidnicks }
          if ($($+(%,highlightspam.,$address($nick,2)),2) >= %highlight.times) { 
            .ignore -u60 $nick 2 
            if ($appactive == $false) {
              if ($window(@Highlights)) { closewin | showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
              else { showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
            }
            else { echo -at $c.(*** $nick triggerd your highlight spam protection! Ignoring user for 60 seconds.) }
            unset $+(%,highlightspam.,$address($nick,2)) 
            halt
          }
          if ($appactive == $false) {
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
            if ($window(@Highlights)) { closewin | showpopup $nick highlighted you in $chan on $network saying $strip($qt($1-)) }
            else { showpopup $nick highlighted you in $chan on $network saying $strip($qt($1-)) }
          }
          else { 
            echo -at $c.(*** Highlight: $nick highlighted you in $chan on $network saying $strip($qt($1-)))
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
          }
        }
        else {
          if !$hget(saidnicks,$nick) && %highlight.notice == on {
            .notice $nick I currently have a full-screen application running and may not respond to $&
              to your highlight for some time. Your highlight message has been logged.
            hadd -m saidnicks $nick nohighlight
          }
        }
      }
    }
  }
}
on *:ACTION:*:?:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($highlighttrig($1-) == yes) || ($+(*,$me,*) iswm $1-) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,QUERY,/,$network,:) $replace($strip($1-),$chr(34),$chr(39)) }
      if (%highlight.yeah == on) {
        if ($fullscreen == 0) {
          if ($hget(saidnicks)) { hfree saidnicks }
          if ($($+(%,highlightspam.,$address($nick,2)),2) >= %highlight.times) { 
            .ignore -u60 $nick 2 
            if ($appactive == $false) {
              if ($window(@Highlights)) { closewin | showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
              else { showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
            }
            else { echo -at $c.(*** $nick triggerd your highlight spam protection! Ignoring user for 60 seconds.) }
            unset $+(%,highlightspam.,$address($nick,2)) 
            halt
          }
          if ($appactive == $false) {
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
            if ($window(@Highlights)) { closewin | showpopup $nick highlighted you in $chan on $network saying $strip($qt($1-)) }
            else { showpopup $nick highlighted you in $chan on $network saying $strip($qt($1-)) }
          }
          else { 
            echo -at $c.(*** Highlight: $nick highlighted you in $chan on $network saying $strip($qt($1-)))
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
          }
        }
        else {
          if !$hget(saidnicks,$nick) && %highlight.notice == on {
            .notice $nick I currently have a full-screen application running and may not respond to $&
              to your highlight for some time. Your highlight message has been logged.
            hadd -m saidnicks $nick nohighlight
          }
        }
      }
    }
  }
}
on *:TEXT:*:#:{
  if ($chan == $active) && ($appactive == $true) { halt }
  if ($highlighttrig($1-) == yes) || ($+(*,$me,*) iswm $1-) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,$chan,/,$network,:) $replace($strip($1-),$chr(34),$chr(39)) }
      if (%highlight.yeah == on) {
        if ($fullscreen == 0) {
          if ($hget(saidnicks)) { hfree saidnicks }
          if ($($+(%,highlightspam.,$address($nick,2)),2) >= %highlight.times) { 
            .ignore -u60 $nick 2 
            if ($appactive == $false) {
              if ($window(@Highlights)) { closewin | showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
              else { showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
            }
            else { echo -at $c.(*** $nick triggerd your highlight spam protection! Ignoring user for 60 seconds.) }
            unset $+(%,highlightspam.,$address($nick,2)) 
            halt
          }
          if ($appactive == $false) {
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
            if ($window(@Highlights)) { closewin | showpopup $nick highlighted you in $chan on $network saying $strip($qt($1-)) }
            else { showpopup $nick highlighted you in $chan on $network saying $strip($qt($1-)) }
          }
          else { 
            echo -at $c.(*** Highlight: $nick highlighted you in $chan on $network saying $strip($qt($1-)))
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
          }
        }
        else {
          if !$hget(saidnicks,$nick) && %highlight.notice == on {
            .notice $nick I currently have a full-screen application running and may not respond to $&
              to your highlight for some time. Your highlight message has been logged.
            hadd -m saidnicks $nick nohighlight
          }
        }
      }
    }
  }
}
on *:TEXT:*:?:{
  if ($query($nick) == $active) && ($appactive == $true) { halt }
  if ($highlighttrig($1-) == yes) || ($+(*,$me,*) iswm $1-) {
    if ($isbot($nick) == $false) { 
      if (%logging.high == on) { write highlights.txt $time([hh:nn:ssTT]) $+($nick,/,QUERY,/,$network,:) $replace($strip($1-),$chr(34),$chr(39)) }
      if (%highlight.yeah == on) {
        if ($fullscreen == 0) {
          if ($hget(saidnicks)) { hfree saidnicks }
          if ($($+(%,highlightspam.,$address($nick,2)),2) >= %highlight.times) { 
            .ignore -u60 $nick 2 
            if ($appactive == $false) {
              if ($window(@Highlights)) { closewin | showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
              else { showpopup $nick triggerd your highlight spam protection! Ignoring user for 60 seconds. }
            }
            else { echo -at $c.(*** $nick triggerd your highlight spam protection! Ignoring user for 60 seconds.) }
            unset $+(%,highlightspam.,$address($nick,2)) 
            halt
          }
          if ($appactive == $false) {
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
            if ($window(@Highlights)) { closewin | showpopup $nick highlighted you in query on $network saying $strip($qt($1-)) }
            else { showpopup $nick highlighted you in query on $network saying $strip($qt($1-)) }
          }
          else { 
            echo -at $c.(*** Highlight: $nick highlighted you in query on $network saying $strip($qt($1-)))
            if (%highlightprot.status == on) { inc -u $+ %highlight.secs $+(%,highlightspam.,$address($nick,2)) }
          }
        }
        else {
          if !$hget(saidnicks,$nick) && %highlight.notice == on {
            .notice $nick I currently have a full-screen application running and may not respond to $&
              to your highlight for some time. Your highlight message has been logged.
            hadd -m saidnicks $nick nohighlight
          }
        }
      }
    }
  }
}
menu channel,status {
  -
  &Highlights:highlightlogs
}
menu nicklist {
  -
  &Highlights
  .&Highlight Logs:highlightlogs
  .-
  .&Add user to exceptions:write exceptions.txt $1 | echo -at $c.(*** Added user $qt($1) to highlight exceptions list.)
  -
}
dialog highlight {
  title Highlights $+($chr(40),$lines(highlights.txt),$chr(41))
  size -1 -1 180 175
  option dbu
  tab "Logs", 1, 1 1 178 172
  list 4, 5 25 170 77, tab 1 size extsel hsbar vsbar
  box "Logs", 5, 3 17 174 88, tab 1
  button "Delete", 6, 74 108 37 12, tab 1
  button "Clear logs", 7, 74 124 37 12, tab 1
  text "Written by Mr_White (AKA Arbiter) @ not_thebest@hotmail.com", 8, 74 155 96 14, tab 1
  button "Close", 10, 128 124 37 12, tab 1 cancel
  radio "Enable logging", 11, 8 117 50 10, group tab 1
  radio "Disable logging", 12, 8 131 50 10, tab 1
  button "Update bots", 13, 128 108 37 12, tab 1
  radio "Enable Highlights", 17, 8 144 52 10, group tab 1
  radio "Disable Highlights", 18, 8 158 53 10, tab 1
  box "Switches", 19, 5 108 58 61, tab 1
  button "Send selected highlights to clipboard", 31, 74 139 91 12, tab 1
  tab "Triggers", 2
  combo 20, 6 25 168 84, tab 2 size
  box "Triggers", 21, 3 17 174 95, tab 2
  button "Add", 22, 5 116 37 12, tab 2
  button "Delete", 23, 5 132 37 12, tab 2
  button "Clear", 24, 47 116 37 12, tab 2
  button "Close", 25, 47 132 37 12, tab 2 cancel
  text "Note: Regex is not supported in the highlight triggers. To add a highlight, input it in the edit box above and click Add. To delete a trigger, highlight the trigger in the list box and click Delete. Clear removes all triggers.", 26, 88 114 89 46, tab 2
  check "Notice user saying you'll get back to them", 32, 6 160 113 10, tab 2
  text "When a full-screen application is                      running:", 38, 4 146 80 13, tab 2
  tab "Spam protection/Exceptions", 3
  radio "On", 27, 9 104 19 10, group tab 3
  radio "Off", 28, 31 104 21 10, tab 3
  box "Protection status", 29, 6 97 50 20, tab 3
  box "Options", 33, 6 121 46 33, tab 3
  text "Secs:", 34, 9 130 18 8, tab 3
  text "Times:", 35, 9 142 20 8, tab 3
  edit "", 36, 30 129 20 10, tab 3
  edit "", 37, 30 141 20 10, tab 3
  button "Save", 39, 10 157 37 12, tab 3
  combo 42, 7 24 167 70, tab 3 size
  box "Exceptions", 41, 4 16 173 79, tab 3
  button "Update service bots", 45, 57 136 37 17, tab 3 multi
  button "Close", 48, 57 157 37 12, tab 3 cancel
  button "Add", 43, 57 120 37 12, tab 3
  button "Delete", 44, 98 120 37 12, tab 3
  button "Edit:", 46, 60 103 20 12, tab 3
  edit "", 47, 83 104 92 10, tab 3
  text "Select an item from the listbox and edit it in the edit box. When satisfied click the 'Edit:' button to save it.", 14, 99 139 74 27, tab 3
  button "Clear", 30, 139 120 37 12, tab 3
  tab "About", 15
  text "This script was written in mIRC version 6.21. In this code I have used various aliases not coded by me (for instance, the /showpopup alias was written by xnemesis), but credit is given in the script where it's needed. When the script is first loaded all options are off by default. If you find any bugs or have any suggestions email me at not_thebest@hotmail.com or join #Tittyhump on SwiftIRC. (/server -m irc.SwiftIRC.net -j #Tittyhump).", 16, 6 18 169 52, tab 15
  link "tittyhump.heliohost.org", 9, 62 103 59 8, tab 15
}
on *:dialog:highlight:*:*:{ 
  if ($devent == init) && ($did == 0) { updateit | did -z highlight 4 }
  if ($devent == sclick) {
    if ($did == 31) {
      if ($did(highlight,4,0).sel == 1) { clipboard $did(highlight,4).seltext }
      else {
        var %p = 1, %nums = $did(highlight,4,0).sel
        clipboard
        while (%p <= %nums) { 
          clipboard -na $did(highlight,4,$did(highlight,4,%p).sel)
          inc %p
        }
      }
    }
    if ($did == 6) { 
      if ($did(highlight,4).seltext) {
        var %f = $read(highlights.txt,nw,$+(*,$gettok($did(highlight,4).seltext,5-,32),*))
        write -dw $+ $qt(%f) highlights.txt
        did -d highlight 4 $did(highlight,4).sel
        dialog -t highlight Highlights $+($chr(40),$lines(highlights.txt),$chr(41))
      }
      else { echo -at $c.(*** Error: You must select a highlight to delete!) }
    }
    if ($did == 7) { write -c highlights.txt | echo -at $c.(*** Highlight log files cleared.) | did -r highlight 4 | dialog -t highlight Highlights $+($chr(40),$lines(highlights.txt),$chr(41)) }
    if ($did == 11) { 
      if (%logging.high == on) { echo -at $c.(*** Error: Highlight logging is already on!) }
      else {
        set %logging.high on
        echo -at $c.(*** Highlight logging enabled.)
      }
    }
    if ($did == 12) { 
      if (%logging.high == off) { echo -at $c.(*** Error: Highlight logging is already off!) }
      else {
        set %logging.high off
        echo -at $c.(*** Highlight logging disabled.)
      }
    }
    if ($did == 10) { dialog -x highlight }
    if ($did == 13) { botlist }
    if ($did == 17) { 
      if (%highlight.yeah == on) { echo -at $c.(*** Error: Highlight alerts are already on!) }
      else {
        set %highlight.yeah on
        echo -at $c.(*** Highlight alerts are now enabled.)
      }
    }
    if ($did == 18) { 
      if (%highlight.yeah == off) { echo -at $c.(*** Error: Highlight alerts are already off!) }
      else {
        set %highlight.yeah off
        echo -at $c.(*** Highlight alerts are now disabled.)
      }
    }
    if ($did == 23) { 
      if ($did(highlight,20).seltext) {
        var %l = $read(highlighttrigs.txt,nw,$+(*,$did(highlight,20).seltext,*))
        write -dw $+ $qt(%l) highlighttrigs.txt %l
        did -d highlight 20 $did(highlight,20).sel
        did -d highlight 20 0 
      }
      else { echo -at $c.(*** Error: You must select a highlight to delete!) }
    }
    if ($did == 24) { if ($input(Are you sure you want to clear all highlight triggers?,yvuw,Clear all?) == $yes) { write -c highlighttrigs.txt | echo -at $c.(*** Highlight triggers cleared.) | did -r highlight 20 } }
    if ($did == 25) { dialog -x highlight }
    if ($did == 22) { 
      if ($strip($did(highlight,20).text)) {
        write highlighttrigs.txt $did(highlight,20).text 
        did -a highlight 20 $did(highlight,20).text
        did -d highlight 20 0 
      }
      else { echo -at $c.(*** Error: You must supply a highlight trigger!) }
    }
    if ($did == 27) { set %highlightprot.status on | echo -at $c.(*** Highlight spam protection is now on.) }
    if ($did == 28) { set %highlightprot.status off | echo -at $c.(*** Highlight spam protection is now off.) }
    if ($did == 32) {
      if (%highlight.notice != on) {
        set %highlight.notice on
        echo -at $c.(*** When a full-screen application is running and you are $&
          highlighted, you will now notice the user with "I currently have a $&
          full-screen application running and may not respond to $&
          to your highlight for some time. Your highlight message has been logged.")
      }
      else { 
        set %highlight.notice off 
        echo -at $c.(*** You will no longer notice users when a full-screen application is running.)
      }
    }
    if ($did == 39) { 
      if ($did(highlight,36).text != $null) && ($did(highlight,37).text != $null) { 
        set %highlight.secs $did(highlight,36).text 
        set %highlight.times $did(highlight,37).text
        echo -at $c.(*** Highlight protection will now ignore user (when activated) after $did(highlight,37).text times in $did(highlight,36).text seconds.)
      }
      else { echo -at $c.(*** Error: Secs/times values cannot be blank! Using defualt values instead.) | set %highlight.secs 15 | set %highlight.times 5 | did -r highlight 36,37 | did -a highlight 37 5 | did -a highlight 36 15 }
    }
    if ($did == 43) { 
      if ($strip($did(highlight,42).text)) {
        write exceptions.txt $did(highlight,42).text 
        var %uline = $didwm(highlight,42,*Service Bots*)
        did -i highlight 42 %uline $did(highlight,42).text   
        did -d highlight 42 0 
      }
      else { echo -at $c.(*** Error: You must supply an exception to add!) }
    }
    if ($did == 44) {
      var %w = 1
      while (%w <= $lines(exceptions.txt)) {
        if ($did(highlight,42).seltext === $read(exceptions.txt,%w)) { var %yes = 1 | .break }
        else { inc %w } 
      }
      if ($var(%yes)) {
        var %h = $read(exceptions.txt,nw,$did(highlight,42).seltext)
        write -dw $+ $qt(%h) exceptions.txt 
        var %lewl = $didwm(highlight,42,$+(*,$did(highlight,42).seltext),*))
        did -d highlight 42 %lewl
        did -d highlight 42 0 
      }
      else { echo -at $c.(*** Error: You can't delete non-custom exceptions!) }
    }
    if ($did == 45) { 
      botlist
      did -r highlight 42
      if ($lines(exceptions.txt) != 0) {
        var %y = 1 
        did -a highlight 42 $+($str(—,13),User Nicks,$str(—,13))
        while (%y <= $lines(exceptions.txt)) {
          did -a highlight 42 $read(exceptions.txt,n,%y)
          inc %y
        }
      }
      if ($lines(bots.txt) != 0) { did -a highlight 42 $+($str(—,13),Service Bots,$str(—,12)) }
      .timerbotlist 1 1 showbots
    }
    if ($did == 46) { 
      if ($did(highlight,47).text != $null) {
        var %old = $did(highlight,42).seltext, %new = $did(highlight,47).text, %line = $read(exceptions.txt,nw,$+(*,$did(highlight,42).text,*))
        var %line = $readn
        write -l $+ %line exceptions.txt %new
        var %hut = $didwm(highlight,42,$+(*,%old,*))
        did -o highlight 42 %hut %new
        did -d highlight 42 0 
      }
      else { echo -at $c.(*** Error: You must have an exception in the edit box to submit it.) }
    }
    if ($did == 30) { if ($input(Are you sure you want to clear all highlight exceptions?,yvuw,Clear all?) == $yes) { write -c exceptions.txt | echo -at $c.(*** Highlight exceptions cleared.) | closeit did -f highlight 3 } }
    if ($did == 42) { 
      var %i = 1
      while (%i <= $lines(bots.txt)) {
        if ($did(highlight,42).seltext === $read(bots.txt,%i)) { var %yes = 1 | .break }
        else { inc %i } 
      }
      if *———* !iswm $did(highlight,42).seltext && !$var(%yes) {
        did -n highlight 47
        did -e highlight 46
        did -r highlight 47
        did -a highlight 47 $did(highlight,42).seltext
      }
      else {
        did -m highlight 47
        did -b highlight 46
      }
    }
  }
}
alias showbots {
  var %o = 1
  while (%o <= $lines(bots.txt)) {
    did -a highlight 42 $read(bots.txt,n,%o)
    inc %o
  }
}
alias highlighttrig {
  var %i = 1
  while (%i <= $lines(highlighttrigs.txt)) {
    if ($+(*,$read(highlighttrigs.txt,%i),*) iswm $1-) { return yes | .break }
    else { inc %i } 
  }
} 
alias -l updateit {
  did -c highlight $iif(%logging.high == on,11,12)  
  did -c highlight $iif(%highlight.yeah == on,17,18)
  var %i = 1 
  while (%i <= $lines(highlights.txt)) {
    did -a highlight 4 $read(highlights.txt,n,%i)
    inc %i
  }
  var %l = 1 
  while (%l <= $lines(highlighttrigs.txt)) {
    did -a highlight 20 $read(highlighttrigs.txt,n,%l)
    inc %l
  }
  if ($lines(exceptions.txt) != 0) {
    var %a = 1 
    did -a highlight 42 $+($str(—,13),User Nicks,$str(—,13))
    while (%a <= $lines(exceptions.txt)) {
      did -a highlight 42 $read(exceptions.txt,n,%a)
      inc %a
    }
  }
  if ($lines(bots.txt) != 0) {
    var %o = 1 
    did -a highlight 42 $+($str(—,13),Service Bots,$str(—,12))
    while (%o <= $lines(bots.txt)) {
      did -a highlight 42 $read(bots.txt,n,%o)
      inc %o
    }
  }
  did -c highlight $iif(%highlightprot.status == on,27,28)  
  did -a highlight 36 %highlight.secs 
  did -a highlight 37 %highlight.times
  did -m highlight 47
  did -b highlight 46
  if (%highlight.notice == on) { did -c highlight 32 }
}
alias -l c. { return $+($chr(3),$color(info text).dd,$1-,$chr(3)) }
alias -l closeit { 
  dialog -x highlight 
  dialog -dm highlight highlight
  if ($1) { $1- }
}
alias highlightlogs {
  if ($dialog(highlight)) { dialog -x highlight | dialog -dm highlight highlight }
  else { dialog -dm highlight highlight }
}
on ^*:NOTICE:*:?: {
  if ($nick = BotServ && %botlist) {
    haltdef
    if ($regex($1-,/^(\S+) \(\w+@\w+\.\w+(?:\.\w+)*\)$/Si)) { write bots.txt $regml(1) }
    elseif ($regex($1-,/^(\d+) bots available\.$/Si)) {
      unset %botlist
      echo -at $c.(Finished writing bots to Botlist. There are currently $regml(1) bots available. This alias was written by Kol of SwiftIRC.)
    }
  }
}
alias isbot {
  if ($read(bots.txt,r,/^\Q $+ $$1 $+ \E$/)) || ($read(exceptions.txt,r,/^\Q $+ $$1 $+ \E$/i)) { return $true }
  else { return $false }
}
alias botlist {
  echo -at $c.(Updating BotList)
  write -c bots.txt
  write bots.txt NickServ
  write bots.txt ChanServ
  write bots.txt BotServ
  write bots.txt MemoServ
  bs botlist
  set %botlist on
}
alias closewin { window -c @Highlights }
alias showPopup {
  window -pBdk0w0o +blL @Highlights $calc(%highlights.screenx - 250) $calc(%highlights.screenx - 92) 250 63 Tahoma 10
  drawfill @Highlights $popc1 $popc1 0 0
  var %highlights.nxtln = $true, %highlights.popup = $1-, %highlights.y = 9
  while (%highlights.nxtln) {
    if ($len(%highlights.popup) > 50) {
      if (%highlights.y == 39) {
        drawtext -p @Highlights $popc2 10 %highlights.y $mid(%highlights.popup,0,46) ...
        unset %highlights.nxtln
        unset %highlights.popup
      }
      else {
        drawtext -p @Highlights $popc2 10 %highlights.y $mid(%highlights.popup,0,50)
        %highlights.popup = $mid(%highlights.popup,51,$mid(%highlights.popup,51,0))
      }
    }
    else {
      drawtext -p @Highlights $popc2 10 %highlights.y %highlights.popup
      unset %highlights.nxtln
      unset %highlights.popup
    }
    inc %highlights.y 10
  }
  .timerwin 1 3 window -c @Highlights
}
alias -l popc1 { return 15 }
alias -l popc2 { return 01 }
on *:start:{
  %highlights.screenx = $window(-1).w 
  %highlights.screeny = $window(-1).h
}
on *:load:{
  %highlights.screenx = $window(-1).w 
  %highlights.screeny = $window(-1).h
  %highlight.secs = 15
  %highlight.times = 5
  %highlightprot.status = off
  %highlight.notice = off
  %highlight.yeah = off
  write -c bots.txt NickServ
  write bots.txt ChanServ
  write bots.txt BotServ
  write bots.txt MemoServ
  echo -a $c.(You've just loaded Arbiters highlight script! Right click anywhere on a channel and select "Highlights" to configure the script. All options are off by default.)
  botlist
}