Skip to content

Instantly share code, notes, and snippets.

@keeganwitt
Created August 29, 2011 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keeganwitt/1178587 to your computer and use it in GitHub Desktop.
Save keeganwitt/1178587 to your computer and use it in GitHub Desktop.
An AutoHotkey tonic bot for Guild Wars
; Author: Keegan Witt
; Last Updated: 18 Jan 2011
; Adapted from http://www.autohotkey.com/forum/topic55918.html
#NoEnv
#WinActivateForce
SendMode Input
MsgBox, 0, GW Tonic Bot, You can press Ctrl-Q anytime to quit
InputBox, loops, GW Tonic Bot, How many tonics should I drink?
if ErrorLevel
{
ExitApp
}
loops -= 1 ; remove 1, since used when getting tonic position
MsgBox, 0, GW Tonic Bot, Hit OK, then use a tonic
WinActivate, Guild Wars
KeyWait, LButton, D
MouseGetPos, tonicX, tonicY
MsgBox, 0, GW Tonic Bot, Hit OK, then go to (or leave) your guild hall
WinActivate, Guild Wars
KeyWait, LButton, D
MouseGetPos, guildHallX, guildHallY
remainder := 0
If (%loops% == 0)
{
ExitApp
}
Else if (%loops% == 1)
{
WinActivate, Guild Wars
MouseClick, left, tonicX, tonicY, 2
sleep , 100
WinActivate, Guild Wars
MouseClick, left, guildHallX, guildHallY
}
Else
{
remainder = Mod(%loops%, 2)
loops /= 2 ; 1/2 the original amount because will double click twice
}
Loop %loops% {
WinActivate, Guild Wars
MouseClick, left, tonicX, tonicY, 4 ; double click twice to take advantage of GW bug
sleep , 100
WinActivate, Guild Wars
MouseClick, left, guildHallX, guildHallY
Sleep, 4000
}
If (remainder > 0)
{
WinActivate, Guild Wars
MouseClick, left, tonicX, tonicY, 2
sleep , 100
WinActivate, Guild Wars
MouseClick, left, guildHallX, guildHallY
}
ExitApp
^q::ExitApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment