View unanswered posts | View active topics It is currently Wed May 01, 2024 4:54 pm



Reply to topic  [ 3 posts ] 
 ANSI Progress Bar 
Author Message
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post ANSI Progress Bar
Someone ICQ'd me about a progress bar I used once, in a tunnel-finding script. So I looked up the code, and thought I'd post it for those interested. Obviously, a progress bar can't accurately predict every routine, but one like this one with a known starting point (sector 11) and a known ending point (SECTORS), it works accurately.
Attachment:
ProgressBar.jpg
ProgressBar.jpg [ 6.11 KiB | Viewed 5044 times ]


Here is the pertinent code:
echo ANSI_15 "*Finding Tunnels : Status (| = 10%)*"
echo ANSI_15 "1% 100%" #27 "[14D"
setVar $a 11
setVar $increment ((SECTORS - 11) / 10)
setVar $coefficient 1
while ($a <= SECTORS)
if ($a > ($coefficient * $increment))
echo ANSI_12 "|"
add $coefficient 1
end
# Do the real work here
add $a 1
end

The only confusing bit of code is #27 "[14D". That is the Escape code sequence to move the cursor 14 spaces left, to the first space of the progress bar.

If memory serves, I made that script to mirror the functions of a SupG tunnel script, which also had a progress bar of sorts. And in truth, I had a much more sophisticated bubble script at the time which also found tunnels, but I dumbed it down and released that "simple" tunnel routine... just to stick it to the little guys.

Enjoy,
+EP+

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Tue May 18, 2010 9:37 pm
Profile WWW
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1396
Location: Canada
Unread post Re: ANSI Progress Bar
Thanks for posting that routine E.P.

Very Cool

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.
-= There are 10 types of people in the world: Those that understand Binary and those who do not
-= If Oil is made from Dinosaurs, and Plastic is made from Oil... are plastic Dinosaurs made from real Dinosaurs?
-= I like to keep my friends and my enemies rich, and wait to see which is which - Tony Stark (R.I.P.)


Wed Mar 27, 2013 6:42 pm
Profile ICQ YIM
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post Re: ANSI Progress Bar
Heh, I'd forgotten that post, thanks for the props. I especially enjoyed my remark about sticking it to the little guys. It's always fun to look back and see you were a smart butt.

Let me know if there's something that would make that more helpful (like further explanation).

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Wed Apr 03, 2013 7:47 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.