mIRC Home    About    Download    Register    News    Help

Print Thread
#168277 06/01/07 05:45 AM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Hi guys, I have this little script that when I type /watch <nick>
it will make them much more visible with they type something, I was wondering if someone could help make my script a little better.
Code:
;In Aliases -
/watch set %watchednick %watchednick . $+ [ [ $1 ] ] $+ .

;In Remotes - 

on ^*:TEXT:*:#: {
  if ( . $+ $nick $+ . isin %watchednick ) && (kurd !isin $1-) {
    echo $iif($target == $me,$nick,$chan) $timestamp <8 $+ $nick $+ 0> $1-
    haltdef
  }
}

Basically, when I type /watch <nick>, it sets a variable like .nick. and it works perfectly, what i'm trying to do is, if I have two watched nicks (two .nicks. in variables) then it will not show the color yellow (mIRC Code 8) for both, it will show another color for the second one. It doesn't matter which colors I use, as long as it will show two different colors for each person. Thanks in advance.


-Kurdish_Assass1n
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Store the colour code that you want for the nick in the %watchednick.nick. variable, and strip the colour code when assigning the variable to the general %watchednick variable.

I know you're good enough to figure this out, but here's the code, along with a couple of other suggestions
Code:
/watch {
set $+(%,watchednick,.,$1) $+(<ctrl+K>,$$?="colour code",$1,<ctrl+K>)
set %watchednick $addtok(%watchednick,$strip($+(%,watchednick,.,$1)),32)

Code:
on ^*:text:*:#:{
  if $istok(%watchednick,$nick,32) && (kurd !isin $1-) {
  echo -t $iif($target == $me,$nick,$chan) $($+(%,watchednick,.,$nick),2) $1-
  haltdef
  }
}


Any problems, or questions, ask and I'll try to explain, but you're good enough that you should be able to figure out everything.

RusselB #168321 07/01/07 06:21 AM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Thank you RusselB, but, it didn't work frown I made this part myself, and, don't know how I would do multiple users.
Code:
  if ( . $+ $nick $+ . isin %watchednick ) {
    echo -t $iif($target == $me,$nick,$chan) < $+ $right(%watchednick,1) $+ $nick $+ 0> $1-
    haltdef
  }


alias watch {
  if ($2 <= 14) {
    set %watchednick %watchednick . $+ [ [ $1 ] ] $+ . $2
  }
}

alias unwatch {
  if ($1) {
    set %watchednick $remove(%watchednick,. $+ [ [ $1 ] ] $+ .)
  }
}
alias unwatchall unset %watchednick*
;---------------------
;     %watchednick .[voxic]. 4

This code works perfect, it makes everything the correct way, but, I don't know how I would do multiple users, maybe
%watchednick .<nick-here>.<color-code-here>
Ie: %watchednick .Testnick.4
I'm just using $right(.....) for right now, but, i'm about to attempt to fix it, if I do fix it, I will post something on here, if not, please try and help me, thanks.

Last edited by Kurdish_Assass1n; 07/01/07 06:22 AM.

-Kurdish_Assass1n
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
Ok, I can't get an idea on how to do this, if I had some ideas on how to do it, I would be able to script it, but, I don't know what to use. If anyone could please help me out, it would be really appreciated.


-Kurdish_Assass1n
Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
I would suggest using hash tables, and using $hget(hash,nick) to get the color back.
You would need a
Code:
on *:start: hload hashfile.hsh hashtablename
and a
Code:
on *:exit: hsave hashfile.hsh hashtablename
event, though.



Those who can, cannot. Those who cannot, can.
Kardafol #168433 08/01/07 04:31 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I suggest not using hsave on exit for any hash tables. If mIRC ever crashes, it will not be saved and all data that hasn't previously been saved will be lost. It is always a better idea to hsave every time you change the hash table (/hadd, /hinc, /hdel, etc).


Invision Support
#Invision on irc.irchighway.net
Riamus2 #168440 08/01/07 05:55 PM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
this isn't going to be a permanent watch, a variable is good enough, I use /unwatchall a lot of times, so, i'm ok with setting the colors. I just need to be able to watch multiple nicks with different colors. Example: Syntax: /watch <nick> <mIRC-Color-Code>
Example:
/watch Johnny 4
/watch xFaruZx 7
etc.
and, then, Johnny will be highlighted with the color 4, and, xFaruZx will be highlighted with the color 7, I only have one of them working right now, and, not both, the code above shows my script, please try it and you'll understand what I'm talking about. Thanks in advance.


-Kurdish_Assass1n
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I think the reason it isn't working right is because of your use of []'s. If you're using []'s for evaluation, you need to do it like:
Code:
%watchednick . [ $+ [ $1 ] ] $+ . $2

(The [ before the $+ ).

Still, a better method would be to use:
Code:
$($+(%,watchednick.,$1,.),2) $2


Here's what I'd probably suggest instead:

Code:
alias watch { set %watchednick. $+ $1 $2 }

alias unwatch { unset %watchednick. $+ $1 }

alias unwatchall { unset %watchednick.* }

on ^*:text:*:*: {
  if (%watchednick. $+ $nick) {
    echo -t $iif($chan,$chan,$nick) < $+ %watchednick. $+ $nick $+ $nick $+ 0> $1-
    haltdef
  }
}


I didn't test this, so you may need to use $+() or []'s with one or both of the %watchednick. $+ $nick in the on TEXT event.

Anyhow, this makes a variable for each nick that stores the color code. I added an /unwatchall command to reset everything.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #168459 08/01/07 10:59 PM
Joined: Apr 2006
Posts: 400
K
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
-Works Now, Thanks guys.

Last edited by Kurdish_Assass1n; 08/01/07 11:27 PM.

-Kurdish_Assass1n

Link Copied to Clipboard