civilcalc Posted March 31, 2009 Share Posted March 31, 2009 I have made an avi file of a spinning wheel, it has 5 sections on it and the wheel will currently spin an infinate amount of times, I want to be able to generate a random number 1-5 and stop the wheel on the given section, but if I use _guictrlavi_seek() it will immeadiatly jump to the specified frame, is there a way to get it stop when it reaches a certain frame in the cycle, rather than to just jump to it? Maybe something like this? $rnd = Random(1,5,1) $frame = _Guictrlavi_getframe($avi) While $rnd <> $frame Sleep(1000) $frame = _Guictrlavi_getframe($avi) Wend ????? Thankyou Link to comment Share on other sites More sharing options...
WideBoyDixon Posted March 31, 2009 Share Posted March 31, 2009 (edited) _GUICtrlAVI_Play() allows you to specify the end frame of an AVI. If you're looking for some kind of spinner which then stops (it's hard to know from your description) then why not: $rnd = Random(5, 15, 1) _GUICtrlAVI_Play($hWnd, 0, -1, $rnd) $rnd = Random(1, 5, 1) _GUICtrlAVI_Play($hWnd, 0, $rnd, 1) WBD Edited March 31, 2009 by WideBoyDixon [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
civilcalc Posted March 31, 2009 Author Share Posted March 31, 2009 _GUICtrlAVI_Play() allows you to specify the end frame of an AVI. If you're looking for some kind of spinner which then stops (it's hard to know from your description) then why not:$rnd = Random(5, 15, 1)_GUICtrlAVI_Play($hWnd, 0, -1, $rnd)$rnd = Random(1, 5, 1)_GUICtrlAVI_Play($hWnd, 0, $rnd, 1)WBDI tried that, but it doesnt wait for the first play command to finish before executing the second play command, so in effect you only see the second animation, ie it will revolve once and then stop. thanks for your input though. Link to comment Share on other sites More sharing options...
WideBoyDixon Posted March 31, 2009 Share Posted March 31, 2009 Sorry. Was being lazy and didn't test my script before posting. You *should* be able to use _GUICtrlAVI_IsPlaying() to determine whether the clip is playing but it doesn't appear to work for me. Even the AutoIt help example doesn't work :-| If it works for you then: $rnd = Random(5, 15, 1) _GUICtrlAVI_Play($hWnd, 0, -1, $rnd) While (_GUICtrlAVI_IsPlaying($hWnd)) Sleep(10) Wend $rnd = Random(1, 5, 1) _GUICtrlAVI_Play($hWnd, 0, $rnd, 1) [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
civilcalc Posted March 31, 2009 Author Share Posted March 31, 2009 Sorry. Was being lazy and didn't test my script before posting. You *should* be able to use _GUICtrlAVI_IsPlaying() to determine whether the clip is playing but it doesn't appear to work for me. Even the AutoIt help example doesn't work :-| If it works for you then: $rnd = Random(5, 15, 1) _GUICtrlAVI_Play($hWnd, 0, -1, $rnd) While (_GUICtrlAVI_IsPlaying($hWnd)) Sleep(10) Wend $rnd = Random(1, 5, 1) _GUICtrlAVI_Play($hWnd, 0, $rnd, 1) ah, I see. good thinking. I will give it a go. thanks Link to comment Share on other sites More sharing options...
civilcalc Posted March 31, 2009 Author Share Posted March 31, 2009 peachy thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now