Typos Highlighter

By Typo on Jun 23, 2008

UPDATED(check bottom of post for info) Typos Highlighter is a script to replace mircs built in highlight functions. It does the same sort of thing mircs does but with total customizing capabilities.

First off it will (if enabled) show highlights in the active window and/or a @Highlight window. The foreground and background color of the messages are adjustable and this is of course on top of the standard mirc type of highlight where it beeps (if enabled) and makes the window button flash and the chan name on that button change color.

It has a logging system you can turn on and off that works a lot like mircs. Every day a new file is started and the date is in the file name. The folder and name for the file is adjustable in the settings section of the control panel.

On top of the logging system there is also a option to save the @highlight window contents to file. This is handy if loging is disabled but the @Highlight window is enabled and has information you need to save.

I have added three ignore lists to the script that you manage on top of the list of words to highlight. The second is the list of channels to completely ignore highlights from, the third is the list of nicknames to completely ignore highlights from and the fourth is a list of words to completely ignore. The second and third are obvious but I will explain the fourth. -
If, for instance, you highlight the word "sad" and do not want it to highlight when someone says "Sader" then you would add "Sader" to the words list so it ignores it. Since Sader is a nickname too you would also add it to that list but that would be obvious.

I have added the ability to the ignore items/words list for it to support wildcards. This means, working with the example above, if your highlighting "sad" you could add "sade" to the ignore item/word list to ignore sader and anything else starting with sade. You can also use "sader* to catch sader and crusader or !sader@somewhere.ok .

I have scripted it to handle single character entries differently then any other kind of highlights. For instance, if I enter "J" in highligh entry box it will not highlight on every J that mirc comes across, it treats it like an initial or a name so "Jack" wouldnt trigger the highlight but "J", "j.", "j!", "J?", "j:" and "j," would. This was for people that have single initial nicknames like me when ppl call me J.

The beeps are even adjustable. You can select between presets for how many beeps and the delay between beeps in milliseconds.

I have also added support to copy your current list of highlight entries in mirc to the scripts highlight list when installing it. It will also check to see if mircs higlight is enabled and if so suggest you disable it, then when unloading the script it will remind you to re-enable it.

Thats all. Enjoy.

Typo

New screenshot of all 7 tabs. This is 7 pictures all pasted into one pic for you to easily view all 7 tabs.
Image

Major Updates!
The dialog has been totally redone. It's very small now and tabbed. The color selection editbox and the beep setting edit boxes have been replaced with drop down menues with presets. Added a second color selection for the background color as well. The "#" is now automatically entered in the channel ignore input field and all the help is now all in a "Help" tab.

A new logging system has been added. When enabled it will log all highlights directly to a file with the current date in the file name. You can chose both the base file name and the folder for the logging files to be written to. Every day a new file will be started just like mircs logging.

If you still just wish to use the @Highlight window for your highlight logging and viewing I have also added the ability to save the contents of that window to a file at any time thru the right click menu.

The script now makes sure mircs sounds are enabled when you enable the highlighters beep(s) and if not warns the user to enable them.

Many other code and wording updates and changes were made as well.

;Begin Typos Highlighter
on *:connect:{
  if (%highlightwindow = yes) { window -ek @Highlight } 
}
on *:load:{ 
  set %highlightcolor 04,00
  set %highlightlogging off
  set %highlightlogfile Highlights
  set %highlightlogfolder $scriptdir
  set %highlightshow yes 
  if ($ebeeps == $true) { set %highlightbeep yes }
  else {
    echo -as Mirc's sounds are diasbled. The highlighter's beeps cannot be enabled until you go into Options (Alt+o), then go into the Sounds section and click the checkbox titled "Enable Sounds".
    set %highlightbeep no 
  }
  set %highlightwindow yes 
  set %highlightbeeptimes 6 
  set %highlightbeepdelay 30 
  if ($input(Would you like to copy mircs currently added highlight names/items over to Typos Highlighter?,y,Please select yes or no.) == $true) {
    var %hlnn = $highlight(0)
    while (%hlnn !<= 0) {
      AddHighlight $highlight(%hlnn)
      dec %hlnn 1
    }
  }
  if ($highlight == $true) { echo -a $timestamp <Attention> You still have mircs built in highlight feature enabled.  It is best to disable these and let Typos Highlighter handle all the highlighting. }
}
menu @highlight {
  <[Typos Highlighter]>
  .Control Panel:dialog -md Highlighter Highlighter
  .Save @Highlight window to file.:savebuf @highlight $sfile($replace($date $+ Highlight $+ $time $+ .txt,/,-,:,),Save Highlight window contents to...,Save)
}
menu nicklist,query,channel,status {
  -
  <[Typos Highlighter]>:dialog -md Highlighter Highlighter
  -
}
on ^*:text:*:#:{ Highlighter reg $nick $strip($1-) }
on ^*:text:*:?:{ HighlighterPM reg $nick $strip($1-) }
on ^*:action:*:#:{ Highlighter act $nick $strip($1-) }
on ^*:action:*:?:{ HighlighterPM act $nick $strip($1-) }
on ^*:notice:*:#:{ Highlighter not $nick $strip($1-) }
on ^*:notice:*:?:{ HighlighterPM not $nick $strip($1-) }
alias Highlighter {
  if ($wordisin($3-) == yes) || ($charisin($3-) == yes) && ($istok(%Highlight.Ignore.Chan,$chan,32) == $false) { 
    if ($active != $chan) && ($istok(%highlight.ignore.names,$2,32) == $false) {
      if (%highlightbeep == yes) { beep %highlightbeeptimes %highlightbeepdelay }
      if (%highlightshow == yes) { echo -a $timestamp $+  $+ %highlightcolor -Channel Highlight # $+ $iif($1 = not,$chr(32) $+ Notice,$iif($1 = act,$chr(32) $+ Action)) $+ - < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightwindow == yes) { if ($window(@Highlight) == $null ) { window -ek @Highlight } | aline -ph @Highlight $timestamp -Channel # $+ - $iif($1 = not,-Notice-,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightlogging == on) { write %highlightlogfolder $+ $replace($date $+ %highlightlogfile $+ .txt,/,-) $timestamp -Channel # $+ - $iif($1 = not,-Notice-,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      window -g2 $chan
      echo $chan $timestamp $+  $+ %highlightcolor -Channel Highlight $+ $iif($1 = not,$chr(32) $+ Notice,$iif($1 = act,$chr(32) $+ Action)) $+ - < $+ $2 $+ $iif($1 = act,,$+ >) $3-
      haltdef
    }
    elseif ($active == $chan) && ($istok(%highlight.ignore.names,$2,32) == $false) {
      if (%highlightwindow == yes) { if ($window(@Highlight) == $null ) { window -ek @Highlight } | aline -ph @Highlight $timestamp -Channel # $+ - $iif($1 = not,-Notice-,$iif($1 = act,Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightlogging == on) { write %highlightlogfolder $+ $replace($date $+ %highlightlogfile $+ .txt,/,-) $timestamp -Channel # $+ - $iif($1 = not,-Notice-,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightbeep == yes) { beep %highlightbeeptimes %highlightbeepdelay }
      echo -a $timestamp $+  $+ %highlightcolor -Channel Highlight $+ $iif($1 = not,$chr(32) $+ Notice,$iif($1 = act,$chr(32) $+ Action)) $+ - < $+ $2 $+ $iif($1 = act,,$+ >) $3-
      haltdef
    }
  }
}
alias HighlighterPM {
  if ($wordisin($3-) == yes) || ($charisin($3-) == yes) && ($istok(%highlight.ignore.names,$2,32) == $false) {
    if ($active != $2) {
      if (%highlightbeep == yes) { beep 6 30 }
      if (%highlightshow == yes) { echo -a $timestamp $+  $+ %highlightcolor -Query Highlight $+ $iif($1 = not,$chr(32) $+ Notice,$iif($1 = act,$chr(32) $+ Action)) $+ - < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightwindow == yes) { if ($window(@Highlight) == $null ) { window -ek @Highlight } | aline -ph @Highlight $timestamp -Query- $iif($1 = not,-Notice,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightlogging == on) { write %highlightlogfolder $+ $replace($date $+ %highlightlogfile $+ .txt,/,-) $timestamp -Query- $iif($1 = not,-Notice,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if ($window(%higlightnick) != $null) { window -g2 $2 }
      echo $2 $timestamp $+  $+ %highlightcolor -Query Highlight $+ $iif($1 = not,$chr(32) $+ Notice,$iif($1 = act,$chr(32) $+ Action)) $+ - < $+ $2 $+ $iif($1 = act,,$+ >) $3-
      haltdef
    } 
    elseif ($active == $2) {
      if (%highlightwindow == yes) { if ($window(@Highlight) == $null ) { window -ek @Highlight } | aline -ph @Highlight $timestamp -Query- $iif($1 = not,-Notice-,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightlogging == on) { write %highlightlogfolder $+ $replace($date $+ %highlightlogfile $+ .txt,/,-) $timestamp -Query- $iif($1 = not,-Notice-,$iif($1 = act,-Action-)) < $+ $2 $+ $iif($1 = act,,$+ >) $3- }
      if (%highlightbeep == yes) { beep 6 30 }
      echo -a $timestamp $+  $+ %highlightcolor -Query Highlight $+ $iif($1 = not,$chr(32) $+ Notice,$iif($1 = act,$chr(32) $+ Action)) $+ - < $+ $2 $+ $iif($1 = act,,$+ >) $3-
      haltdef
    }
  }
}
alias Wordisin {
  tokenize 32 $1-
  if ($1- == $null) || ($numtok(%Highlight.WordEntry,32) < 1) { return no }
  var %wordnum = $numtok(%Highlight.WordEntry,32)
  while (%wordnum > 0) {
    var %hltn = 1
    while ($($ $+ %hltn $+ -,2) != $null) {
      unset %hlc1, unset %hlc2
      if (* $+ $gettok(%Highlight.WordEntry,%wordnum,32) $+ * iswm $($ $+ %hltn,2)) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { var %hlc1 = yes }
      var %hliw = $numtok(%highlight.ignore.words,32)
      while (%hliw > 0) {
        if ($gettok(%highlight.ignore.words,%hliw,32) iswm $($ $+ %hltn,2)) { var %hlc2 = yes }
        dec %hliw 1
      }
      if (%hlc1 == yes) && (%hlc2 != yes) { return yes }
      inc %hltn 1
    }
    dec %wordnum 1
  }
}
alias CharIsIn {
  tokenize 32 $1-
  if ($1- == $null) || ($numtok(%Highlight.CharEntry,32) < 1) { return no }
  var %charnum = $numtok(%Highlight.CharEntry,32)
  while (%charnum > 0) {
    var %hltn = 1
    var %charhlc = $gettok(%Highlight.CharEntry,%charnum,32)
    while ($($ $+ %hltn $+ -,2) != $null) {
      if ($($ $+ %hltn,2) == %charhlc) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { return yes }
      if ($($ $+ %hltn,2) == $(%charhlc $+ $chr(33),2)) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { return yes }
      if ($($ $+ %hltn,2) == $(%charhlc $+ $chr(44),2)) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { return yes }
      if ($($ $+ %hltn,2) == $(%charhlc $+ $chr(46),2)) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { return yes }
      if ($($ $+ %hltn,2) == $(%charhlc $+ $chr(58),2)) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { return yes }
      if ($($ $+ %hltn,2) == $(%charhlc $+ $chr(63),2)) && ($istok(%highlight.ignore.words,$($ $+ %hltn,2),32) != $true) { return yes }
      inc %hltn 1
    }
    dec %charnum 1
  }
}
alias AddHighlight {
  if ($1 == $null) { var %tempword = $$?="Item to add?" }
  else { var %tempword = $$1 }
  if ($len(%tempword) == 1) { 
    if ($istok(%Highlight.WordEntry,%tempword,32) == $true) { echo -a Sorry but %tempword has already been added to the Highlighter list! }
    %Highlight.CharEntry = $addtok(%Highlight.CharEntry,%tempword,32)
    echo -a You have added %tempword to the Highlighter list!
  }
  else {
    if ($istok(%Highlight.WordEntry,%tempword,32) == $true) { echo -a Sorry but %tempword has already been added to the Highlighter list! }
    %Highlight.WordEntry = $addtok(%Highlight.WordEntry,%tempword,32)
    echo -a You have added %tempword to the Highlighter list!
  }
}
alias RemoveHighlight {
  if ($1 == $null) { var %tempword = $$?="Item to remove?" }
  else { var %tempword = $$1 }
  if ($len(%tempword) == 1) { 
    if ($istok(%Highlight.CharEntry,%tempword,32) == $false) { echo -a Sorry but %tempword is not in the Highlighter list. }
    %Highlight.CharEntry = $remtok(%Highlight.CharEntry,%tempword,32)
    echo -a You have removed %tempword from the Highlighter list!
  }
  else {
    if ($istok(%Highlight.WordEntry,%tempword,32) == $false) { echo -a Sorry but %tempword is not in the Highlighter list. }
    %Highlight.WordEntry = $remtok(%Highlight.WordEntry,%tempword,32)
    echo -a You have removed %tempword from the Highlighter list!
  }
}
alias AddHLChan {
  if ($1 == $null) { var %tempchan = #$$?=(Channel_to_add?) }
  else { var %tempchan = $$1 }
  if $left(%tempchan,1) != $chr(35) { echo -a That is not a valid channel name. }
  if ($istok(%Highlight.Ignore.Chan,%tempchan,32) == $true) { echo -a That channel has already been added to the Typos Highlighter ignore channels list! }
  else {
    %Highlight.Ignore.Chan = $addtok(%Highlight.Ignore.Chan,%tempchan,32)
    echo -a You have added %tempchan to the Typos Highlighter ignore channels list!
  }
}
alias RemoveHLChan {
  if ($1 == $null) { var %tempchan = #$$?=(Channel_to_Remove?) } 
  else { var %tempchan = $$1 }
  if ($left(%tempchan,1) != $chr(35)) { echo -a That is not a valid channel name. }
  if ($istok(%Highlight.Ignore.Chan,%tempchan,32) == $false) { echo -a %tempchan is not in the Typos Highlighter ignore channels list. }
  else { 
    %Highlight.Ignore.Chan = $remtok(%Highlight.Ignore.Chan,%tempchan,32)
    echo -a You have removed %tempchan from the Typos Highlighter ignore channels  list!
  }
}
alias AddHighlightNames {
  if ($1 == $null) { var %tempword = $$?="Name to add?" }
  else { var %tempword = $1 }
  if ($istok(%Highlight.Ignore.Names,%tempword,32) == $true) { echo -a Sorry but %tempword has already been added to the Highlighter ignored names list! }
  else { 
    %Highlight.Ignore.Names = $addtok(%Highlight.Ignore.Names,%tempword,32)
    echo -a You have added %tempword to the Highlighter ignored names list!
  }
}
alias RemoveHighlightNames {
  if ($1 == $null) { var %tempword = $$?="Name to remove?" }
  else { var %tempword = $1 }
  if ($istok(%Highlight.Ignore.Names,%tempword,32) == $false) { echo -a Sorry but %tempword is not in the Highlighter ignored names list. }
  else { %Highlight.Ignore.Names = $remtok(%Highlight.Ignore.Names,%tempword,32)
    echo -a You have removed %tempword from the Highlighter ignored names list!
    goto end
  }
}
alias AddHighlightWords {
  if ($1 == $null) { var %tempword = $$?="Word to add?" }
  else { var %tempword = $1 }
  if ($istok(%Highlight.WordEntry,%tempword,32) == $true) { echo -a Sorry but %tempword has already been added to the Highlighter ignored words list! }
  else {
    %Highlight.Ignore.Words = $addtok(%Highlight.Ignore.Words,%tempword,32)
    echo -a You have added %tempword to the Highlighter ignored words list!
  }
}
alias RemoveHighlightWords {
  if ($1 == $null) { var %tempword = $$?="Word to remove?" }
  else { var %tempword = $1 }
  if ($istok(%Highlight.Ignore.Words,%tempword,32) == $false) { echo -a Sorry but %tempword is not in the Highlighter ignored words list. }
  else { 
    %Highlight.Ignore.Words = $remtok(%Highlight.Ignore.Words,%tempword,32)
    echo -a You have removed %tempword from the Highlighter ignored words list!
  }
}

on *:dialog:Highlighter:init:0:{
  did -a Highlighter 48 To use the highlighter, simply add a word or item in the word or item tab. An item can be a name, a phone number, a host or anything that can appear in normal text, actions or notices. The other three lists are for ignoring. You can ignore entire channels, individual people or any word/item you wish. 
  did -a Highlighter 48 Say for instance, you added the word sad to the highlighter and do not want it to highlight when someone says 'Sader' then you would add Sader to the ignore words/items list so it ignores it. Remember, just adding Sader in the nickname box would only ignore anything Sader says thereby not highlighting
  did -a Highlighter 48 anything from him. We add it to the ignore word/item list also to ignore when other people say Sader.  I have added the ability to the ignore items/words list for it to support wildcards. This means, working with the example above, if your highlighting sad you could add sade* to the ignore item/word list to ignore sader and anything else starting with sade. You can also use *sader* to catch sader and crusader or !sader@somewhere.ok .
  if (%HighlightShow == yes)  did -c Highlighter 32
  if (%HighlightBeep == yes) did -c Highlighter 31
  if (%HighlightWindow == yes) did -c Highlighter 30
  if (%highlightlogging == on) did -c highlighter 57
  var %temploopynum = 1
  while (%temploopynum < 3) {
    if (%temploopynum == 1) { var %temploopyvar = 41 }
    elseif (%temploopynum == 2) { var %temploopyvar = 49 }
    did -a Highlighter %temploopyvar 0 White
    did -a Highlighter %temploopyvar 1 Black
    did -a Highlighter %temploopyvar 2 Blue
    did -a Highlighter %temploopyvar 3 Green
    did -a Highlighter %temploopyvar 4 Red
    did -a Highlighter %temploopyvar 5 Brown
    did -a Highlighter %temploopyvar 6 Purple
    did -a Highlighter %temploopyvar 7 Orange
    did -a Highlighter %temploopyvar 8 Yellow
    did -a Highlighter %temploopyvar 9 Light Green
    did -a Highlighter %temploopyvar 10 Cyan
    did -a Highlighter %temploopyvar 11 Light Cyan
    did -a Highlighter %temploopyvar 12 Light Blue
    did -a Highlighter %temploopyvar 13 Pink
    did -a Highlighter %temploopyvar 14 Grey
    did -a Highlighter %temploopyvar 15 Light Grey
    inc %temploopynum
  }
  var %temploopynum = 1
  while (%temploopynum < 26) {
    did -a highlighter 27 %temploopynum
    inc %temploopynum
  }
  did -a highlighter 38 30
  did -a highlighter 38 60
  did -a highlighter 38 90
  did -c highlighter 41 $calc($left(%highlightcolor,2)+1)
  did -c highlighter 49 $calc($right(%highlightcolor,2)+1)
  did -c Highlighter 27 %highlightbeeptimes
  did -c Highlighter 38 $didwm(highlighter,38,%highlightbeepdelay)
  did -a highlighter 60 %highlightlogfolder
  did -a highlighter 69 %highlightlogfile
  did -a highlighter 64 %highlightlogfolder $+ $replace($date $+ %highlightlogfile $+ .txt,/,-)
  refreshhlitems
  refreshhlnicks
  refreshhlchans
  refreshhlignoreitems
  did -z highlighter 2
  did -z highlighter 6
  did -z highlighter 16
  did -z highlighter 23
  did -a Highlighter 7 $chr(35)
}
dialog Highlighter {
  title " Typos Highlighter"
  size -1 -1 82 168
  option dbu
  button "Done", 1, 14 155 52 11, default ok cancel
  tab "Highlight Items", 42, -1 -1 82 167
  text "Add the word/item to be highlighted.", 9, 6 17 66 16, tab 42 center
  edit "", 3, 5 34 67 13, tab 42 autohs
  button "Add", 4, 26 48 25 12, tab 42
  text "Currently added items.", 11, 3 62 71 9, tab 42 center
  list 2, 6 72 67 64, tab 42 sort size hsbar vsbar
  button "Remove word/item.", 5, 14 138 52 12, tab 42 multi
  tab "Ignore Items", 43
  text "Add the words/items to be ignored by the highlighter.", 29, 5 17 66 16, tab 43 center
  edit "", 24, 5 34 67 13, tab 43 autohs
  button "Add", 25, 26 48 25 12, tab 43
  text "Currently added words/items.", 28, 3 62 74 9, tab 43 center
  list 23, 6 72 67 64, tab 43 sort size hsbar vsbar
  button "Remove word.", 26, 14 138 52 12, tab 43 multi
  tab "Ignore Nicknames", 44
  text "Add the nicknames to be ignored by the highlighter.", 22, 5 17 66 16, tab 44 center
  edit "", 17, 5 34 67 13, tab 44 autohs
  button "Add", 18, 26 48 25 12, tab 44
  text "Currently added nicknames.", 21, 4 62 71 9, tab 44 center
  list 16, 6 72 67 64, tab 44 sort size hsbar vsbar
  button "Remove nickname.", 19, 14 138 52 12, tab 44 multi
  tab "Ignore Channels", 45
  text "Add the channels to be ignored by the highlighter.", 15, 5 17 66 16, tab 45 center
  edit "", 7, 5 34 67 13, tab 45 autohs
  button "Add", 8, 26 48 25 12, tab 45
  text "Currently added channels.", 14, 4 62 70 9, tab 45 center
  list 6, 6 72 67 64, tab 45 sort size hsbar vsbar
  button "Remove channel.", 12, 14 138 52 12, tab 45 multi
  tab "Settings", 46
  check "Highlight in ative window?", 32, 2 29 74 10, tab 46
  check "Use the Highlight window?", 30, 2 18 74 10, tab 46
  check "Use beep(s)?", 31, 2 40 40 10, tab 46
  text "Select the foreground and background colors for highlight messaging.", 35, 2 53 43 40, tab 46 center
  combo 41, 46 62 31 10, tab 46 drop
  text "Delay between beeps (in milliseconds)? Default is 30.", 40, 2 122 43 27, tab 46 center
  text "How many times to beep on highlight? Default is 6.", 39, 2 95 43 26, tab 46 center
  combo 27, 46 103 31 10, tab 46 drop
  combo 38, 46 132 31 10, tab 46 drop
  combo 49, 46 79 31 10, tab 46 drop
  text "Foreground", 50, 46 55 30 6, tab 46 center
  text "Background", 51, 46 72 30 6, tab 46 center
  box "", 53, 1 91 78 61, tab 46
  box "", 13, 0 11 80 142, tab 46
  box "", 54, 1 12 78 41, tab 46
  box "", 52, 1 50 78 44, tab 46
  box "", 55, 2 118 77 4, tab 46
  tab "Logging", 47
  check "Log all highlights to file.", 57, 3 15 74 11, tab 47
  button "Select folder.", 58, 21 45 37 10, tab 47
  button "Set file name.", 59, 23 103 37 10, tab 47
  edit "", 60, 14 34 50 10, tab 47 read autohs center
  button "Show example.", 65, 21 143 40 10, tab 47
  text "Example file shown with current settings.", 66, 1 118 78 14, tab 47 center
  text "Current Folder", 67, 2 26 74 8, tab 47 center
  edit "", 69, 15 69 50 10, tab 47 read autohs center
  text "When setting a name do not use extensions. Just enter a name.", 70, 0 88 79 14, tab 47 center
  edit "", 64, 1 132 79 10, tab 47 read autohs center
  edit "", 63, 15 79 50 10, tab 47 autohs
  text "Current File name.", 68, 3 61 74 8, tab 47 center
  tab "Help", 56
  edit "", 48, 1 15 77 136, tab 56 read multi autovs vsbar center
}
on *:dialog:Highlighter:sclick:1:{ 
  set %highlightbeeptimes $did(27)
  set %highlightbeepdelay $did(38) 
  if ($did(32).state == 1) { set %HighlightShow yes } 
  else { set %HighlightShow no }
  if ($did(31).state == 1) {
    if ($ebeeps == $true) { set %HighlightBeep yes }
    else { 
      echo -a Mirc's sounds are diasbled. The highlighter's beeps cannot be enabled until you go into Options (Alt+o), then go into the Sounds section and click the checkbox titled "Enable Sounds".
      set %HighlightBeep no 
    }
  } 
  else { set %HighlightBeep no }
  if ($did(30).state == 1) { 
    set %HighlightWindow yes
    if ($window(@highlight) == $null) { 
      window -ek @Highlight
      echo -a All highlights will now also appear in here. 
    } 
  } 
  else { 
    set %HighlightWindow no
    window -c @Highlight 
  }
  if ($did(57).state == 1) { set %Highlightlogging on }
  if ($calc($did(41).sel -1) == $calc($did(49).sel -1)) { 
    echo -a You cannot set the foreground and background color the same.  Defaults used.
    set %highlightcolor 04,00 
  } 
  else { set %highlightcolor $iif($v1 isnum 0-9,0 $+ $v1,$v1) $+ $chr(44) $+ $iif($calc($did(49).sel -1) isnum 0-9,0 $+ $calc($did(49).sel -1),$calc($did(49).sel -1))) }
  if (%highlightlogfolder != $did(60)) && ($isdir($did(60)) == $true) { set %highlightlogfolder $did(60) }
  if (%highlightlogfile != $did(69)) { set %highlightlogfile $did(69) }
}
on *:dialog:Highlighter:sclick:4:{
  AddHighlight $did(3)
  did -r Highlighter 3
  refreshhlitems
}
on *:dialog:Highlighter:sclick:5:{
  RemoveHighlight $did(2).seltext
  refreshhlitems
}
on *:dialog:Highlighter:sclick:8:{
  AddHLChan $did(7)
  did -r Highlighter 7
  did -a Highlighter 7 $chr(35)
  refreshhlchans
}
on *:dialog:Highlighter:sclick:12:{ 
  RemoveHLChan $did(6).seltext
  refreshhlchans
}
on *:dialog:Highlighter:sclick:18:{
  AddHighlightNames $did(17)
  did -r Highlighter 17
  refreshhlnicks
}
on *:dialog:Highlighter:sclick:19:{
  RemoveHighlightNames $did(16).seltext
  refreshhlnicks
}
on *:dialog:Highlighter:sclick:25:{
  AddHighlightWords $did(24)
  did -r Highlighter 24
  refreshhlignoreitems
}
on *:dialog:Highlighter:sclick:26:{
  RemoveHighlightWords $did(23).seltext
  refreshhlignoreitems
}
on *:dialog:Highlighter:sclick:58:{
  did -r highlighter 60
  did -a highlighter 60 $sdir($scriptdir,Select the folder to store the log files in....)
}
on *:dialog:Highlighter:sclick:59:{
  did -r highlighter 69
  did -a highlighter 69 $did(63)
}
on *:dialog:Highlighter:sclick:65:{
  did -r highlighter 64
  did -a highlighter 64 $did(60) $+ $replace($date $+ $did(69) $+ .txt,/,-)
}
alias refreshhlnicks {
  did -r Highlighter 16
  var %hln = $numtok(%Highlight.Ignore.Names,32)
  while (%hln !<= 0) {
    did -a Highlighter 16 $gettok(%Highlight.Ignore.Names,%hln,32)
    dec %hln
  }
  did -z highlighter 16
}
alias refreshhlchans {
  did -r Highlighter 6
  var %hlc = $numtok(%Highlight.Ignore.Chan,32)
  while (%hlc !<= 0) {
    did -a Highlighter 6 $gettok(%Highlight.Ignore.Chan,%hlc,32)
    dec %hlc
  }
  did -z highlighter 6
}
alias refreshhlitems { 
  did -r Highlighter 2
  var %hl = $numtok(%Highlight.WordEntry,32)
  while (%hl !<= 0) {
    did -a Highlighter 2 $gettok(%Highlight.WordEntry,%hl,32)
    dec %hl
  }
  var %hl2 = $numtok(%Highlight.CharEntry,32)
  while (%hl2 !<= 0) {
    did -a Highlighter 2 $gettok(%Highlight.CharEntry,%hl2,32)
    dec %hl2
  }
  did -r Highlighter 3
  did -z highlighter 2
}
alias refreshhlignoreitems {
  did -r Highlighter 23
  var %hlw = $numtok(%Highlight.Ignore.Words,32)
  while (%hlw !<= 0) {
    did -a Highlighter 23 $gettok(%Highlight.Ignore.Words,%hlw,32)
    dec %hlw
  }
  did -z highlighter 23
}
on *:unload:{
  unset %highlightlogging
  unset %highlightlogfile
  unset %highlightlogfolder
  unset %highlightbeeptimes
  unset %highlightbeepdelay
  unset %Highlight.CharEntry
  unset %Highlight.WordEntry
  unset %Highlight.Ignore.Chan
  unset %Highlight.Ignore.Names
  unset %Highlight.Ignore.Words
  unset %HighlightShow
  unset %HighlightBeep
  unset %HighlightWindow
  unset %highlightnick
  unset %highlightcolor
  if ($highlight != $true) { echo -as <Attention> Don't forget, you may want to enable mircs built in highlight features after unloading Typos Highlighter. }
}
;End Typos Highlighter

Comments

Sign in to comment.
qSteinberg   -  Sep 01, 2020

I think it's a very good script. It's the best highlight script I've seen. Well done.
I just wish there was an option to activate/deactivate the color selection, as it causes some errors with certain irc programs (Highlighted line is diplayed twice)

 Respond  
g3ne01   -  Nov 06, 2013

How do you bring up the dialog box?

Meta  -  Nov 06, 2013

Right click in a channel, query, on the nicklist, or in a status window, and select <[Typos Highlighter]>, or right click in the @highlights window select Control Panel under <[Typos Highlighter]>

Sign in to comment

Typo   -  Sep 26, 2008

Holly crap, every time I finish responding to a comment, I see a new one, I wonder where youll be next, maybe I can beat ya. lol.

Glad to actually see someone interested in my codes tho. It's nice.

Thanks again for another comment/rating (if you did rate it.

 Respond  
^Neptune   -  Sep 26, 2008

Beats the crap out of my one :x

 Respond  
Typo   -  Jul 07, 2008

Thanks a lot. It was a lot of updates but well worth the time as far as I\'m concerned.

I\'m pretty happy with it now but like I said before I\'m open to any ideas I may have missed or overlooked in this massive update so if anyone has any ideas feal free to share them.

Thanks for the 8 EL

 Respond  
EL   -  Jul 07, 2008

D yeah completely redone.Huge dialog is several small tabs and easy to use.Alot of work went into this and its very useful.Like the many options the beeps an the saving and logging options is also very useful and the addition of custom colors for the echoing/@window is nice to since we have to look at it rofl.Nice altogether well done Typo.\"Rate it or Hate it?\"...8/10.Nice updates.

 Respond  
Typo   -  Jul 07, 2008

Updated now, updates and new screenshot are listed above.

Input is welcome.

Thanks to EL and Napa182 for ideas and suggestions.

 Respond  
EL   -  Jul 04, 2008

Its np man glad your willin to take suggestions.`-.-´

 Respond  
Typo   -  Jul 04, 2008

lol, thanks, i was afraid ide forget which is why i asked u to post the ideas. Ill begin work right now on most of those suggestions. Thanks again for some good ideas to make my stuff even better.

 Respond  
EL   -  Jul 04, 2008

Ok tested this as you know an here are my suggestions.The sound options check the $ebeeps for $true maybe a $input option for them to select to turn it on or off rite from there.Auto add the $chr(35) for soem reason you do it on the button sclick and not the edit field.As i was sayin about the 0 - 15 list box for the high light colors instead of the edit field make sure you check an see if they selected a color before they close.Also tab everything make the dialog smaller and change all your help info to a rclick or a help button and show it in a timered @window or a $input pop up.Also change your milliseconds options to a list box of premade options or chekc an make sure everything is numbers and limit the amount of milliseconds.Ahh and maybe add the loggin on and off even on active selection, as well as a option to View,save and clear the loggs from both the text file an @windows.And i think thats it rofl i cant remember the rest its 6:31am;p.Lemme know what cha think and i ll test it for sure.`-.-´

 Respond  
Typo   -  Jun 23, 2008

Thanks for the comments napa182. Ill keep those suggestions in mind for future projects.

 Respond  
napa182   -  Jun 23, 2008

ur dialog seem\'s a bit cluttered, and ur edit box\'s are too big as well as ur Done button. on the @highlite window ur edit box is too big as well and serves no point.
maybe add a menu item bar on the dialog for the instructions.
but all in all nice job

 Respond  
Typo   -  Jun 23, 2008

I hope you enjoy it.
This is one of the more popular scripts I\'ve made.

 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.