Highlight with separated @window

Paste Your small code(s) here, ex. small aliases, identifiers

Highlight with separated @window

Postby Alcoholx » Wed Jan 28, 2009 6:08 pm

Well I've been bored and made this lame script, it's not great tho but I like it, helps to find out when and where I've been hled, aspecially with few clients opened :P
Don't change anything, would be cool, you know ;) I can say 'All right reserved' ;D
Commands after script load: right click in this window :P
It should auto open on load ^^

Code: Select all
on *:load: { 
  set %hl off
  set %hl.beep off
  set %hl.vers.num 1.6
  window -bek0 @highlight
  titlebar @highlight - Made by Alcoholx \o/
  aline @highlight Script made by Alcoholx :P
  Aline @highlight Really lame one :)
  aline @highlight Version %hl.vers.num
  aline @highlight Commands in window @highlight: Right mouse click and/or /hl
  Aline @highlight ===> DO NOT EDIT THE CODE! ;P <===
}
on *:unload: {
  unset %hl*
  echo -a Thanks for using this lame script :P
}
alias hl {
  if ($active == @highlight) {
    if (!$1) { echo -a 10,1Syntax: /hl on/off/status/beep | Halt }
    if ($1 == on) { if (%hl == on) { echo -a 10,1HL is already 9ENABLED | halt }
      set %hl on | echo -a 10,1HL is now 9ENABLED
    }
    if ($1 == off) { if (%hl == off) { echo -a 10,1HL is already 4DISABLED | halt }
      set %hl off | echo -a 10,1HL is now 4DISABLED
    }
    if ($1 == status) { echo -a 10,1HL is:9 $upper(%hl) | echo -a 10,1HL beep is:9 $upper(%hl.beep) }
    if ($1 == beep) {
      if (!$2) { echo -a 10,1Syntax: /hl beep on/off/status | halt }
      if ($2 == on) { if (%hl.beep == on) { echo -a 10,1HL beep is already 9ENABLED | halt }
        set %hl.beep on | echo -a 10,1HL beep is now 9ENABLED
      }
      if ($2 == off) { if (%hl.beep == off) { echo -a 10,1HL beep is already 4DISABLED | halt }
        set %hl.beep off | echo -a 10,1HL beep is now 4DISABLED
      }
      if ($2 == status) { echo -a 10,1HL beep is:9 $upper(%hl.beep) }
    }
  }
}
on *:text:*:#: {
  if (%hl == on) {
    if ($me == $1) && (!$2) { set.echo $chan }
    if ($me isin $1-) {
      if (%hl.beep == on) {
        beep 1 1
        window -g2 $chan
        check.window
        aline @highlight 0,1 $+ $chr(91) $+ 7 $+ $left($chan,1) $+ 9 $+ $right($chan,-1) $+ 0,1 $+ $chr(93) $+ 0 - (08 $+ $time $+ 0) <11 $+ $nick $+ 0> $1-
        halt
      }
      if (%hl.beep == off) {
        window -g2 $chan
        check.window
        aline @highlight 0,1 $+ $chr(91) $+ 7 $+ $left($chan,1) $+ 9 $+ $right($chan,-1) $+ 0,1 $+ $chr(93) $+ 0 - (08 $+ $time $+ 0) <11 $+ $nick $+ 0> $1-
        halt
      }
    }
    elseif ($timer(hl $+ $chan)) { write hl $+ $chan $+ .txt 0,1 $+ $chr(91) $+ 7 $+ $left($chan,1) $+ 9 $+ $right($chan,-1) $+ 0,1 $+ $chr(93) $+ 0 - (08 $+ $time $+ 0) <11 $+ $nick $+ 0> $1- }
  }
}
on *:action:*:#: {
  if (%hl == on) {
    if ($me isin $1-) {
      if (%hl.beep == on) {
        beep 1 1
        window -g2 $chan
        check.window
        aline @highlight 0,1 $+ $chr(91) $+ 7 $+ $left($chan,1) $+ 9 $+ $right($chan,-1) $+ 0,1 $+ $chr(93) $+ 0 - (08 $+ $time $+ 0) 6 $+ $nick $1-
        halt
      }
      if (%hl.beep == off) {
        window -g2 $chan
        check.window
        aline @highlight 0,1 $+ $chr(91) $+ 7 $+ $left($chan,1) $+ 9 $+ $right($chan,-1) $+ 0,1 $+ $chr(93) $+ 0 - (08 $+ $time $+ 0) 6 $+ $nick $1-
        halt
      }
    }
    elseif ($timer(hl $+ $chan)) { write hl $+ $chan $+ .txt 0,1 $+ $chr(91) $+ 7 $+ $left($chan,1) $+ 9 $+ $right($chan,-1) $+ 0,1 $+ $chr(93) $+ 0 - (08 $+ $time $+ 0) 6 $+ $nick $1- }
  }
}
alias set.echo { timerhl $+ $1 1 10 play.logs $1 }
alias echo.start { aline @highlight ==================== Echoing $1 ==================== }
alias echo.end { aline @highlight ==================== End of echo ==================== }
alias echo.logs { if ($timer(hl [ $+ [ $chan ] ])) { write hl $+ $chan $+ .txt 0,1(08 $+ $time $+ 0) <11 $+ $nick $+ 0> $1- } }
alias check.window { if (!$window(@highlight)) { window -bek0 @highlight | titlebar @highlight - Made by Alcoholx \o/ } }
alias remove.txt { if ($exists(hl $+ $1 $+ .txt)) { remove hl $+ $1 $+ .txt } }
alias play.logs {
  if (!$exists(hl $+ $1 $+ .txt)) { halt }
  else {
    var %logs.chan $1
    var %x 1
    check.window
    echo.start %logs.chan
    while (%x <= $lines(hl $+ %logs.chan $+ .txt)) {
      aline @highlight $read(hl $+ %logs.chan $+ .txt,%x)
      inc %x
    }
    echo.end %logs.chan
    remove.txt %logs.chan
  }
}
menu @highlight {
  .Clear Window { var %i 1 | while (%i <= $line(@highlight,0)) { dline @highlight %i } }
  .Close this window { close -@highlight }
  .Settings:
  ..Highlight:
  ...On { if (%hl == on) { echo -a 10,1HL is already 9ENABLED | halt } | set %hl on | echo -a 10,1HL is now 9ENABLED }
  ...Off { if (%hl == off) { echo -a 10,1HL is already 4DISABLED | halt } | set %hl off | echo -a 10,1HL is now 4DISABLED }
  ...Status { echo -a 10,1HL is:9 $upper(%hl) | echo -a 10,1HL beep is:9 $upper(%hl.beep) }
  ...Beep:
  ....On { if (%hl.beep == on) { echo -a 10,1HL beep is already 9ENABLED | halt } | set %hl.beep on | echo -a 10,1HL beep is now 9ENABLED }
  ....Off { if (%hl.beep == off) { echo -a 10,1HL beep is already 4DISABLED | halt } | set %hl.beep off | echo -a 10,1HL beep is now 4DISABLED }
  ....Status { echo -a 10,1HL beep is:9 $upper(%hl.beep) } 
}



Ze well, load it and you will know what to do :P

If I'll add some new stuff and/org improve it I will let you know here :P

Edit:

Edited code, replace current one with one you got (if you got :P)
Last edited by Alcoholx on Wed Jan 28, 2009 6:35 pm, edited 2 times in total.
Alcoholx
 

Re: Highlight with separated @window

Postby StareX » Wed Jan 28, 2009 6:18 pm

nice script... works fine
StareX
 


Return to Mirc Scripting Snippets

Who is online

Users browsing this forum: No registered users and 0 guests

cron