Jump to content
Sign in to follow this  
cyanidemonkey

Auto Move slider

Recommended Posts

cyanidemonkey

I am trying to auto move a slider in an AutoIt GUI from 0 to 100 over a space of time in seconds (say 15 sec for example - the actual time is feed via a varible), how would I do this?

Edited by cyanidemonkey

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

Share this post


Link to post
Share on other sites
Generator

For $i=1 to 100

GUICtrlSetData($Slider,1)

Sleep(150)

Next

That will take 15 seconds to proceed.

Share this post


Link to post
Share on other sites
PsaltyDS

For $i=1 to 100

GUICtrlSetData($Slider,1)

Sleep(150)

Next

That will take 15 seconds to proceed.

Change that to: GUICtrlSetData($Slider,$i)

...or it won't proceed at all!

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Generator

Change that to: GUICtrlSetData($Slider,$i)

...or it won't proceed at all!

:whistle:

My mistake, didn't see that.

Share this post


Link to post
Share on other sites
cyanidemonkey

thanks fellas.

if I put this in my while loop it will it slow down the rest of my script while it is moving the slider across? Sorry proberly should have explained the senario better.

While 1

    [other code doing stuff]

    If $foo = $bar Then
        For $i=1 to 100
            GUICtrlSetData($Slider,$i)
            Sleep(150)
        Next
    EndIf 

    [other code doing stuff]

WEnd

(havn't tried it yet, I'm still at work, will when I get home later)

Edited by cyanidemonkey

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

Share this post


Link to post
Share on other sites
Generator

thanks fellas.

if I put this in my while loop it will it slow down the rest of my script while it is moving the slider across? Sorry proberly should have explained the senario better.

While 1

    [other code doing stuff]

    If $foo = $bar Then
        For $i=1 to 100
            GUICtrlSetData($Slider,$i)
            Sleep(150)
        Next
    EndIf 

    [other code doing stuff]

WEnd

(havn't tried it yet, I'm still at work, will when I get home later)

While your script is doing the slide bar it can't do anything else, so you might want to inject some of the script in.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.