|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
OP
Fjord artisan
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.
;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
Hoopy frood
|
Hoopy frood
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 /watch {
set $+(%,watchednick,.,$1) $+(<ctrl+K>,$$?="colour code",$1,<ctrl+K>)
set %watchednick $addtok(%watchednick,$strip($+(%,watchednick,.,$1)),32)
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.
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2006
Posts: 400 |
Thank you RusselB, but, it didn't work I made this part myself, and, don't know how I would do multiple users.
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
Fjord artisan
|
OP
Fjord artisan
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
Fjord artisan
|
Fjord artisan
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 on *:start: hload hashfile.hsh hashtablename and a
on *:exit: hsave hashfile.hsh hashtablename event, though.
Those who can, cannot. Those who cannot, can.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
OP
Fjord artisan
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
|
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:
%watchednick . [ $+ [ $1 ] ] $+ . $2
(The [ before the $+ ). Still, a better method would be to use:
$($+(%,watchednick.,$1,.),2) $2
Here's what I'd probably suggest instead:
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
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2006
Posts: 400 |
-Works Now, Thanks guys.
Last edited by Kurdish_Assass1n; 08/01/07 11:27 PM.
-Kurdish_Assass1n
|
|
|
|
|