AutoHotkey Community

It is currently May 27th, 2012, 9:18 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 16th, 2011, 2:51 am 
Offline

Joined: December 16th, 2011, 2:45 am
Posts: 1
Hey guys, I need a simple macro for World of Warcraft.
I play in windowed mode.

I need a script that will press a single key over and over based on a specified number of times.

I have an in game macro that prospects ore for gems. I buy allot of ore, and I dont want to sit their and press a button every time, for like 500+ times.

So I bind my in game macro to the number "1". And all I need for the script to do is press 1 pause five seconds, and press 1 again and loop for like 500 or so times. But the number of times it loops changes based on how much ore I buy so I want to be able to change it easily.

Just something very very simple, no user inputs, I can open the script and edit the number of times it loops myself.

I want to be able to do this stuff myself soon, I just need some help getting started and as Jewelcrafting is how I make my money in WoW I would like this one right away, and then I will teach myself more stuff as time goes on.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2011, 2:52 am 
Offline

Joined: July 6th, 2009, 9:58 pm
Posts: 678
Code:
Loop, 20
{
Send {1} ;key to press, see help file
Sleep, 5000 ;wait five seconds
}
ExitApp


Reading the entire help file front to back, every word, is WELL worth your time invested for learning AHK. There is not a single character in it that isn't worth your reading it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2011, 4:23 am 
Offline

Joined: June 4th, 2010, 9:04 pm
Posts: 1347
Location: california
another way it could be done without even editing the source script is this
Code:
#NoEnv
#SingleInstance, Force
SetTitleMatchMode, 2

gosub LoopIt
Return

; do the loop stuff you can trigger this manually using
; the Alt-L hotkey.
!L::
LoopIt:
Gosub LoadIni
Loop, %TimesToLoop%
{     WinActivate Warcraft
     Send, 1
     Sleep 1000
}
Return

; What this does is: If the ini file doesn't exist it is created
; with a default value of 100 for the times to loop.
; This ini file can be edited with notepad and saved. Reload the new
; data using the hotkey and the script will pick up the new value
; and use that. Now you don't need to stop the script and rerun it
; just reload the ini with the new value.
LoadIni:
!I::
If (!FileExist(MyIni.ini))
{     IniWrite, 100, MyIni.ini, Defaults, TimesToLoop
}
IniRead, TimesToLoop, MyIni.ini, Defaults, TimesToLoop, 100
run, MyIni.ini
Return

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2011, 5:30 am 
Awesome guys, thanks for the help.

Looking over this stuff and trying to learn as much as I can.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher, migz99 and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group