mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133
Anyway .. to make this work from any network ?
works fine if i run it from the channel i am in smirk

thanks !

testvoice {
var %room = $1
var %mmalltarg = %room | var %i = $nick(%room,0) | var %mmint = 0 | var %mblock = ON
:next
inc %mmint %mmsec
if ($nick(%room,%i) isvoice %room) { var %zzz = $nick(%room,%i) | echo $me %zzz | unset %zzz }
dec %i | if (%i > 0) { goto next } | var %totmmall = %mmint / %mmsec
set %mblock OFF | unset %i %totmmall %mmalltarg %mmint %mmsg %zzz | halt
}

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
A few corrections and modifications to your code. Also, next time, please use the Code Tags, they make reading code a lot easier. Please note the remarked statement. (the one that starts with a ; )
Usage: /testvoice (should run the code that you originally started with, but in all rooms that you are in and over all connected servers.
/testvoice <room> (should run the code that you originally started with, over all servers, but just for the named room)

I'm currently unable to test this, so I hope it works.

Code:
alias testvoice {
  var %connection = $scon(0)
  while %connection {
    .scon -at1 testvoice2 $1
    dec %connection
  }
}
alias testvoice2 {
  var %room = $iif($1,$1,$comchan($me,0))
  var %mmalltarg = %room, %i = $nick(%room,0), %mmint, %mblock = ON
  while %i {
    ;where is the variable %mmsec being set?
    inc %mmint %mmsec
    if ($nick(%room,%i) isvoice %room) {
      echo $me $nick(%room,%i)
    }
    dec %i
  }
  var %totmmall = %mmint / %mmsec
}
 

Joined: Jan 2004
Posts: 133
W
Vogon poet
OP Offline
Vogon poet
W
Joined: Jan 2004
Posts: 133


Thanks For The Help ..

Your code seems to loop 5 times .. and stop ..

I did figure it out .. with the old code .. finally with your help.
however it seems kinda weird .. that
$nick(%room,%i) isvoice %room

only works if mirc has "seen" the person voiced ..
if i disconnect .. and connect to a channel and run the script it doesnt show all the people voiced ..

anyway .. i will work on your ver .. some and see ..

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
When joining a room mirc reads the names raw that it recieves from the server, this comes in the format of Xnick where X is the highest operator symbol that the user has, so if a user is both voiced and opped, the names raw will only inform mirc that the user is opped. Therefor that users voice status will not trigger your script since mirc is unaware of the fact.

As for the script, just curious, is the while loop in the first alias even needed?

I have never done anything using the -a switch, however the mirc help files explains that it performs the command across all connection id's...


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Nice catch Om3n. That while loop in the first alias should not be there. Not sure what I was thinking when I put that in. The scon command that is currently in the loop does need to remain, but the rest of that loop can (and should) be removed


Link Copied to Clipboard