Bigginer Posted August 16, 2007 Posted August 16, 2007 Hi. I'm wondering if there is anyway to be able to change a value while the script is running. Eg. Press Ctrl + 1 $Variable = InPutBox("Blah blah", "Blah Blah Blah") ; Then press something to temporally pause the script and change the value of $Variable. Also, If it's possible does it have to be with a GUI? Thanks
Marc Posted August 16, 2007 Posted August 16, 2007 (edited) Something like this? Displays the value, when pressing ctrl-t the value is increased... #include <GUIConstants.au3> HotKeySet("^t", "Change") $value=1 SplashTextOn("Test",$value) While 1 ControlSetText("Test", "", "Static1", $value) Sleep(100) WEnd SplashOff() Func Change() $value = $value + 1 EndFunc Edited August 16, 2007 by Marc Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
Bigginer Posted August 16, 2007 Author Posted August 16, 2007 Something like this? Displays the value, when pressing ctrl-t the value is increased... #include <GUIConstants.au3> HotKeySet("^t", "Change") $value=1 SplashTextOn("Test",$value) While 1 ControlSetText("Test", "", "Static1", $value) Sleep(100) WEnd SplashOff() Func Change() $value = $value + 1 EndFunc Is it possible to have it so that the user can change it completely, not just increase the value?
Generator Posted August 16, 2007 Posted August 16, 2007 Is it possible to have it so that the user can change it completely, not just increase the value?This is lame..what are you trying to do anyways.. ;$value=haha this is where you place the value example $value=1 ;as numeric number $value="haha" ;string
Bigginer Posted August 16, 2007 Author Posted August 16, 2007 I want to make it so that at the start when the script runs, its asks you to set the values for 3 variables Eg. Hello, Hello1, Hello2 (I have already done that) But, I also want to make it so if you press a hotkey during the running of the script you can edit those variables. Eg, HelloEdit, HelloEdit2, HelloEdit3
Generator Posted August 16, 2007 Posted August 16, 2007 Ah..I c...so just use the hotkey set method and whenever you press the hotkey it assign a new value to the variable. Ex. When you press hotkey 1 $value="Hello1" When you press hotkey 2 $value="Hello 2" When you press hotkey 3 $value="Hello 3" Etc
herewasplato Posted August 16, 2007 Posted August 16, 2007 (edited) ...But, I also want to make it so if you press a hotkey during the running of the script you can edit those variables. Eg, HelloEdit, HelloEdit2, HelloEdit3HotKeySet("{PAUSE}", "_Change_It") Global $hello, $hello1, $hello2 _Change_It() While 1 Sleep(99) ;main body of the script TrayTip("", "$hello = " & $hello & @CR & _ "$hello1 = " & $hello1 & @CR & _ "$hello2 = " & $hello2, 100) WEnd Func _Change_It() $hello = InputBox("hello", "Enter value") $hello1 = InputBox("hello1", "Enter value") $hello2 = InputBox("hello2", "Enter value") EndFunc ;==>_Change_It Edited August 16, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
Bigginer Posted August 17, 2007 Author Posted August 17, 2007 Well, I tried all of that. Didn't help =\ herewasplato, Your code just declared more variables at the start and increased the boxes that came up, I pressed the hotkey and couldn't edit them. Generator, I tried HotKeySet("{LCTRL}"=$Line1) That didn't help either. Any more ideas?
Generator Posted August 17, 2007 Posted August 17, 2007 Well, I tried all of that. Didn't help =\herewasplato, Your code just declared more variables at the start and increased the boxes that came up, I pressed the hotkey and couldn't edit them.Generator, I tried HotKeySet("{LCTRL}"=$Line1) That didn't help either.Any more ideas??????
Moderators SmOke_N Posted August 18, 2007 Moderators Posted August 18, 2007 I tried HotKeySet("{LCTRL}"=$Line1) That didn't help either.Any more ideas?I have an idea... Open the help file up... look at hotkeyset and tell me why your function did not work... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
herewasplato Posted August 18, 2007 Posted August 18, 2007 ...herewasplato, Your code just declared more variables at the start and increased the boxes that came up, I pressed the hotkey and couldn't edit them...You are welcome.Sorry, I must not understand what you want.-MSP- [size="1"][font="Arial"].[u].[/u][/font][/size]
Delta01 Posted August 18, 2007 Posted August 18, 2007 (edited) HotKeySet("^1", "Edit1") ;=====> everything before while 1 here While 1 [...] WEnd Func Edit1() $Yourvalue = Inputbox("W/e", "Change your value to this") EndFunc Edited August 18, 2007 by Delta01
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