Sign in to follow this  
Followers 0
ssjfulkon198

Loop help...

9 posts in this topic

#1 ·  Posted (edited)

Probably a really simple asnwer...but how can i make a loop, like pressing B, but the delay time is specified by an input box?

Also...how can i set a picture as the background?

Here is something I tried with the loop thing...

CODE
While 1

Sleep (GUICtrlCreateInput("Insert Delay Value In Seconds...", 55, 120, 110, 20))

If $F7OnOff Then Send('b')

Wend

I dont think its right...since it doesn't work... but please help me!

Edited by ssjfulkon198

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have the input create separate, then get the value in it by using GUICtrlRead()

Example:

$input = GUICtrlCreateInput("Insert Delay Value In Seconds...", 55, 120, 110, 20) ; creates input

While 1
    $read = GUICtrlRead($input) ; reads value from input
    Send("b") ; sends "b"
    Sleep($read) ; sleeps amount of time(in milliseconds) specified in input
WEnd

What do you mean by the loop?

EDIT: Did I get it right?

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Umm.. I'm like really new at this stuff... WOW THANKS FOR FAST RESPONSE and you helped me ALOT!

Edited by ssjfulkon198

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Global $F7OnOff 
HotKeySet("{F7}", "ToggleF7")

$delay = InputBox("Title","Insert Delay Value In Seconds...")
$delay = $delay * 1000

While 1
   Sleep ($delay)
   If $F7OnOff Then Send('b')
Wend

Func ToggleF7()
    $F7OnOff = NOT $F7OnOff 
EndFunc

Advice: For GUI applications use Koda. It will make AutoIt GUI code for you.

Edited by Zedna

Share this post


Link to post
Share on other sites

Ehh...another thing... If I make a label...how can i change the font color its in? (I feel really stupid...(I program in Ruby and I just picked this up yesterday...))

Share this post


Link to post
Share on other sites

Ehh...another thing... If I make a label...how can i change the font color its in? (I feel really stupid...(I program in Ruby and I just picked this up yesterday...))

Run Koda and set-up what ever properties you want. Then Hit F10 and it will generate all GUI code gor you!!

Share this post


Link to post
Share on other sites

Run Koda and set-up what ever properties you want. Then Hit F10 and it will generate all GUI code gor you!!

Try GUICtrlSetColor

Though Koda is good an all, it's always a good idea to know how to do it without a machine :whistle:


[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

is that right?

$delay = GUICtrlCreateInput("Enter Amount In Sec.", 55, 120, 110, 20, GUICtrlSetColor(0, GUICtrlSetColor (0xFFFFFF))

(for me)


---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites

is that right?

Ehm, not exactly.

; creates the control and stores the controlID in the $control-variable
$control = GUICtrlCreateInput("Enter Amount In Sec.", 55, 120, 110, 20)

 ; use controlID to change the control's text-color to white
GUICtrlSetColor($control, 0xFFFFFF)
 ; use controlID to change the control's back-color to black
GUICtrlSetBkColor($control, 0x0)
;...

 ; read the control's current value and stores it in the $value-variable
$value = GUICtrlRead($control)

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