I'm working on a macro bot for DOTA 2, but can't get INPUT function to work. Simple hotkeys seem to work, but only if they don't clash with the game's controls. I'm trying to use the INPUT function to give my macro bot more complex functions and functionality.
In my first bit of code, I'm trying to tell the bot how many "Meepo" characters are in the game (only those who play DOTA 2 will understand the reference) but it doesn't work. Here's part of my code:
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
blank=
endkey=,{enter}{tab}{LShift}{LAlt}{LCtrl}{LWin}{RWin}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BackSpace}{Capslock}{Numlock}{PrintScreen}{Pause}
match=.,?,!
;Initialize variables.
counter := 0
clone_counter := 4
;Enter Bot commands.
;LShift - to enter commands
;3 - to select all characters.
LShift::
{
input, text, i m v *, %endkey%, %match%
if ((text = "1") || (text = "2") || (text = "3") || (text = "4"))
{
clone_counter := text
}
return
}