|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Hello I need hlp with a script i have made the hash tables already but i have a feeling i have maybe bracketed the $iif statment wrongly as its not coloring the nicks in the channel. I have pasted the code below. alias away.chk {
echo -a 4Scanning...
var %i 1 %chan = $iif($1,$1,$active)
while $nick(%chan,%i) {
%user = $ifmatch
cline $iif($hget($+(away,$network)),%user),-lm 14,-r)
inc %i
}
}
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
I think your problem might be this line:
var %i 1 %chan = $iif($1,$1,$active)
Change it to: var %i = 1, %chan = $iif($1,$1,$active) Using your code I was unable to loop through the nicknames, which I believe might have been the cause.
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Thanks for your reply but that has not fixed the problem, vars dint need the =, i want it to color the nicks in the list if they are in a hash table.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
It wasn't the problem you were thinking of but it was a problem nonetheless, if you put echo before the cline command in your original post you will notice that it's not looping through the nicknames. Vars do need to be seperated by a comma. Using your example:
alias test {
var %x = 1 %y = 1
echo -a $calc(%x + %y)
}
That should echo 2, 1+1=2. But it doesn't because only one variable is being assigned a value.
alias test {
var %x = 1, %y = 1
echo -a $calc(%x + %y)
}
Echoes 2 as it should do. Back to the topic:
alias away.chk {
echo -a 4Scanning...
var %i 1, %chan = $iif($1,$1,$active)
while $nick(%chan,%i) {
%user = $ifmatch
cline $iif($hfind($+(away,$network),%user),-lm 14,-r) %user
inc %i
}
}
That should work for you.
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
It now works fine, thanks to you. much appreciated.
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Is there anyway to make it color the nicks in the common channels. Meaning not just in one channel but in all chans that nick is on?
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
I came up with this but its not working, i want it to color the nicks in all channels and i want it to check all channels i am on in one go, i tried something but its now working, could someone please help me with this. I have pasted my code below. alias away.chk {
if ($1 !ischan) { who $1 | return }
var %i = 1,%c = 1
while $chan(%c) {
while $nick(%chan,%i) {
%user = $ifmatch
$iif($hfind($+(away,$network),%user),com.cline,cline-r) %user
inc %i
}
inc %c
if $hget($+(away,$network)) { .hfree $+(away,$network) } | hmake $+(away,$network) 5
who +aM
}
}
alias -l com.cline {
var %i 1
while ($comchan($1,%i)) { cline -lm 14 $1 $ifmatch | inc %i }
}
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Greetings I still need help with my script, i will try and make it a little clearer. I have a hash table where all nicks that are set to away on the network are stored in, i have a script that will color the users names in the channel nick list to a diff color if they are stored in the hash table, trouble is i want it color the users names in ALL the channels not just the one channel, could someone please take the time to help, it would be much appreciated. I have pasted the current code below. alias away.chk {
echo -a 4Scanning...
var %i 1, %chan = $iif($1,$1,$active)
while $nick(%chan,%i) {
%user = $ifmatch
cline $iif($hfind($+(away,$network,$cid),%user),-lm 14,-r) %user
inc %i
}
}
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
It might just be better if you have it color the nicks when you change the $active window (on ACTIVE). That way, if you're in a lot of large channels, you won't risk freezing mIRC from it trying to color all of those channels at once. Unless you have multiple channels visible at once, you'll only ever see the active channel anyhow. It's up to you, though.
You'd have to use /scon to handle all networks. And you'll have to loop through $chan() as you originally did.
Of course, you *could* use /cnick instead of /cline.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Hi Riamus, Thanks for your reply, i don't want to use the on *:active method as its not a clean way of doing what i want, i do wish /cline had the option of coloring the user on all channels. I don't have much scripting experience hence me asking in the forum. I wonder if you would help to script a solution using /cline or my method.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Well, I don't do much with /scon, so it would be better for someone who knows that command better to figure that one out for you. Still, why not just use /cnick and save yourself the trouble?
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Hi I dont want to use /scon as i dont want to cycle through networks, just the channels, and i have looked at /cnick in the help file and its not working i made sure its on and i type /cnick <nick> color and it says * Added admin to color list but it does not color the nick, i need to instantly color the nick, I paste the script again below, I just want it to work on all the channels i am on on that network. alias away.chk {
echo -a 4Scanning...
var %i 1, %chan = $iif($1,$1,$active)
while $nick(%chan,%i) {
%user = $ifmatch
cline $iif($hfind($+(away,$network,$cid),%user),-lm 14,-r) %user
inc %i
}
} Kind regards
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Try this Where f forces a new entry and s1 puts the new entry to the 1st position. So:-fs1 is forcing a new entry at position 1. mIRC uses the first match, putting it into pos 1 will override any generic colors for ops/modes/etc To remove it you'd do
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Hi degee Your suggestion has been very helpful and i have amended the script, i wonder if you can improve it or make the code a little better. I have pasted the code below. alias away.names {
if $hget($+(away,$network,$cid)) { .hfree $+(away,$network,$cid) }
who +aM
var %c 1
while ($chan(%c)) { away.chk $ifmatch | inc %c }
}
alias -l away.chk {
var %i = 1, %chan = $1
while $nick(%chan,%i) {
%user = $ifmatch
.cnick $iif($hfind($+(away,$network,$cid), -fs1 %user),14,-r) %user
inc %i
}
} The above seems to me a little long way of going about things as i am using two aliases. I just want it to cycle all channels and color the nicks accordingly. I use a time in an on connect script to use the aliases every few minutes. Your help is appreciated.
Last edited by Solo1; 20/09/07 02:39 PM.
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
Assuming that '/who +aM' generates a raw 352 reply..
alias away.names {
while $cnick(1).color == 15 { .cnick -r 1 }
who +aM
}
raw 352:*:{
if (G isin $7) { .cnick -fs1 $6 15 }
halt
}
;Plus a startup event to clear any leftover entries from last session
on *:start:while $cnick(1).color == 15 { .cnick -r 1 }
I'm assuming you already have the raws halted so I didn't addin any code to enable/disable groups or whatever...
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Hi Degee, That looks alot simpler and it is a raw 352 reply, I just want it to check every few mins incase a nick has come back from the away status during the time i am connected to the server, Instead of constantly /who'ing channels i wanted to /who +aM every few mins instead as that decreases network traffic to the irc server significantly, is there anyway your script can be modded to check every few mins and update the nick list accordingly??
edit: As the script is not resetting the nicks color when they have returned from /away status Kind regards
Last edited by Solo1; 20/09/07 03:59 PM.
|
|
|
|
Joined: Jun 2006
Posts: 508
Fjord artisan
|
Fjord artisan
Joined: Jun 2006
Posts: 508 |
You could just add a timer into it
alias away.names { .timeraway.names $+ $cid 0 900 away.check }
alias -l away.check {
while $cnick(1).color == 15 { .cnick -r 1 }
who +aM
}
raw 352:*:{
if (G isin $7) { .cnick -fs1 $6 15 }
halt
}\ edit: As the script is not resetting the nicks color when they have returned from /away status It'll only reset colors when the alias is run, not when they set themselves back.
Last edited by deegee; 20/09/07 04:03 PM.
|
|
|
|
Joined: Mar 2007
Posts: 139
Vogon poet
|
OP
Vogon poet
Joined: Mar 2007
Posts: 139 |
Just did, works fine now, you have been very helpful. Many thanks
|
|
|
|
|