#51163 - 2000-08-30 07:09 PM
Re: I want to add a progress bar in my login script
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Based on icatar's excellent script - here's my humble submission based on that Window 2000 bootup thingy I was rambling on about earlier ...code:
BREAK ON CLS
AT(9,30) "Starting Windows..."
BOX(10,10,12,65,"single")
$COL = 12
WHILE $COL < 64
AT(11,$COL) CHR(166)
$COL = $COL + 1
IF ($COL & RND() ) = 0 ; simulate activiity
SLEEP 1
ENDIF
LOOP
AT(15,0) "Hit any key to continue..." get $k
EXIT
Shawn. [This message has been edited by Shawn (edited 30 August 2000).]
|
Top
|
|
|
|
#51165 - 2000-08-30 07:37 PM
Re: I want to add a progress bar in my login script
|
Anonymous
Anonymous
Unregistered
|
Very cool progress bar Shawn. I knew you guys wouldn't be able to resist 'evolving' the code! BTW, where can we get a list of ASCII codes that we can use with the CHR command? Roneil
|
Top
|
|
|
|
#51167 - 2000-08-30 07:57 PM
Re: I want to add a progress bar in my login script
|
Anonymous
Anonymous
Unregistered
|
I couldn't help doing a little evolution myself. Below is Shawn's code for the progress bar, except that I added a percentage indicator beneath the bar.P.S. Thanx for the code for the ASCII characters Jochen! code:
BREAK ONCLS AT(9,30) "Starting Windows..." BOX(10,10,12,65,"single") $COL = 12 WHILE $COL < 64 AT(11,$COL) CHR(166) $COL = $COL + 1 $Y = 100 * ($COL - 12) / 52 IF ($COL & RND() ) = 0 ; simulate activiity SLEEP 1 ENDIF AT(13,37) "$Y %" LOOP AT(15,0) "Hit any key to continue..." get $k EXIT
|
Top
|
|
|
|
#51169 - 2000-08-31 09:08 AM
Re: I want to add a progress bar in my login script
|
Anonymous
Anonymous
Unregistered
|
*Phew!* I've been working so hard a haven't been able to keep up with you guys... and what busy buggers you've been! I just loved the progress-bar discussion - and especially the part where someone suggested using VB to get input for a script. I've been working on something but I've never actually got past modifying my script and making a VB form. *grin*I've been sparked - and I'm off to get started! (Radimus: I always GET $none.. )
[This message has been edited by Fuentez (edited 31 August 2000).]
|
Top
|
|
|
|
#51170 - 2000-08-31 01:15 PM
Re: I want to add a progress bar in my login script
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
hey... I just noticed that the get $k is getting around...
|
Top
|
|
|
|
#51171 - 2000-08-31 02:12 PM
Re: I want to add a progress bar in my login script
|
rollo
Getting the hang of it
Registered: 2000-07-11
Posts: 85
Loc: louisiana
|
whats the get $k I have not used it as of yet also what would we have to do to make the progress bar actually work update the $col with a value set from points in our script? thanks rollo
|
Top
|
|
|
|
#51173 - 2000-08-31 03:07 PM
Re: I want to add a progress bar in my login script
|
rollo
Getting the hang of it
Registered: 2000-07-11
Posts: 85
Loc: louisiana
|
I am trying to get a activex control to work I would like to pass a value back to the vb script in the html page to update the counter break on
$info ='@fullname <h5>Your Password will expire in @pwage Days<h5>' IF INGROUP("WG_ALL") $all = '<p align="center"><img border="0" src="file://marble/afcert$/banner.jpg" width="400" height="45"></p>' $group = '<p align="center"><img border="0" src="file://marble/afcert$/termite1.gif" width="100" height="100"></p>' Endif IF INGROUP("7_FTR") $group = <p align="center"><img border="0" src="file:banner.jpg" width="703" height="66"></p> ENDIF $ie = olecreateobject ( "internetexplorer.application" ) $= oleputproperty ( $ie, "addressbar", "s", "0" ) $= oleputproperty ( $ie, "menubar", "s", "0" ) $= oleputproperty ( $ie, "statusbar", "s", "0" ) $= oleputproperty ( $ie, "toolbar", "s", "0" )
$= oleputproperty ( $ie, "width", "s", "500" ) $= oleputproperty ( $ie, "height", "s", "500" ) $= oleputproperty ( $ie, "left", "s", "159" ) $= oleputproperty ( $ie, "top", "s", "131" )
$= olecallfunc ( $ie, "Navigate", "s", "about:blank" ) $= oleputproperty ( $ie, "Visible", "s", "1" )
while olegetproperty ( $ie, "Busy" ) <> "0" loop
$doc = val ( "&" + olegetproperty ( $ie, "Document" ) ) $= olecallfunc ( $doc, "open" ) $= olecallfunc ( $doc, "write", "s", "<title>Logon script for %username%</title>" ) $= olecallfunc ( $doc, "write", "s", '<body bgcolor="#00A9E2"> $all <OBJECT id=ProgressBar1 style="WIDTH: 452px; HEIGHT: 24px" classid=clsid:0713E8D2-850A-101B-AFC0-4210102A8DA7><PARAM NAME="_ExtentX" VALUE="11959"><PARAM NAME="_ExtentY" VALUE="635"><PARAM NAME="_Version" VALUE="327682"><PARAM NAME="BorderStyle" VALUE="0"><PARAM NAME="Appearance" VALUE="1"><PARAM NAME="MousePointer" VALUE="0"><PARAM NAME="Enabled" VALUE="1"><PARAM NAME="OLEDropMode" VALUE="0"><PARAM NAME="Min" VALUE="0"><PARAM NAME="Max" VALUE="100"></OBJECT> <p align="center"><table border="1" width="400" height="200"> <tr> <td width="200" height="200"><SCRIPT LANGUAGE="VBScript"> progressbar1.value = 25 Document.Write time </SCRIPT><HR> $info</td> <td width="200" height="200">$group</td> </tr> </table> <HR> ') ;************************ Common drive mappings ************************ $= olecallfunc ( $doc, "write", "s", "<h4>Mapping network drives ...</h4>" ) use s: /delete use p: /delete use y: /delete use y: "\\marble\files" use v: "\\marble\cd" ;************************ Group drive mappings ************************ $done = 50 ;************************ proxy and homepage settings ************************
$= olecallfunc ( $doc, "write", "s", "<h4>Setting Browser</h4>" ) $done = 75 I ;************************ Maintaining Administration NT ************************ $done = 100 $= olecallfunc ( $doc, "write", "s", "<h4>Logon script complete ...</h4>" ) $= olecallfunc ( $doc, "close" ) $= olecallfunc ( $ie, "Quit") $= olereleaseobject ( $ie )
get $x exit hey I figured it out!
add this. $= olecallfunc ( $doc, "write", "s", '<SCRIPT LANGUAGE="VBScript">progressbar1.value = 10 </SCRIPT>')
just update the value for progress bar to update! [This message has been edited by rollo (edited 31 August 2000).]
[This message has been edited by rollo (edited 31 August 2000).]
|
Top
|
|
|
|
#51175 - 2000-08-31 04:04 PM
Re: I want to add a progress bar in my login script
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
On this other matter, this is how I thought a real work progress bar would work. I guess there are two ways of doing this.1) Wrap the progress loop around your work 2) Call a progress function from "within" your work This example takes the second approach and demonstrates how one might step through a script... I encapsulated the progressbar variables within the function itself for ease of portability;. One can move them out for effecientcy if one desires ! Plus - I made the bar 50 chars wide for simplicity sake ! code:
break on $pbPercent = 0 $pbMessage = "Enumerating Groups ..." gosub pbUpdate
sleep 3 ; enumerate groups here
$pbPercent = 25 $pbMessage = "Mapping Drives ..." gosub pbUpdate
sleep 3 ; map the drives
$pbPercent = 50 $pbMessage = "Changing the Registry ..." gosub pbUpdate
sleep 3 ; change the registry ...
$pbPercent = 75 $pbMessage = "Resting for three seconds ..." gosub pbUpdate
sleep 3 ; rest
$pbPercent = 100 $pbMessage = "Have a nice day ..." gosub pbUpdate
sleep 3
exit
bUpdate
; place bar with $pbRow and $pbCol
$pbRow = 20 $pbCol = 1
$pbWidth = 50 $pbPattern = "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦" $pbPadding = " "
if $pbPercent
at($pbRow,$pbCol+1) substr("$pbMessage$pbPadding",1,$pbWidth) at($pbRow+2,$pbCol+2) substr($pbPattern,1,$pbPercent/2)
else
cls at($pbRow,$pbCol+1) substr("$pbMessage$pbPadding",1,$pbWidth) box($pbRow+1,$pbCol,$pbRow+3,$pbCol+$pbWidth+3,"single") at($pbRow+2,$pbCol+2)
endif
return
Shawn.
|
Top
|
|
|
|
#51177 - 2000-08-31 04:35 PM
Re: I want to add a progress bar in my login script
|
rollo
Getting the hang of it
Registered: 2000-07-11
Posts: 85
Loc: louisiana
|
hey shawn, I was just playing a bit to see if and how a vbscript/ activex control would work in the IE. you can echo kix @username Etc. to the html codeI was thinking of using the IE as a front end for users logging in for a more graphical ewww ahhhh effect I think for speed sake the plain kix black box is more than sufficient. hmmmmm lets start using flash4!! maybe so! -rollo
|
Top
|
|
|
|
#51178 - 2000-08-31 04:36 PM
Re: I want to add a progress bar in my login script
|
Anonymous
Anonymous
Unregistered
|
Hi All,Good stuf about that progress bar. I used the code from Icar to polish things up. It can also been done withe Shawn's code. Code __________________________________________________________________________________________ BREAK ON CLS AT(9,22) "Starting Windows in progress..." BOX(10,10,12,65,"single") $COL = 12 WHILE $COL < 64 COLOR c+/c AT(11,$COL) CHR(16) $COL = $COL + 1 $Y = 100 * ($COL - 12) / 52 IF ($COL & RND() ) = 0 ; simulate activiity SLEEP 1 ENDIF COLOR w/n AT(13,37) "$Y %" LOOP AT(15,0) "Hit any key to continue..." get $k EXIT __________________________________________________________________________________________ I like polishing Jos
|
Top
|
|
|
|
#51180 - 2000-08-31 04:41 PM
Re: I want to add a progress bar in my login script
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Joshie:It all depends on how you play the percentages. If one knows the amount of work upfront, one might step through a loop with some sort of $index variable, calculate the percentages against a $total variable, and the bar will behave correctly and be quite smooth ! If the amount of work is unknown. one can benchmark a script by section, calculate the percentages ( section one takes 10% of total time, section two takes 30%, etc) and the bar will still behave correctly, but might seem a bit "chunky" ! I hear what your saying though ! Shawn. Alright ! who made this thread "wide" again ! [This message has been edited by Shawn (edited 31 August 2000).]
|
Top
|
|
|
|
#51181 - 2000-08-31 04:51 PM
Re: I want to add a progress bar in my login script
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Jos:That one's so good it gives me the "willies". It's almost "spooky" dfy: Are you still there ? Shawn. [This message has been edited by Shawn (edited 31 August 2000).]
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|