Sign in to follow this  
Followers 0
Hyflex

Pause? in GUI

35 posts in this topic

My script works but i want it so when i press start again on the GUI it to pause the script because currently when i press start and then press it again it does nothing and the Close part doesnt work.....

Share this post


Link to post
Share on other sites



see "hotKeySet"... in help, at the bottom is a GREAT example for pause

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Yah but i dont see how to add it in as a pause for the button???

Also how do i get labels like:

$Label3 = GUICtrlCreateLabel("http://www.autoitscript.com/forum/index.php?showtopic=33376", 16, 232, 353, 17, $WS_GROUP)

as hyperlinks???

Share this post


Link to post
Share on other sites

Put

Global $paused
at the top of your script. :Z

i did...

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Then you didn't put it on top before all the other code. Put it on LINE 1!

And make sure you save the file before you run etc.

Edited by Manadar

Share this post


Link to post
Share on other sites

nop i didnt but just did then, all it does is when i press start it pauses. and then doesnt do anything....

Share this post


Link to post
Share on other sites

But it doesnst unpause..............

Share this post


Link to post
Share on other sites

Yah but i dont see how to add it in as a pause for the button???

Also how do i get labels like:

$Label3 = GUICtrlCreateLabel("http://www.autoitscript.com/forum/index.php?showtopic=33376", 16, 232, 353, 17, $WS_GROUP)

as hyperlinks???

Try adding this to your GUI while loop:

$i_linklabel = GUICtrlCreateLabel("http://www.autoitscript.com/forum/index.php?showtopic=33376", 16, 232, 353, 17, $WS_GROUP)
GUICtrlSetColor($i_linklabel , 0x0000FF)
Select
    Case $msg = $i_linklabel
        Run(@ComSpec & " /c " & '@start http://www.autoitscript.com/forum/index.php?showtopic=33376', "", @SW_HIDE)
EndSelect

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

Case $msg =$i_linklabel

Case ^ ERROR

Error: Variable Used without being declared

Share this post


Link to post
Share on other sites

bump.... can ya help.

Share this post


Link to post
Share on other sites

... doesnt work...

WHy doesnt it stop the script when i tell it to...

Also can someone help me so if pixelserch finds black in a certain location for it to pause all functions

Share this post


Link to post
Share on other sites

HotKeySet("{DEL}", "_Pause")

;any script here.

Func _Pause()
While 1
    Sleep(100)
WEnd
EndFunc


[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

Try adding this to your GUI while loop:

$i_linklabel = GUICtrlCreateLabel("http://www.autoitscript.com/forum/index.php?showtopic=33376", 16, 232, 353, 17, $WS_GROUP)
GUICtrlSetColor($i_linklabel , 0x0000FF)
Select
    Case $msg = $i_linklabel
        Run(@ComSpec & " /c " & '@start [url="http://www.autoitscript.com/forum/index.php?showtopic=33376"]http://www.autoitscript.com/forum/index.php?showtopic=33376'[/url], "", @SW_HIDE)
EndSelect
 oÝ÷ Ûú®¢×"ØbL¨¹ú+myÛ(ëax/z¼¢+¶¶§µ«­¢+Ø((¥¹±Õ±ÐíÕ¥
½¹ÍѹÑ̹ÔÌÐì()Õ¥
ÉÑ ÅÕ½Ðí5äU$1°¡åÁɱ¥¹¬ÅÕ½Ðì¤((ÀÌØí¥}±¥¹­±°ôU%
Ñɱ
ÉÑ1° ÅÕ½Ðí¡ÑÑÀè¼½ÝÝܹÕѽ¥ÑÍÉ¥Áй½´½½ÉÕ´½¥¹à¹Á¡ÀýÍ¡½ÝѽÁ¥ôÌÌÌÜØÅÕ½Ðì°ÄØ°ÈÌÈ°ÌÔÌ°ÄÜ°ÀÌØí]M}I=U@¤)U%
ÑɱMÑ
½±½È ÀÌØí¥}±¥¹­±°°ÁàÀÀÀÁ¤()Õ¥MÑMÑÑ ¤()]¡¥±Ä((ÀÌØíµÍôÕ¥Ñ5Í ¤)M±Ð(
ÍÀÌØíµÍôÀÌØí¥}±¥¹­±°(IÕ¸¡
½µMÁµÀìÅÕ½Ðì½ÅÕ½ÐìµÀìÌäíÍÑÉÐmÕÉ°ôÅÕ½Ðí¡ÑÑÀè¼½ÝÝܹÕѽ¥ÑÍÉ¥Áй½´½½ÉÕ´½¥¹à¹Á¡ÀýÍ¡½ÝѽÁ¥ôÌÌÌÜØÅÕ½Ðíu¡ÑÑÀè¼½ÝÝܹÕѽ¥ÑÍÉ¥Áй½´½½ÉÕ´½¥¹à¹Á¡ÀýÍ¡½ÝѽÁ¥ôÌÌÌÜØÌäíl½Õɱt°ÅÕ½ÐìÅÕ½Ðì°M]}!%¤((
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M((á¥Ñ±½½À)¹M±Ð()]¹oÝ÷ Ø:²+azZl=«¬y«­¢+Ø!½Ñ-åMÐ ÅÕ½ÐíèÅÕ½Ðì°ÅÕ½Ðí}ÁÕÍÅÕ½Ðì¤()¡½Ñ­åÍÐ ÅÕ½ÐíàÅÕ½Ðì°ÅÕ½Ðí}Õ¹ÁÕÍÅÕ½Ðì¤()!½Ñ-åMÐ ÅÕ½ÐíÅÕ½Ðì°ÅÕ½Ðí}á¥ÐÅÕ½Ðì¤((íå½ÕÈÍÉ¥Áн̡É()Õ¹}ÁÕÍ ¤()±¥¹± ÅÕ½Ðí}ÁÕÍÅÕ½Ðì¤()M±À ÈÔÀ¤()¹Õ¹()Õ¹}Õ¹ÁÕÍ ¤()±¥¥Í± ¤()¹Õ¹((í¹áÐÕ½¹±ä½ÈÑÍÐÁÕÉÁ½ÍÌ()Õ¹}á¥Ð ¤()á¥Ð()¹Õ¹

Not tested.

i542


I can do signature me.

Share this post


Link to post
Share on other sites

i542 thats very interesting...

but i want the close/exit/pause to work with my scripts/gui

WHen i click a script on the .exe i want to be able to click it again and for it to stop and then i can change to another one. Also i wana be able to press close whenever and it to actually close.

Also u seem good with autoit.

How do i get it so when pixelsearch find black in an area for it to pause the script...?

Cos i dun know whos script does that

Share this post


Link to post
Share on other sites

Tryed ur method of the URl but doesnt work...

also i dont get how to incoperate ur pause witht he starts of scripts....

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

WHen i click a script on the .exe i want to be able to click it again and for it to stop and then i can change to another one. Also i wana be able to press close whenever and it to actually close.

Let me get this straight: you want to launch a exe...have it run...if and when the exe is launched again...have the first app pause...then when it is launched again...restart the original all while have just the one exe running.

Either I'm close or way off base...

If I'm right (?), I'd say monitor for a trigger file (or reg entry...your call) that you can have your app write if it sees that it is already running.

If ProcessList(@ScriptName) > 2 Then 
   if fileexists($sYourPausefilename) then
    ; delete the pause file here
   else
    ; write the pause file here
endif

Then in a while loop, test for the presence of the pause file and do a sleep().

For cleanup, have the app delete the pause file (or regentry) when the app closes (or you can do it on startup if processcount = 1).

If I'm way off, disregard my ramblings :-p

Edited by sshrum

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'

 

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  
Followers 0