|
Joined: Sep 2004
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Sep 2004
Posts: 10 |
Hi, i need a script that tells how many channels im in, in how many networks and how many queries ive got open.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
alias stats {
echo -a You are on $iif($chan(0) < 1,no,$chan(0)) channels.
echo -a You have $iif($query(0) < 1,no,$query(0)) query windows open.
var %x = $scon(0)
while (%x) {
if ($scon(%x).status = connected) { echo -a You have $scon(0) Status Windows open $scon(%x) of which you are connected to. | halt }
dec %x
}
}
You are on no channels. You have no query windows open. You have 3 Status Windows open 2 of which you are connected to.
Last edited by SladeKraven; 24/04/05 07:08 PM.
|
|
|
|
Joined: Sep 2004
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Sep 2004
Posts: 10 |
echo -a You are on $iif($chan(0) < 1,no,$chan(0)) channels. echo -a You have $iif($query(0) < 1,no,$query(0)) query windows open. Those lines only wrks on the active network i do the echo on, so it doesnt count the other networks
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
I'm not sure if this will work, but the only thing that would stop it from working is if you hold shift down and left click on a multi server. Or right clicking on it to close. To stop that from happening just simply close the channels before closing a server. The query one should work fine too although it will only write to the file when you receive a Private Message not when you open it by typing /query. I'll keep working on a code that will work for Quit/Disconnect etc. I'm sure there's a cleaner wayto doit without using files and someone will mostly add their 2 cents worth but for now here's the code..
alias stats {
echo -a You are on $iif($lines(chanstats.txt) < 1,no,$v1) channels
echo -a You have $iif($lines(querystats.txt) < 1,no,$v1) query windows
var %x = $scon(0)
while (%x) {
if ($scon(%x).status == connected) { echo -a You have $scon(0) Status Windows open $scon(%x) of which you are connected to. | halt }
dec %x
}
}
on 1:OPEN:?:*: {
if (!$read(querystats.txt,w,$nick)) write querystats.txt $nick
}
On *:Close:?: {
if ($read(querytats.txt,w,$target)) { write -dw $+(",$target,") querystats.txt }
}
On me:*:Join:#: {
if (!$read(chanstats.txt,w,$chan)) write chanstats.txt $chan
}
On me:*:Part:#: {
if ($read(chanstats.txt,w,$chan)) { }
}
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
That's a very weird way of going at it. Don't see the purpose of the on part event since you don't make it do anything. Didn't know how to name the alias but here goes: alias chanquerynet {
var %a = 0, %b = 0
scon -a if ($query(0)) inc $(%a |,) if ($chan(0)) inc % $+ b
echo -a Total queries: %a ** Total chans: %b ** Total server windows: $scon(0)
}
Gone.
|
|
|
|
Joined: Sep 2004
Posts: 10
Pikka bird
|
OP
Pikka bird
Joined: Sep 2004
Posts: 10 |
That's a very weird way of going at it. Don't see the purpose of the on part event since you don't make it do anything. Didn't know how to name the alias but here goes: alias chanquerynet {
var %a = 0, %b = 0
scon -a if ($query(0)) inc $(%a |,) if ($chan(0)) inc % $+ b
echo -a Total queries: %a ** Total chans: %b ** Total server windows: $scon(0)
} On totalchans it just give me same number as totalservers im on...
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Woops lol, I actually forgot to add the $v1 part with each inc. So final code:
alias chanquerynet {
var %a = 0, %b = 0
scon -a if ($query(0)) inc $(%a $v1 |,) if ($chan(0)) inc $(%b $v1,)
echo -a Total queries: %a ** Total chans: %b ** Total server windows: $scon(0)
} If you're on mIRC prior to 6.16 then you'll have to change $v1 to $ifmatch. Greets
Gone.
|
|
|
|
|