MattLight Posted December 22, 2012 Share Posted December 22, 2012 Hi I'm trying to make a script its when I press the number -Not on numberpad- "1" key it will spam the letter "w" or any letter i set to it... The scipt I made is this: >_< Func main() While 1 If _IsPressed("49") Then; 49 = 1 Send("w") EndFunc EndIf WEnd I'm trying to keep it as simple as possible, Thanks for the help ahead of time! Link to comment Share on other sites More sharing options...
czardas Posted December 22, 2012 Share Posted December 22, 2012 Hi welcome to the forum. Take a look at HotKeySet in the help file. It might be what you are looking for. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
MattLight Posted December 22, 2012 Author Share Posted December 22, 2012 I still dont understand, I tried looking at it, and im not trying to make a hotkey for it, I want it to be when I hold down 1 it will spam the letter W, sorry I ment it that way. I guess I made it seem like I wanted to make a hotkey. Still didnt figure it out though Link to comment Share on other sites More sharing options...
czardas Posted December 22, 2012 Share Posted December 22, 2012 (edited) What do you mean spam the letter? Looking at your code I see several mistakes. Func main() While 1 If _IsPressed("49") Then; 49 = 1 Send("w") EndIf WEnd EndFunc Edited December 22, 2012 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
MattLight Posted December 22, 2012 Author Share Posted December 22, 2012 Yes I hold down 1 and it spams the letter W so it would do -Example- "wwwwwwwwwwwwwwwwwwwwwwwwwwww" And I'm new to autoit sorry, I honestly dont see whats wrong with it =/ Link to comment Share on other sites More sharing options...
czardas Posted December 22, 2012 Share Posted December 22, 2012 (edited) I didn't test it, sorry it's my fault. Here's further corrections to the code: #include <Misc.au3> main() Func main() While 1 If _IsPressed("31") Then; 31 = 1 Send("{BackSpace}") ; Delete the number 1 Send("w") EndIf Sleep(100) ; Allow time for the key to be released WEnd EndFunc But Hotkey will do the same thing: HotKeySet("1", "MySendFunc") While 1 Sleep(10) WEnd Func MySendFunc() Send("w") EndFunc Edited December 22, 2012 by czardas Xandy 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
MattLight Posted December 22, 2012 Author Share Posted December 22, 2012 Thank you so much! you were a big help Anyway you have a great christmas/Holiday Thanks again! czardas 1 Link to comment Share on other sites More sharing options...
czardas Posted December 22, 2012 Share Posted December 22, 2012 Glad I could help. Merry christmas to you too, and everyone else here. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
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