/progressbar

By co2h on Oct 28, 2007

Creates a progress bar with settings of your choice. Manipulate position, text color, font, font size, bar color, height, width, and text. Includes an example. /progexample to load.

/*
    /progressbar by co2(h)
        Syntax:
            /progressbar <posX> <posY> <w> <h> <bar color> <text color> <font> <font size> <x> <y> <text>
            <posX> - Forms window at point X
            <posY> - Forms window at point Y
            <w> - window length
            <h> - window height
            <bar color> - Color of the load bar
            <x> - How far to the left of the text resides
            <y> - How high the text resides (1 being the highest)
    Please refer to /progexample below for a working example of /progressbar
*/

alias progressbar {
  if ($1-10 && $11-) { 
    window -dp +b @progress $1 $2 $3 $4
    var %x = 1
    while %x <= $3 { 
      drawline @progress $5 $4 $calc($3 - %x) 1 $calc($3 - %x) $calc($4 - 15)
      drawtext -o @progress $6 $7 $8 $9 $10 $11-
      inc %x  
      var %y = 1 
      while (%y <= 100) { inc %y }
    }
    .timer 1 1 window -c @progress
  }
}

alias progexample {
  progressbar 203 200 230 25 1 0 Tahoma 10 5 1 Loading...
  ; let's break down that line:
  ; 203 is how far to the left the window is created
  ; 200 is how var below the top of the screen the window is created
  ; 230 is the length of the progressbar
  ; 25 is the height of the progressbar
  ; 14 is the color of the bar line
  ; 0 is the color of the progressbar text
  ; Tahoma is the font of the progressbar text
  ; 10 is the font size of the text
  ; 5 is how far to the left of the window the text is
  ; 1 is how far below the top of the window
  ; And 'Loading...' is the text displayed in the progressbar
  ; /progexample -> try it out and see for yourself ;)
}

Comments

Sign in to comment.
co2h   -  Oct 29, 2007

Ah. I see. Well, as of now, I will keep the idea of opening the trackbar manually in its own window. But I will work on the speed issue. Thanks.

 Respond  
Olliegod   -  Oct 29, 2007

I actually meant that the user could open their own window, and then this alias would draw the progress bar inside of it, rather than the alias opening its own window for the bar to be displayed, and then closing the window afterwards.

A way to still be able to have a variable load speed but not freeze mIRC would be to use global variables, then use a timer to make successive calls to the progressbar alias.

 Respond  
co2h   -  Oct 29, 2007

I have updated the code a bit and it now uses your suggestions. Thanks for that. Also, %y is included to manipulate a set speed to load the progressbar. Without %y, %x loads quite fast. So I am still going to include %y, but only am going to use one speed. Feel free to edit that in the code. ;)

 Respond  
Olliegod   -  Oct 29, 2007

Sorry for the double post, but I also think this would be much more usefull if it came with the option to specify your own window, size, and position, so that you could embed the progress bar wherever you wanted it.

 Respond  
Olliegod   -  Oct 29, 2007

The while loop which controls the speed can easily lock up mIRC.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.