 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Mon Jun 06, 2005 10:43 pm Post subject: Sleep, Varible? |
|
|
I'm trying to code a loop to Sleep for the amount of milliseconds that is selected by the user in a Drop Down List, but I am running into problems.
This is the entire context:
| Code: |
Gui, Add, GroupBox, w300 h55, Kiss Bot
Gui, Add, Text,, Toggle On/Off Hotkey:
Gui, Add, Hotkey, vMyHotkey, NumLock
Gui, Submit, NoHide
Gui, Add, Text,, Send Delay (milliseconds)
Gui, Add, DropDownList, vDrop, 0|100|200|300|400|500|600|700|800|900|1000
Gui, Submit, NoHide
Gui, Show, NoActivate, AiK Marcos
Loop,
{
send, {:}
send, p
Sleep, %vDrop%
}
Pause::Pause
NumLock::Pause
return
|
The %vDrop% varible seems to be invalid... iono and no delay is executed. Also having problems with containing my controls within Gui, Add, GroupBox, w300 h55, Kiss Bot and Can not seem to have the hotkey selectable by the user.
Could anyone help me out? _________________ _AiK |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Mon Jun 06, 2005 11:21 pm Post subject: Re: Sleep, Varible? |
|
|
I have seen two main-problems:
1: you need a glabel like gMyDropListchanged for the dropdownlist
| Code: | Gui, Add, DropDownList, vDrop gMyDropListchanged, 0|100|200|300|400|500|600|700|800|900|1000
|
2: the Gui, Submit, NoHide should be placed before the loop
but after the acoording glabel:
| Code: |
MyDropListchanged:
Loop,
{
send, {:}
send, p
Sleep, %vDrop%
}
return
|
_________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat.
Last edited by Rubberduck on Mon Jun 06, 2005 11:23 pm; edited 1 time in total |
|
| Back to top |
|
 |
Jon
Joined: 28 Apr 2004 Posts: 373
|
Posted: Mon Jun 06, 2005 11:23 pm Post subject: |
|
|
also,
%vDrop% should be %Drop% |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Mon Jun 06, 2005 11:43 pm Post subject: |
|
|
I am not sure about this, but I seem to have seen another error.
I have not yet worked with the hotkey-command myself,
but your user-definded HotKey is never assigned to any action
Something like
must be entered in the script. I am absolute unsecure if this line
of code is right, but better AHK-Users will help you.
I only tried to help as good as I can (Newbie myself)  _________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat. |
|
| Back to top |
|
 |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Tue Jun 07, 2005 3:22 am Post subject: |
|
|
Hmm, don't I need OutputVar somewhere? _________________ _AiK |
|
| Back to top |
|
 |
Rubberduck
Joined: 24 Apr 2005 Posts: 96
|
Posted: Tue Jun 07, 2005 3:40 am Post subject: |
|
|
You have the command
Gui, Submit, NoHide
twice in you GUI-Definition
Normaly this command is NOT used within the GUI-Definition-Section.
It is used somewhere after the auto-Execute-Section (after the first
return in a script) to receive the contents of control-variables.
OutPutVar is a PLACEHOLDER, you must replace this word
in any command with a variablename you select for you own,
e.g. MyVariable.
You CANNOT use the word OutPutVar directly.
As I told above if the User is selecting any of your
millisecond-values from the dropdownlist, the assigned Glabel
"MyDropListchanged" is called. After this label the command
Gui, Submit, NoHide is receiving all values from the GUI,
what in your case means, that Drop (NOT vDrop) is holding the value from 0..1000.
If you don't know what I talk of, I try to write the script for you. _________________ Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat. |
|
| Back to top |
|
 |
AiKscroll
Joined: 06 Jun 2005 Posts: 179 Location: Northern Virginia
|
Posted: Tue Jun 07, 2005 11:25 pm Post subject: |
|
|
Thanks rubber, you own, it works now.
This is what it is now:
DropDownListchanged:
Loop,
{
Gui, Submit, NoHide
send, {:}
send, p
Sleep, %Drop%
} _________________ _AiK |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|