Home > Code, mIRC > progress.mrc – Progress Meter

progress.mrc – Progress Meter

;;;; Progress Meter v1.0.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Written by:                                                                ;;
;;   Brian Schmidt aka. brianMan aka. b|man.                                  ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;; Readme / Help ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load this script in mIRC, if you don't know how to do this, then perhaps   ;;
;; you shouldn't be using this script.                                        ;;
;;                                                                            ;;
;; This script is mainly used in other script for creating percentage         ;;
;; progress bars.                                                             ;;
;; Simply use it like this:                                                   ;;
;; $progress(100) and offcourse replace 100 with whatever percentage it needs ;;
;; to fill out.                                                               ;;
;; You can feed it optional parameters for the design of the bar:             ;;
;; $progress( [,filled[,not-filled[,bracket-begin[,bracket-end]]]])   ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;; Changelog ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; v1.0.1                                                                     ;;
;; * Fixed optional fill-char/not-fill-char.                                  ;;
;; - Removed the possibility to replace the brackets on-the-fly due to the    ;;
;;   fact that it didn't work. Trying to figure out a good way to do this.    ;;
;;                                                                            ;;
;; v1.0.0                                                                     ;;
;; + Initial release.                                                         ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

alias progress {
    var %prc $round($calc( $$1 / 10),0)
    var %i = 1
    while ($len(%out) < 10) {
        if (%i <= %prc) var %out = %out $+ |
        else var %out = %out $+ .
        inc %i
    }
    if ($2 != $null) var %out = $replace(%out,|,$2)
    if ($3 != $null) var %out = $replace(%out,.,$3)
    ;; Commented out due to not working, see changelog for v1.0.1
    ;; if ($4 != $null && $5 != $null) var %out = $replace(%out,|,$4) var %out = $4 $+ %out $+ $5
    ;; else var %out = $chr(91) $+ %out $+ $chr(93)
    var %out = $chr(91) $+ %out $+ $chr(93)
    return %out
}
Categories: Code, mIRC Tags: , ,