mIRC Homepage
Posted By: 2big Progress Bars - 30/08/03 07:20 PM
I've read things about using these, but most of it says you need to use mdx. I really have no idea where to start on making these, I've searched everywhere for a good tutorial and can't seem to find one. Can somebody provide me with some help?
Posted By: LocutusofBorg Re: Progress Bars - 30/08/03 07:39 PM
First you have to define the number of characters to desginate "100%" (lets call that number N).

Next you have to update your progress bar every so many seconds or milliseconds (lets call that number M).

Thirdly, you start a timer (lets call that updater) that will change the appearance of your progress bar.

Fourth, you have to decide on a scheme. Marks that change color, marks that appear. I will make the bar using appearing = characters.

Last, you have to know what you are progressing. Let's assume for a moment it is a progress bar for a MP3 player.

Code:
[color:green]; when you start whatever it is you want to monitor, use this:[/color]
.timer[color:blue]update[/color] 0 [color:blue]M[/color] updatebar
[color:green] [/color]
alias updatebar {
  [color:green]; here I am echoing the bar[/color]
  [color:green]; I am assuming you are displaying it in a normal dialog editbox[/color]
  did -ra $dname [color:blue]id[/color] $str([color:blue]=[/color],$calc(([color:blue]M[/color] * $insong.pos / $insong.length)))
}
Posted By: 2big Re: Progress Bars - 30/08/03 07:55 PM
Well, assuming that I read that correctly, when you load the song, it would just fill an edit box with ='s. How would I make it to fill with color? Say I wanted my dialog to have a progress bar at the bottom, that filled with color each time you entered a character, and when it reached the max amount of of characters I specified for the edit box to hold, the progress bar would be full.
Posted By: LocutusofBorg Re: Progress Bars - 30/08/03 08:14 PM
Actually, it will fill the box with the number that resembles the percentage played. So if the song is 180 seconds long, every 1.8 seconds, a = will be added.

If I understand you correctly, you would have the use "amount of letters" and "number of letters allowed" instead of my MP3 stuff.

So you would use
Code:
$str([color:blue]=[/color],$calc(([color:blue]M[/color] * $len([color:blue]text-entered[/color])/ [color:blue]X[/color])))


You would be able to get text-entered with $did($dname,id).text, you would have to define X somewhere in the script.

If you'd wanna fill the whole editbox with color, I think you need to use mdx.dll for that, I haven't been able to do that with plain mIRC.
Posted By: 2big Re: Progress Bars - 30/08/03 09:00 PM
Thanks for the help. I found a tutorial on mdx, and managed to start off with a simple progress bar.

One last question, how do I go about placing a progress bar on the top of the mIRC menu thing, like in the row where the buttons are. I've seen some screenshots of lagbars being place at the top right corner.
© mIRC Discussion Forums