mIRC Home    About    Download    Register    News    Help

Print Thread
nick color #115782 30/03/05 03:40 AM
Joined: Feb 2005
Posts: 194
A
alhammer Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Hey. What I'm working on is a script that will change a persons color in my nicklist to grey if the are idle for 10+min or go away. Then, when they come back, it will change it back to whatever it was before they went away. I use different colors for different modes. This is what I have so far...

Code:
alias chk { 
  var %x = $nick($chan,0) 
  while (%x) { 
    if ($cnick($nick($chan,%x)).color == 14) { goto grey | halt } 
    elseif ($cnick($nick($chan,%x)).color !== 14) { 
    if ($nick($chan,%x).idle >= 600) || <if nick is away> {
      set %cnick. [ $+ [ $nick($chan,%x) ] ] $cnick($nick($chan,%x)).color
      cnick $nick($chan,%x) 14     
      dec %x
      halt
    }    
    :grey
    if ($nick($chan,%x).idle < 600) && ($nick($chan,%x).away = $false) { 
      cnick $nick($chan,%x) %cnick. [ $+ [ $nick($chan,%x) ] ]
      dec %x
      halt
    } 
  }
}


I know it's not right. Andy(SladeKraven) told me I had to do a whois, then use raw 301. He had to go away after that. I dont know how to incorperate the raw into the code. Can anyone help me? confused


"God sometimes puts us in the dark for us to see the light"
Re: nick color #115783 30/03/05 12:11 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I liked your idea so much Im using it myself now this is what i have so far, its ok, but i think there is a bug in it somewhere.

Code:
;
;Usage /Auto.GIAAN 
; * starts a 10 minute timer for all channels Grey.Idle.And.Away.Nicks check
;
alias Auto.GIAAN { .timer.Auto.GIAAN 0 600 Grey.Idle.And.Away.Nicks | Grey.Idle.And.Away.Nicks }

;
;Usage /Grey.Idle.And.Away.Nicks <channel> <channel> <channel> ...
; * Entering <channel> values well limit the scope of the sweep to said <channel(s)>
; * Not entering any <channels> well default to ALL channels you are on
;
; * Due to the nature of the cnick list launching this script on multiple servers has unpredictable results
;
alias Grey.Idle.And.Away.Nicks { 
  ;;;;window -e -t30,60,70,80,90,100 @cp1 | aline @cp1  $+ $str(=,$len(- $date - $time -)) | aline @cp1 - $date - $time - | aline @cp1  $+ $str(-,$len(- $date - $time -))  
  var %whois.count = 0
  var %m = $chan(0) | if ($0) { var %m =  $0 }
  var %channels     | if ($0) { var %channels = $1- }
  var %i = 1
  while (%i <= %m) {
    var %channel = $gettok($($+($,%i),2) $chan(%i),1,32)
    var %x = $nick(%channel,0) 
    ;;;;aline @CP1  $+ %channel $chr(9) ********** $chr(9) * $chr(9) * $chr(9) * $chr(9) $iif(%x,%x,0)
    while (%x) {
      var %nick = $nick(%channel,%x)
      ;;;;aline @CP1 %channel $chr(9) %nick $chr(9) $nick(%channel,%x).idle $chr(9) $cnick(%nick).color $chr(9) %cnick. [ $+ [ %nick ] ] $chr(9)
      if ($nick(%channel,%x).idle >= 60) {
        if ($cnick(%nick).color != 14) {
          if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
          else               { ;unset %cnick. [ $+ [ %nick ] ]                  } | ; *** unremark if you want to kill %cnick.[$+[%nick]] of manually removed cnick value
          .cnick %nick 14
        }
      }
      else {
        if ($cnick(%nick).color == 14) {
          if ($var(%cnick. [ $+ [ %nick ] ] ,1)) { .cnick %nick %cnick. [ $+ [ %nick ] ] | unset %cnick. [ $+ [ %nick ] ] }
          else                                   { .cnick -r %nick }
        }
        if (!$timer($+(.whois.,%nick))) {
          inc %whois.count
          .timer $+ $+(.whois.,%nick) 1 %whois.count whois $!( $+ %nick $+ ,)
        }
      }
      dec %x
    }
    inc %i
  }
  if (%whois.count) {
    .enable #GIAAN.WHOIS.RAWS
    inc %whois.count
    .timer.whois.#GIAAN.WHOIS.RAWS 1 %whois.count whois disable.#GIAAN.WHOIS.RAWS
    .timer.disable.#GIAAN.WHOIS.RAWS 1 $calc(%whois.count + 60) .disable #GIAAN.WHOIS.RAWS
    timers
  }
}

;
#GIAAN.WHOIS.RAWS on
raw 301:*:{
  haltdef
  var %nick = $$2
  if ($cnick(%nick).color != 14) {
    if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
    else               { unset %cnick. [ $+ [ %nick ] ] }
    .cnick %nick 14
  }
}
raw 318:*:{ haltdef | if ($2 == disable.#GIAAN.WHOIS.RAWS) { .timer.disable.#GIAAN.WHOIS.RAWS off | .disable #GIAAN.WHOIS.RAWS } }
;
raw 302:*:{ haltdef }
raw 303:*:{ haltdef }
raw 304:*:{ haltdef }
raw 305:*:{ haltdef }
raw 306:*:{ haltdef }
raw 307:*:{ haltdef }
raw 308:*:{ haltdef }
raw 309:*:{ haltdef }
raw 310:*:{ haltdef }
raw 311:*:{ haltdef }
raw 312:*:{ haltdef }
raw 313:*:{ haltdef }
raw 314:*:{ haltdef }
raw 315:*:{ haltdef }
raw 316:*:{ haltdef }
raw 317:*:{ haltdef }
raw 319:*:{ haltdef } | ; I dont have the slightest idea how many of these or what other ones might be tripped on a whois, you set to the right ones.
#GIAAN.WHOIS.RAWS end
;
on ^*:TEXT:*:#:{
  if ($cnick($nick).color == 14) {
    if ($var(%cnick. [ $+ [ $nick ] ] ,1)) { .cnick $nick %cnick. [ $+ [ $nick ] ] | unset %cnick. [ $+ [ $nick ] ] }
    else                                   { .cnick -r $nick }
  }
}
;
on *:NICK:{
  if ($var(%cnick. [ $+ [ $nick ] ] ,1)) {
    set -s %cnick. [ $+ [ $newnick ] ] %cnick. [ $+ [ $nick ] ]
    unset -s %cnick. [ $+ [ $nick ] ]
    .cnick -r $nick
    .cnick $newnick 14
  }
}


* im not using the cnick list for anything else besides this, if any one tries this, please take note it is potentially DESTRUCTIVE to the contents of the cnick list, so back it up!

Re: nick color #115784 30/03/05 12:49 PM
Joined: Feb 2005
Posts: 194
A
alhammer Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Hey. Thanks alot dude! I found a few bugs though. I've noticed that when I come back from being idle, it turns my nickname white. I'm not sure why. I may be wrong, but I didnt see it setting the variable to the nicks color before it's changed to grey. I also get this error:
-
disable.#GIAAN.WHOIS.RAWS No such nick
-
Since i'm unfamilar with this format, I wans't able to fix it. I also saw a few lines in the code that had:
-
;;;;Blah
-
Is this something I was supposed to change? It didnt seem like a description since it was all code. I'm not sure. Can you tell me whats up with it? TIA. I'm glad you liked my idea! grin Good thing there are people like you to help me get the idea to work.

Last edited by alhammer; 30/03/05 01:01 PM.
Re: nick color #115785 30/03/05 02:02 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
I've noticed that when I come back from being idle, it turns my nickname white.


This maybe a side effect of your previous copy having left vars around, try this command //unset -s %cnick.*
Then empty the CNICK entres using addressbook/colors then...
/away IM AWAY
//Grey.Idle.And.Away.Nicks
* turned grey in a few seconds?
/away
//Grey.Idle.And.Away.Nicks
* turned back to what it was?

Or just observe if it continues to occur after the unset and address book clear out

Quote:
I may be wrong, but I didnt see it setting the variable to the nicks color before it's changed to grey.


if ($nick(%channel,%x).idle >= 60) { that should be 600 but i had it down at one minute for testing
.. if ($cnick(%nick).color != 14) { if its not already colored 14 then we do the below code
.... if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color } if there is a entry for the nick in the list then set the %cnick.%nick to its color


Quote:
I also get this error:
-
disable.#GIAAN.WHOIS.RAWS No such nick
-
Since i'm unfamilar with this format, I wans't able to fix it.


Just an untrapped raw, you have to forgive me on these, my status window has so much junk flying up it, i dont notice half of the things, i have check points in scripts, that i havent ever removed after finishing them, and they all display in the status window, i just leave it in there incase ill have to debug it one day.

locate
#GIAAN.WHOIS.RAWS end
and make it
raw 401:*:{ haltdef }
#GIAAN.WHOIS.RAWS end



Quote:
I also saw a few lines in the code that had:
-
;;;;Blah
-


Those lines can be removed they create a extra window and display info to it i used a special window as i wanted to tab out the data so i could read it. Iy was used for debugging the code, take the ;;;; of if you want and see what it does. smile

Re: nick color #115786 30/03/05 07:10 PM
Joined: Nov 2004
Posts: 21
D
di_mis Offline
Ameglian cow
Offline
Ameglian cow
D
Joined: Nov 2004
Posts: 21
I agree .This is a great idea !
If you finished (without bugs) it is possible to paste the code for as also ?????????
smile

Re: nick color #115787 30/03/05 11:11 PM
Joined: Feb 2005
Posts: 194
A
alhammer Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
grin I got everything working now! I found out why I was getting that error:
-
.timer.whois.#GIAAN.WHOIS.RAWS 1 %whois.count whois disable.#GIAAN.WHOIS.RAWS
-
I think that there should not have been a "." between .disable and #GIAAN.WHOIS.RAWS. I removed the dot and it worked. I have one samll question. When someone is AWAY (not Idle) and it preforms the check, their nick color goes back to the initial color for about 2 sec, then to grey again. Obiously this is no big deal. The script works perfect now. I was just wondering if it's an easy fix. If not, don't worry about it. It's no big deal. Thanks a TON dude! By the way di_mis, here is what I ended up with. I added the "-s1" in the cnick command (.cnick %nick 14) because I have differnet colors for room modes, and if those colors are above the grey nicks, the colors with override the grey. The "-s1" puts the grey nicks at the top of the list so it won't interfere with the mode colors. You can ditch that part if you like. By the way, I learned that "-s1" thinggy from SladeKraven. Thanks to you too! grin
EDIT:
ooooo. I just realized. The "haltdef" makes it so I cant see the entire whois in the status window. Only 2 lines show up. I changed it so that insted of:
-
raw 313:*:{ haltdef }
-
I used: raw 313:*:{ echo -s $2- | haltdef }
-
Thats echos the whois so that I can still see it. I added that to all of the raws. It seems to work after I did that, but please let me know if that may cause a bug.

Code:
;
;Usage /Auto.GIAAN 
; * starts a 10 minute timer for all channels Grey.Idle.And.Away.Nicks check
;
alias Auto.GIAAN { .timer.Auto.GIAAN 0 600 Grey.Idle.And.Away.Nicks | Grey.Idle.And.Away.Nicks }

;
;Usage /Grey.Idle.And.Away.Nicks <channel> <channel> <channel> ...
; * Entering <channel> values well limit the scope of the sweep to said <channel(s)>
; * Not entering any <channels> well default to ALL channels you are on
;
; * Due to the nature of the cnick list launching this script on multiple servers has unpredictable results
;
alias Grey.Idle.And.Away.Nicks { 
  ;;;;window -e -t30,60,70,80,90,100 @cp1 | aline @cp1  $+ $str(=,$len(- $date - $time -)) | aline @cp1 - $date - $time - | aline @cp1  $+ $str(-,$len(- $date - $time -)) 
  var %whois.count = 0
  var %m = $chan(0) | if ($0) { var %m = $0 }
  var %channels | if ($0) { var %channels = $1- }
  var %i = 1
  while (%i <= %m) {
    var %channel = $gettok($($+($,%i),2) $chan(%i),1,32)
    var %x = $nick(%channel,0) 
    ;;aline @CP1 $+ %channel $chr(9) ********** $chr(9) * $chr(9) * $chr(9) * $chr(9) $iif(%x,%x,0)
    while (%x) {
      var %nick = $nick(%channel,%x)
      ;;aline @CP1 %channel $chr(9) %nick $chr(9) $nick(%channel,%x).idle $chr(9) $cnick(%nick).color $chr(9) %cnick. [ $+ [ %nick ] ] $chr(9)
      if ($nick(%channel,%x).idle >= 60) {
        if ($cnick(%nick).color != 14) {
          if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
          else { ;unset %cnick. [ $+ [ %nick ] ] } | ; *** unremark if you want to kill %cnick.[$+[%nick]] of manually removed cnick value
          .cnick -s1 %nick 14
        }
      }
      else {
        if ($cnick(%nick).color == 14) {
          if ($var(%cnick. [ $+ [ %nick ] ] ,1)) { .cnick %nick %cnick. [ $+ [ %nick ] ] | unset %cnick. [ $+ [ %nick ] ] }
          else { .cnick -r %nick }
        }
        if (!$timer($+(.whois.,%nick))) {
          inc %whois.count
          .timer $+ $+(.whois.,%nick) 1 %whois.count whois $!( $+ %nick $+ ,)
        }
      }
      dec %x
    }
    inc %i
  }
  if (%whois.count) {
    .enable #GIAAN.WHOIS.RAWS
    inc %whois.count
    .timer.whois.#GIAAN.WHOIS.RAWS 1 %whois.count whois disable #GIAAN.WHOIS.RAWS
    .timer.disable.#GIAAN.WHOIS.RAWS 1 $calc(%whois.count + 60) .disable #GIAAN.WHOIS.RAWS
    timers
  }
}

;
#GIAAN.WHOIS.RAWS off
raw 301:*:{
  haltdef
  var %nick = $$2
  if ($cnick(%nick).color != 14) {
    if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
    else { unset %cnick. [ $+ [ %nick ] ] }
    .cnick -s1 %nick 14
  }
}
raw 318:*:{ haltdef | if ($2 == disable.#GIAAN.WHOIS.RAWS) { .timer.disable.#GIAAN.WHOIS.RAWS off | .disable #GIAAN.WHOIS.RAWS } }
;
raw 302:*:{ haltdef }
raw 303:*:{ haltdef }
raw 304:*:{ haltdef }
raw 305:*:{ haltdef }
raw 306:*:{ haltdef }
raw 307:*:{ haltdef }
raw 308:*:{ haltdef }
raw 309:*:{ haltdef }
raw 310:*:{ haltdef }
raw 311:*:{ haltdef }
raw 312:*:{ haltdef }
raw 313:*:{ haltdef }
raw 314:*:{ haltdef }
raw 315:*:{ haltdef }
raw 316:*:{ haltdef }
raw 317:*:{ haltdef }
raw 319:*:{ haltdef } | ; I dont have the slightest idea how many of these or what other ones might be tripped on a whois, you set to the right ones.
raw 401:*:{ haltdef }
#GIAAN.WHOIS.RAWS end
;
on ^*:TEXT:*:#:{
  if ($cnick($nick).color == 14) {
    if ($var(%cnick. [ $+ [ $nick ] ] ,1)) { .cnick $nick %cnick. [ $+ [ $nick ] ] | unset %cnick. [ $+ [ $nick ] ] }
    else { .cnick -r $nick }
  }
}
;
on *:NICK:{
  if ($var(%cnick. [ $+ [ $nick ] ] ,1)) {
    set -s %cnick. [ $+ [ $newnick ] ] %cnick. [ $+ [ $nick ] ]
    unset -s %cnick. [ $+ [ $nick ] ]
    .cnick -r $nick
    .cnick -s1 $newnick 14
  }
}

grin!!!!!!!!!!!!!!!!!!!!!!!!!!!

Last edited by alhammer; 31/03/05 12:00 AM.

"God sometimes puts us in the dark for us to see the light"
Re: nick color #115788 30/03/05 11:51 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Ok i made it slightly more configurable, "slightly" being the keyword

Code:
;
;Usage /Auto.GIAAN 
; * starts a 10 minute timer for all channels Grey.Idle.And.Away.Nicks check
;
alias Auto.GIAAN { .timer.Auto.GIAAN 0 600 Grey.Idle.And.Away.Nicks | Grey.Idle.And.Away.Nicks }

;
;Usage /Grey.Idle.And.Away.Nicks <channel> <channel> <channel> ...
; * Entering <channel> values well limit the scope of the sweep to said <channel(s)>
; * Not entering any <channels> well default to ALL channels you are on
;
; * Due to the nature of the cnick list launching this script on multiple servers has unpredictable results
;
alias Grey.Idle.And.Away.Nicks {
  ;;;;window -e -t30,60,70,80,90,100 @cp1 | aline @cp1  $+ $str(=,$len(- $date - $time -)) | aline @cp1 - $date - $time - | aline @cp1  $+ $str(-,$len(- $date - $time -))  
  ;
  var %include.nicks = hvr          | ;<---[ Include field (1st aohvr) of $nick(channel,N,aohvr,aohvr) see /help nick and address identifiers ]
  var %exclude.nicks = o            | ;<---[ Exclude field (2nd aohvr) of $nick(channel,N,aohvr,aohvr) see /help nick and address identifiers ]
  var %idle.time.freshhold = 600    | ;<---[ I think we can all gather you adjust this to your liking ]
  var %monitor.away.status = $false | ;<---[ If you want or dont want to use away status checking also ] * OP's can detect your WHOIS commands
  ;
  var %whois.count = 0
  var %m = $chan(0) | if ($0) { var %m =  $0 }
  var %channels     | if ($0) { var %channels = $1- }
  var %i = 1
  while (%i <= %m) {
    var %channel = $gettok($($+($,%i),2) $chan(%i),1,32)
    ;
    var %x = $nick(%channel,0,$+(%include.nicks,-),$+(%exclude.nicks,-)) 
    ;;;;aline @CP1  $+ %channel $chr(9) ********** $chr(9) * $chr(9) * $chr(9) * $chr(9) $iif(%x,%x,0)
    while (%x) {
      var %nick = $nick(%channel,%x,$+(%include.nicks,-),$+(%exclude.nicks,-))
      var %idle = $nick(%channel,%x,$+(%include.nicks,-),$+(%exclude.nicks,-)).idle
      ;;;;aline @CP1 %channel $chr(9) %nick $chr(9) %idle $chr(9) $cnick(%nick).color $chr(9) %cnick. [ $+ [ %nick ] ] $chr(9)
      if (%idle >= %idle.time.freshhold) {
        ;
        if ($cnick(%nick).color != 14) {
          if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
          else               { unset %cnick. [ $+ [ %nick ] ]                   }
          .cnick %nick 14
        }
      }
      else {
        if ($cnick(%nick).color == 14) {
          if ($var(%cnick. [ $+ [ %nick ] ] ,1)) { .cnick %nick %cnick. [ $+ [ %nick ] ] | unset %cnick. [ $+ [ %nick ] ] }
          else                                   { .cnick -r %nick }
        }
        if (%monitor.away.status = $true) {
          if (!$timer($+(.whois.,%nick))) {
            inc %whois.count
            .timer $+ $+(.whois.,%nick) 1 %whois.count whois $!( $+ %nick $+ ,)
          }
        }
      }
      dec %x
    }
    inc %i
  }
  if (%monitor.away.status = $true) {
    if (%whois.count) {
      .enable #GIAAN.WHOIS.RAWS
      inc %whois.count
      .timer.whois.#GIAAN.WHOIS.RAWS 1 %whois.count whois disable.#GIAAN.WHOIS.RAWS
      .timer.whois.disable.#GIAAN.WHOIS.RAWS 1 $calc(%whois.count + 60) .disable #GIAAN.WHOIS.RAWS
    }
  }
}

;
#GIAAN.WHOIS.RAWS off
raw 301:*:{
  haltdef
  var %nick = $$2
  if ($cnick(%nick).color != 14) {
    if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
    else               { unset %cnick. [ $+ [ %nick ] ] }
    .cnick %nick 14
  }
}
raw 318:*:{ haltdef | if ($2 == disable.#GIAAN.WHOIS.RAWS) { .timer.whois.disable.#GIAAN.WHOIS.RAWS off | .disable #GIAAN.WHOIS.RAWS } }
;
raw 302:*:{ haltdef }
raw 303:*:{ haltdef }
raw 304:*:{ haltdef }
raw 305:*:{ haltdef }
raw 306:*:{ haltdef }
raw 307:*:{ haltdef }
raw 308:*:{ haltdef }
raw 309:*:{ haltdef }
raw 310:*:{ haltdef }
raw 311:*:{ haltdef }
raw 312:*:{ haltdef }
raw 313:*:{ haltdef }
raw 314:*:{ haltdef }
raw 315:*:{ haltdef }
raw 316:*:{ haltdef }
raw 317:*:{ haltdef }
raw 319:*:{ haltdef } | ; I dont have the slightest idea how many of these or what other ones might be tripped on a whois, you set to the right ones.
raw 401:*:{ haltdef }
#GIAAN.WHOIS.RAWS end
;
on ^*:TEXT:*:#:{
  if ($cnick($nick).color == 14) {
    if ($var(%cnick. [ $+ [ $nick ] ] ,1)) { .cnick $nick %cnick. [ $+ [ $nick ] ] | unset %cnick. [ $+ [ $nick ] ] }
    else                                   { .cnick -r $nick }
  }
}
;
on *:NICK:{
  if ($var(%cnick. [ $+ [ $nick ] ] ,1)) {
    set -s %cnick. [ $+ [ $newnick ] ] %cnick. [ $+ [ $nick ] ]
    unset -s %cnick. [ $+ [ $nick ] ]
    .cnick -r $nick
    .cnick $newnick 14
  }
}


* for customization use the special popup menu and the dialogs and human interface device i built, ummm no wait that was me dreaming last night. Oh yeah see these 4 lines of code.

var %include.nicks = hvr | ;<---[ Include field (1st aohvr) of $nick(channel,N,aohvr,aohvr) see /help nick and address identifiers ]
var %exclude.nicks = o | ;<---[ Exclude field (2nd aohvr) of $nick(channel,N,aohvr,aohvr) see /help nick and address identifiers ]
var %idle.time.freshhold = 600 | ;<---[ I think we can all gather you adjust this to your liking ]
var %monitor.away.status = $false | ;<---[ If you want or dont want to use away status checking also ] * OP's can detect your WHOIS commands

There my settings above you choose your own, the OP's pmed me all grumpy like asking me why i was whoising them all day frown , then he asked for the script so he can run it LOL.
So i added in the $nick include and exclude fields
Set a value for the idle time amount
Created a on off (true/false) for the away status checking which is the bit that does the whois, becuase im in a channel with a bunch or botties and there always sending stuff, and doing 200+ whois seemed kinda pointless, actually away status seemed kinda pointless to me as well, but hey what the heck.

[edit]
Just fixed a little bug with no exclude field causing a problem.

Last edited by DaveC; 31/03/05 12:00 AM.
Re: nick color #115789 31/03/05 12:03 AM
Joined: Feb 2005
Posts: 194
A
alhammer Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
grin Thanks! By the way, I just edited my post above a few minutes ago. Take a look. ^^^^


"God sometimes puts us in the dark for us to see the light"
Re: nick color #115790 31/03/05 12:48 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
grin I got everything working now! I found out why I was getting that error:
-
.timer.whois.#GIAAN.WHOIS.RAWS 1 %whois.count whois disable.#GIAAN.WHOIS.RAWS
-
I think that there should not have been a "." between .disable and #GIAAN.WHOIS.RAWS. I removed the dot and it worked. I have one samll question.


LOL, thats not what caused the "error" the "error" was the server reply for when i do the whois disable.#GIAAN.WHOIS.RAWS, you see what im doing is sending a invalid name as a whois, then when i see the whois come back, i know its done all the other whois before it, i just wasnt trapping the opening of it, see above about adding RAW 401


Quote:
When someone is AWAY (not Idle) and it preforms the check, their nick color goes back to the initial color for about 2 sec, then to grey again. Obiously this is no big deal. The script works perfect now. I was just wondering if it's an easy fix. If not, don't worry about it. It's no big deal.


It changes them back ONLY if there under the idle time freshhold, so as far as it knows at that moment there not idle, you COULD locate this code
Code:
      else {
        if ($cnick(%nick).color == 14) {
          if ($var(%cnick. [ $+ [ %nick ] ] ,1)) { .cnick %nick %cnick. [ $+ [ %nick ] ] | unset %cnick. [ $+ [ %nick ] ] }
          else { .cnick -r %nick }
        }
        if (!$timer($+(.whois.,%nick))) {

and remark out the lines as follows
Code:
      else {
        ;if ($cnick(%nick).color == 14) {
        ;  if ($var(%cnick. [ $+ [ %nick ] ] ,1)) { .cnick %nick %cnick. [ $+ [ %nick ] ] | unset %cnick. [ $+ [ %nick ] ] }
        ;  else { .cnick -r %nick }
        ;}
        if (!$timer($+(.whois.,%nick))) {


You well then be relient on the ON TEXT event only to change nick colors back, so i suggest you add a ON ACTION , which i should have done but always forget
on ^*:ACTION:*:#:{
if ($cnick($nick).color == 14) {
if ($var(%cnick. [ $+ [ $nick ] ] ,1)) { .cnick $nick %cnick. [ $+ [ $nick ] ] | unset %cnick. [ $+ [ $nick ] ] }
else { .cnick -r $nick }
}
}


I dont use room colors (hadnt used the cnick list before even so -s1 i didnt need but thanks for the info

Quote:
ooooo. I just realized. The "haltdef" makes it so I cant see the entire whois in the status window. Only 2 lines show up. I changed it so that insted of:
-
raw 313:*:{ haltdef }
-
I used: raw 313:*:{ echo -s $2- | haltdef }
-
Thats echos the whois so that I can still see it. I added that to all of the raws. It seems to work after I did that, but please let me know if that may cause a bug.


Baaaaaaaaaaaaaaaa spewing LOL, half of that stuff was to ensure the status window wasnt displaying all the whois data, oh lordy oh lordy mahahahhaha

ok, locate this.
Code:
      dec %x
    }
    inc %i

and replace it and everything below it with this (please note i didnt add your -s1 so u have to do that your self
Code:
      dec %x
    }
    inc %i
  }
}
;
raw 301:*:{
  var %nick = $$2
  if ($cnick(%nick).color != 14) {
    if ($cnick(%nick)) { set %cnick. [ $+ [ %nick ] ] $cnick(%nick).color }
    else               { unset %cnick. [ $+ [ %nick ] ] }
    .cnick %nick 14
  }
}
;
on ^*:TEXT:*:#:{
  if ($cnick($nick).color == 14) {
    if ($var(%cnick. [ $+ [ $nick ] ] ,1)) { .cnick $nick %cnick. [ $+ [ $nick ] ] | unset %cnick. [ $+ [ $nick ] ] }
    else                                   { .cnick -r $nick }
  }
}
;
on ^*:ACTION:*:#:{
  if ($cnick($nick).color == 14) {
    if ($var(%cnick. [ $+ [ $nick ] ] ,1)) { .cnick $nick %cnick. [ $+ [ $nick ] ] | unset %cnick. [ $+ [ $nick ] ] }
    else                                   { .cnick -r $nick }
  }
}
;
on *:NICK:{
  if ($var(%cnick. [ $+ [ $nick ] ] ,1)) {
    set -s %cnick. [ $+ [ $newnick ] ] %cnick. [ $+ [ $nick ] ]
    unset -s %cnick. [ $+ [ $nick ] ]
    .cnick -r $nick
    .cnick $newnick 14
  }
}
;
on *:INPUT:#:{
  if ($cnick($me).color == 14) {
    if ($var(%cnick. [ $+ [ $me ] ] ,1)) { .cnick $me %cnick. [ $+ [ $me ] ] | unset %cnick. [ $+ [ $me ] ] }
    else                                 { .cnick -r $me }
  }
}


* I added a ACTION and a ON INPUT as well, the ON INPUTS a bit bogus but well i use it on all channels so it fits me.

Re: nick color #115791 31/03/05 01:50 AM
Joined: Feb 2005
Posts: 194
A
alhammer Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Feb 2005
Posts: 194
Holy crap dude. I just looked in the nicklist colors and saw that you can add a "any nick" color that will trigger by idle time. What I mean is I can set one for anynick that will change their color to purple after 10 min(or any time). of being idle. And, it is always live so there is no neccessary timers for the commands. crazy I am modifying the code to work for just away. On my server, the ops CAN'T see when you whois them. wink Thanks dude. It works perfect now!


"God sometimes puts us in the dark for us to see the light"
Re: nick color #115792 31/03/05 03:32 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
mahahaha that serves me right for not checking all the options in cnick list

Only thing mine has over that besides checking the away status is that you can limit the range of channels it takes effect on.
However The inbuilt one has a massive advantage in that it can show greyed for away on BOB in #chan1 while normal in #chan2 since hes not idle in chan2

PS: I just tossed that script into the bin, im just gonna use the inbuilt one smile

Last edited by DaveC; 31/03/05 03:45 AM.