AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sleep, Varible?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Mon Jun 06, 2005 10:43 pm    Post subject: Sleep, Varible? Reply with quote

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
View user's profile Send private message AIM Address
Rubberduck



Joined: 24 Apr 2005
Posts: 96

PostPosted: Mon Jun 06, 2005 11:21 pm    Post subject: Re: Sleep, Varible? Reply with quote

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
View user's profile Send private message
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Mon Jun 06, 2005 11:23 pm    Post subject: Reply with quote

also,

%vDrop% should be %Drop%
Back to top
View user's profile Send private message Send e-mail
Rubberduck



Joined: 24 Apr 2005
Posts: 96

PostPosted: Mon Jun 06, 2005 11:43 pm    Post subject: Reply with quote

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
Code:

%MyHotkey%::Pause


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) Confused
_________________
Wer keine Antworten hat muss nicht dumm sein,
dumm ist nur der welcher keine Fragen hat.
Back to top
View user's profile Send private message
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Tue Jun 07, 2005 3:22 am    Post subject: Reply with quote

Hmm, don't I need OutputVar somewhere?
_________________
_AiK
Back to top
View user's profile Send private message AIM Address
Rubberduck



Joined: 24 Apr 2005
Posts: 96

PostPosted: Tue Jun 07, 2005 3:40 am    Post subject: Reply with quote

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
View user's profile Send private message
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Tue Jun 07, 2005 11:25 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group