mIRC Home    About    Download    Register    News    Help

Print Thread
$calc problem #168919 16/01/07 09:20 PM
Joined: Dec 2006
Posts: 16
S
SithLORD Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2006
Posts: 16
alias stats {
set %Lin 1
:di
set %nickigual $comchan($me,%lin)
did -a stats 3 0 1 $chan(%nickigual).topic $chr(9) $nick(%nickigual,0,o) $chr(9) $nick(%nickigual,0,v) | did -a stats 5 0 2 $server
inc %Lin
if %Lin > $comchan($me,0) { halt }
goto di
}

i want do a multiple $calc with those $nick(%nickigual,0,v)

6
10 i want do like total voice 16

any help thnx so much



Re: $calc problem [Re: SithLORD] #168943 17/01/07 01:44 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If I understand you correctly, you want to put the total number of voices of all of your channels into the display of the dialog..not just the current channel. If so, here's a re-write of your code.
Code:
alias stats {
var %ops = 0, %voice = 0, %Lin = 1, %b = $chan(0)
while %Lin <= %b {
did -a stats 3 0 1 $chan(%Lin).topic $chr(9) $nick($chan(%Lin),0,o) $chr(9) $nick($chan(%Lin),0,v)
did -a stats 5 0 2 $server
inc %ops $nick($chan(%Lin),0,o)
inc %voice $nick($chan(%Lin),0,v)
inc %Lin
}
did -ra stats <ID> Total Ops: %ops
did -ra stats <ID> Total Voice: %voice
}


I'm going to presume that this alias is designed to work with a dialog that you already have, so you'll have to fill in the ID's for the last two lines that require them.

If you have any problems understanding my code, and if I got your request correct, specify what you don't understand and I'll try to clarify.

Re: $calc problem [Re: RusselB] #168951 17/01/07 04:56 AM
Joined: Dec 2006
Posts: 16
S
SithLORD Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2006
Posts: 16
voice channel 2: 10
voice channel 1: 10

i have this , 2 channeles , 10 voice each, i want do this

voice channel 2: 10
voice channel 1: 10
total voices : 20

thnx i hope understandme


Re: $calc problem [Re: RusselB] #168952 17/01/07 04:56 AM
Joined: Dec 2006
Posts: 16
S
SithLORD Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2006
Posts: 16
voice channel 2: 10
voice channel 1: 10

i have this , 2 channeles , 10 voice each, i want do this

voice channel 2: 10
voice channel 1: 10
total voices : 20

thnx i hope understandme


Re: $calc problem [Re: SithLORD] #168999 18/01/07 12:15 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
That is similar to what my code does. Differences are that my code would have the channels in the order of:
Channel 1
Channel 2

Totals:

and my code uses a dialog interface, which I presumed you already had, since your code had dialog commands in it.

If you don't want it in a dialog, specify how you want the information displayed (ie: to all in channel, to you in channel, or some other method).

BTW: Please be careful when posting, you accidentally (I hope) posted your reply twice.

Re: $calc problem [Re: RusselB] #169011 18/01/07 03:14 AM
Joined: Dec 2006
Posts: 16
S
SithLORD Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Dec 2006
Posts: 16
my error , sorry for that and preciate about the code