Page 2 of 4 <1234>
Topic Options
#51162 - 2000-08-30 05:56 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Icatar,

Yeah , that's what i thought off when thinking of a progress bar in KIX !
[Kix code and nothing but pure Kix code]
had a rough frame , but this is much more
sophisticated , elegant , simple [what You prefer most]
You don't mind if i Use it ??? No ? Excellent!

For the Ie stuff :
Hats off to SCAdmin ! I have Greatest respect for people that invent something new
nobody tried before !

Ok, i have to restrict my admiration regarding performance ! I don't tested it yet
but can imagine that it will be not that performant...
I am an extremely impatient person @ logging on, and often been seen irrationaly destroying equipment !
Glad to be not responsible for logon Scripts

Greets
Jochen

[This message has been edited by jpols (edited 30 August 2000).]

_________________________



Top
#51163 - 2000-08-30 07:09 PM Re: I want to add a progress bar in my login script
Shawn Administrator Offline
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
#51164 - 2000-08-30 07:19 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Shawn,

cool stuff with that chr(166) ...
hey, just behaves like a real progress bar
[explain 'IF ($COL & RND() ) = 0' please ]

Jochen

Ahhh :: Pseudo Random , ok got it !

[This message has been edited by jpols (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
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
#51166 - 2000-08-30 07:53 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany

code:

BREAK ON

$x = 0
While $x < 256
AT($x,0)'$x = 'chr($x)
$x = $x + 1
Loop
Get $y
Exit


[This message has been edited by jpols (edited 30 August 2000).]

_________________________



Top
#51167 - 2000-08-30 07:57 PM Re: I want to add a progress bar in my login script
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 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

$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
#51168 - 2000-08-30 08:04 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
no prob,
didn't knew it myself till now

here some updtates i can remember :

chr(10) = [ENTER]
chr(34) = " ;quite important
chr(7-9)= don't know exactly but must be TAB, SPACEBAR and ESC

J.

_________________________



Top
#51169 - 2000-08-31 09:08 AM Re: I want to add a progress bar in my login script
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 Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
hey... I just noticed that the get $k is getting around...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#51171 - 2000-08-31 02:12 PM Re: I want to add a progress bar in my login script
rollo Offline
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
#51172 - 2000-08-31 02:45 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Rollo,
don't know either what the $k thingy means...
but i am quite excited to know [Rad? please..]

It might look and feel not that professional,
but i would prefer to put that progress bar in a subroutine to hop in with a changed var
Rather than wrap it around my code in a Monster - Loop ...
Any suggestions ?

Jochen

_________________________



Top
#51173 - 2000-08-31 03:07 PM Re: I want to add a progress bar in my login script
rollo Offline
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
#51174 - 2000-08-31 03:42 PM Re: I want to add a progress bar in my login script
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Rollo:

Holy sh*t ! Your script is amazing !

But can you repackage this IE script to do something less harmfull (mapping drives, checking for groups,etc) and make it more generic.

How about an IE script that will display all your user settings, group memberships, date, time and all that stuff, and will work for everyone !

Shawn.

Top
#51175 - 2000-08-31 04:04 PM Re: I want to add a progress bar in my login script
Shawn Administrator Offline
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
#51176 - 2000-08-31 04:20 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
exactly what i thought of Shawn,
problem is ,that one will lost look and feel
of a real progress bar ... [like we saw with that cool RND()].

anyway we have a progress bar working for us
and let the Users know how desperately slow
the logon process is ...

Jochen

_________________________



Top
#51177 - 2000-08-31 04:35 PM Re: I want to add a progress bar in my login script
rollo Offline
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 code

I 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
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
#51179 - 2000-08-31 04:39 PM Re: I want to add a progress bar in my login script
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
flash would be great for speeds ache [ermm Sake]
Lets try to let Kix logon scripts control a flash movie on ie logon window !!!!!!!

Right on to work Jochen!

C YA ALL IN 2 Years

_________________________



Top
#51180 - 2000-08-31 04:41 PM Re: I want to add a progress bar in my login script
Shawn Administrator Offline
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 Offline
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
Page 2 of 4 <1234>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.077 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org