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 

new user

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



Joined: 31 Oct 2006
Posts: 7

PostPosted: Tue Oct 31, 2006 8:28 am    Post subject: new user Reply with quote

i am a new user and need help with the program

how can i type a script that for example:
type the key "a"
delay for 3 secs
then type the key "p"?

any similar codes would be greatly appreciated
Back to top
View user's profile Send private message
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Tue Oct 31, 2006 8:37 am    Post subject: Reply with quote

Code:

; Pressing "a" will delay 3 seconds and send "p" after the delay.
a::
Sleep 3000
Send p
Return

; Pressing "s" will send "o" instead.
s::o

; Pressing "d" will sleep 200ms, and send "i" 5 times.
d::
Loop 5 {
Sleep 200
Send i
}
Return

These simple examples should help you. If you have any questions just ask.
Back to top
View user's profile Send private message Visit poster's website AIM Address
whacko



Joined: 31 Oct 2006
Posts: 7

PostPosted: Tue Oct 31, 2006 8:48 am    Post subject: Reply with quote

can these codes work in windows media player and game programs?
Back to top
View user's profile Send private message
.AHK



Joined: 26 Apr 2006
Posts: 662
Location: USA

PostPosted: Tue Oct 31, 2006 9:18 am    Post subject: Reply with quote

Quote:
can these codes work in windows media player and game programs?

They should work in most applications. If it does not work on a game you can try "SendPlay" instead of "Send" and see if that works. By the way, a lot of games with online play block this type of artificial input.
Back to top
View user's profile Send private message Visit poster's website AIM Address
whacko



Joined: 31 Oct 2006
Posts: 7

PostPosted: Tue Oct 31, 2006 9:21 am    Post subject: Reply with quote

is it possible to get round with these blocks?
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Oct 31, 2006 9:26 am    Post subject: Reply with quote

Quote:
is it possible to get round with these blocks?
Yes. Get in touch with its developers. Ask that they remove their anti-cheating-protection. Good luck. Cool
Back to top
whacko



Joined: 31 Oct 2006
Posts: 7

PostPosted: Tue Oct 31, 2006 12:30 pm    Post subject: Reply with quote

yes that is a very good solution
i will look into that

how do i make an infinite loop?
Back to top
View user's profile Send private message
LoSinG_LoSeR



Joined: 12 Jun 2006
Posts: 61

PostPosted: Tue Oct 31, 2006 12:44 pm    Post subject: Reply with quote

Code:
Loop {
Send, a
sleep, 200
}

Loop
Back to top
View user's profile Send private message
whacko



Joined: 31 Oct 2006
Posts: 7

PostPosted: Tue Oct 31, 2006 1:44 pm    Post subject: Reply with quote

thanks
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Oct 31, 2006 1:48 pm    Post subject: Reply with quote

iŽd prefer

Code:
Loop
{
   Tooltip %A_Index%
}


for an example

^^
Back to top
whacko



Joined: 31 Oct 2006
Posts: 7

PostPosted: Wed Nov 01, 2006 2:55 pm    Post subject: Reply with quote

how do i stop an infinite loop? like for example hitting a key to stop the loop
Back to top
View user's profile Send private message
neyon



Joined: 29 May 2005
Posts: 34
Location: The Netherlands

PostPosted: Wed Nov 01, 2006 3:06 pm    Post subject: Reply with quote

Read the perfect manual, Whacko Twisted Evil
_________________
Greetz,
Neyon
Back to top
View user's profile Send private message
whacko



Joined: 31 Oct 2006
Posts: 7

PostPosted: Wed Nov 01, 2006 3:08 pm    Post subject: Reply with quote

the help section only provide a way to break the loop which is setting the number of loops
Back to top
View user's profile Send private message
LoSinG_LoSeR



Joined: 12 Jun 2006
Posts: 61

PostPosted: Wed Nov 01, 2006 3:16 pm    Post subject: Reply with quote

Code:
Loop
{
   GetKeyState, akeystate, a ;Checks the keystate for 'a'
   If Akeystate = D ;If the keyState is 'down'
      Break ;Then break the loop
   Tooltip %A_Index%
}




Thank you 'Guest' for helping a noob help a noob ^_^
Back to top
View user's profile Send private message
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