Opchart v1.0.1
mIRC Code
+ 2 likes
Please Register to submit score.
| Average Score | 9.0 (of 3 scores) |
| Date Added | Oct 04, 2009 |
| Last Updated | Oct 06, 2009 |
| Tags | auto bar chart generate halfop op owner picwin stat stats superop upload voice |
Introduction

This thinggy here will do the following:
- calculate the percentage of each group (op, halfop, etc) on the channel
- draw bars.
it's a bit pointless, but it looks nice ;_)
use either the popup menu from any channel window, or type /opchart #channel

alright, a lot of stuff has been added.
first of all, I added a configuration dialog. try typing /opchart conf (or config, options, or similar things ;_)). Here you have 2 tabs, one to change the colours for the bars, and one to change auto-generation/upload settings.
I've also made it so that the bars are a bit longer, and you may notice they progressively build up. I actually wanted to make it so they do it all at the same time, so they're "racing", but I can't think of a satisfying idea... ideas are welcome.
Oh, and, if you autogenerate, it'll do that in the background, and will not animate the bars to speed up the process a bit ;_)
I've tested it, of course, but as always, some bug might have slipped in while I wasn't looking, so feedback is welcome.
Thanks to BlueThen for the autoupload idea. :_)
version history:
v1.0 - initial release + massive update
v1.0.1 - colours didn't get saved before in some cases, fixed.
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 5:04 pm
Posted on Oct 4, 2009 5:04 pm
Wow that is good it don't show the figures though maybe a color key :)
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 5:17 pm
Posted on Oct 4, 2009 5:17 pm
may just be for me but it cuts the percent at the bottom in half
a few things you can do to shorten the code is
can be
and maybe im just picky but you can reduce the amount of cpu used by not using { and } if they aren't necissary e.g.
can be
but nice snippet nonetheless
a few things you can do to shorten the code is
| Code: |
| var %target $1 var %count 1 var %total $nick($1, 0) |
| Code: |
| var %target = $1,%count = 1,%total = $nick($1,0) |
| Code: |
| if ($left($nick($1, $2).pnick, 1) isin $(~&@%+)) { return $replace($left($nick($1, $2).pnick, 1), ~, 6, &, 5, @, 4, $(%), 3, +, 2) } |
| Code: |
| if ($left($nick($1, $2).pnick, 1) isin $(~&@%+)) return $replace($left($nick($1, $2).pnick, 1), ~, 6, &, 5, @, 4, $(%), 3, +, 2) |
but nice snippet nonetheless
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 9:22 pm
Posted on Oct 4, 2009 9:22 pm
This is the kind of thing you would save to a web server every once in awhile.
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 9:42 pm
Posted on Oct 4, 2009 9:42 pm
@sunslayer The use of the { } brackets tells mIRC exactly what to do next. When you remove them the script engine has to do extra evaluations.
I've never read anything that said that removing { } brackets will reduce cpu usage.
If you have some resource that contradicts this, please post a link.
I've never read anything that said that removing { } brackets will reduce cpu usage.
If you have some resource that contradicts this, please post a link.
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 10:08 pm
Posted on Oct 4, 2009 10:08 pm
| Quote: |
| * Don't use excessive Braces { } where you don't need them, and you only need them when there's more then one line in the command. The { Brace means "Begin" and the } Brace means "End" so if there's only one line to the event or command, you don't need to give the script a beginning and end command. |
| Quote: |
| Now besides the fact that it's useless to put excessive Braces, they all use more CPU. That's because the { Begin Brace is actually a command that calls a procedure to check for the } End Brace (and run all the commands between of course). It doesn't take a lot of CPU of course, but it's about the same amount as calling an alias (see "Saving CPU/memory usage"). |
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 10:43 pm
Posted on Oct 4, 2009 10:43 pm
That makes no logical sense and it also directly contradicts the mIRC help file.
[Below from mIRC's help file]
The Start bracket { does tell msl that it's the start of the commands but it also says that it is the end of the if/while or whatever. Without the { msl will have to do several evaluations to determine the end of the if/while statement.
And as far as the end bracket } goes, unless you have a blank space after the end bracket, msl has to evaluate the last character anyway. How else could it find the end of the line?
"Excessive brackets" could slow a script down, but 1 set of { } in a if statement will Not.
Also, if you read the whole tutorial you will see that Yochai shows you to take long ugly single lines of code and break them down into several lines of properly bracketed code.
[A quote from Yochai's tutorial]
[Below from mIRC's help file]
| Quote: |
| Using brackets speeds up processing. If an alias uses too few brackets then the statement might be ambiguous and the alias will take longer to parse, might be parsed incorrectly, or might not be parsed at all. |
The Start bracket { does tell msl that it's the start of the commands but it also says that it is the end of the if/while or whatever. Without the { msl will have to do several evaluations to determine the end of the if/while statement.
And as far as the end bracket } goes, unless you have a blank space after the end bracket, msl has to evaluate the last character anyway. How else could it find the end of the line?
"Excessive brackets" could slow a script down, but 1 set of { } in a if statement will Not.
Also, if you read the whole tutorial you will see that Yochai shows you to take long ugly single lines of code and break them down into several lines of properly bracketed code.
[A quote from Yochai's tutorial]
| Quote: | ||||
This looks like a mess, and in a few weeks it will be pretty hard to follow. Here's a better way of scripting it:
|
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 4, 2009 10:45 pm
Posted on Oct 4, 2009 10:45 pm
Sorry to muddy up your post with discussions knoeki. Your script is nice and creative.
Feel free to delete the above gibberish.
Feel free to delete the above gibberish.
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 5, 2009 12:40 am
Posted on Oct 5, 2009 12:40 am
Nice job, knoeki. Your script is very "business-like," which takes the use of charts.
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 5, 2009 3:59 am
Posted on Oct 5, 2009 3:59 am
Thanks for the replies guys :_) I always like to hear what people think... just a shame that some of my stuff seems to get unnoticed due to other scripts :\
Slub77: No idea what you're talking about, sorry.
Sunslayer: yes, I know I can declare multiple variables on a line, but I prefer not to, it reads easier for me this way :_) No idea why the percentage is cut in half, you could try changing line 4 to:
BlueThen: good idea! :_) I might actually do that, throw it up on my site.
FordLawnmower: meh, no problem, I'll leave it here, at least it has some substance :p
Jethro: Yup, because as we all know, IRC is SERIOUS BUSINESS!!!!!111 ;_)
Slub77: No idea what you're talking about, sorry.
Sunslayer: yes, I know I can declare multiple variables on a line, but I prefer not to, it reads easier for me this way :_) No idea why the percentage is cut in half, you could try changing line 4 to:
| Code: |
| window -dak0p @opchart -1 -1 280 290 |
BlueThen: good idea! :_) I might actually do that, throw it up on my site.
FordLawnmower: meh, no problem, I'll leave it here, at least it has some substance :p
Jethro: Yup, because as we all know, IRC is SERIOUS BUSINESS!!!!!111 ;_)
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 5, 2009 9:22 am
Posted on Oct 5, 2009 9:22 am
I'm updating this as we speak, it's going to become a lot more intresting ;_)
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 5, 2009 1:55 pm
Posted on Oct 5, 2009 1:55 pm
Alright, updated it... example:
http://zomgwtfbbq.info/opchart.bmp
(this should update every 5 minutes)
http://zomgwtfbbq.info/opchart.bmp
(this should update every 5 minutes)
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 5, 2009 5:55 pm
Posted on Oct 5, 2009 5:55 pm
sunslayer: heh, yeah. it's because of my channel. long and nonsensical story :P
mIRC Snippet:
Opchart v1.0.1
Posted on Oct 5, 2009 5:58 pm
Posted on Oct 5, 2009 5:58 pm
dw, bbq is very srs biznes.










