I am rather new to AHK, but I have been digging all night through forums trying to piece together different scripts for my needs with no luck, maybe someone can help show me how to build it properly.
What I am trying to do is: When a pixel is equal to a specific color at a certain coordinate on screen, send an input, (or alternatively, mouse click on that same coordinate).
In best case scenario, and I'm not sure this is possible, but I would prefer this script to loop while holding a key, and when I am done holding a key it stops looping until I press it again. Otherwise, just a key that loops the script for 5 seconds per pressing would be a fine alternative.
I basically tried a bunch of variations using PixelGetColor and Window Spy.
I have a couple issues, one is that the input is sent into the active window I desire, even though I am in that window actively, not full screen, using the coordinates from Window Spy. However, if I alt-tab or click into my second monitor, I could see AHK spamming the input on my desktop, but if I clicked back in the window I desire it to work inside of, it was not sending any input. Do I have to somehow specify the specific window where to send the input? The other issue is it doesn't seem to care that the color was not equal to what I defined at those coordinates - it would just send the input infinitely the second I ran the script until I closed AHK.
So basically, best case, I want to hold a key such as the letter F. It looks for color 0xInsertHere at the X Y coordinates of a specific active window, and if that color is there, it sends the input once (or clicks on those coordinates).
Sending input when pixel color changes at a specific location
Ask gaming related questions (AHK v1.1 and older)
-
- Posts: 1
- Joined: 19 Jan 2022, 23:29
Sending input when pixel color changes at a specific location
Post by thistlewhistle » 19 Jan 2022, 23:53
Last edited by gregster on 19 Jan 2022, 23:54, edited 1 time in total.
Reason: Topic moved from 'Scripts and Functions > ...'.
Reason: Topic moved from 'Scripts and Functions > ...'.
Jump to
- AutoHotkey Foundation
- ↳ About This Community
- ↳ Forum Issues
- AutoHotkey (v2, current version)
- ↳ Ask for Help (v2)
- ↳ Gaming
- ↳ Scripts and Functions (v2)
- ↳ Gaming
- ↳ Tutorials (v2)
- ↳ Tips and Tricks
- ↳ Wish List
- ↳ Suggestions on Documentation Improvements
- ↳ Bug Reports
- ↳ AutoHotkey Development
- ↳ AutoHotkey_H
- ↳ Ask for Help
- ↳ Development
- ↳ Editors
- ↳ Adventure IDE
- ↳ Old Topics
- ↳ AHK Studio
- ↳ Notepad++
- ↳ Pulovers Macro Creator
- ↳ SciTE4AutoHotkey
- ↳ Visual Studio Code
- ↳ Announcements
- ↳ General Discussion
- AutoHotkey (v1.1 and older)
- ↳ Ask for Help (v1)
- ↳ Gaming Help (v1)
- ↳ Scripts and Functions (v1)
- ↳ Gaming Scripts (v1)
- ↳ Tutorials (v1)
- ↳ Tips and Tricks (v1)
- General
- ↳ Other Utilities & Resources
- ↳ Other Programming Languages
- ↳ C/C++
- ↳ ASM
- ↳ C#
- ↳ KeySharp
- ↳ Off-topic Discussion
- ↳ RPA
- Other languages
- ↳ Looking for Volunteers in other languages
- ↳ Deutsch (German)
- ↳ Ich brauche Hilfe
- ↳ Spiele
- ↳ Skripte und Funktionen
- ↳ Tutorials
- ↳ Tooltime
- ↳ Allgemeines
- ↳ 中文 (Chinese)
- ↳ 请求帮助
- ↳ 脚本函数
- ↳ 教程资料
- ↳ 相关工具
- ↳ 其他
- ↳ Español (Spanish)
- ↳ Pedir Ayuda
- ↳ Automatización de Juegos
- ↳ Scripts y Funciones
- ↳ Tutoriales
- ↳ Otras Utilidades y Recursos
- ↳ General
- ↳ Русский (Russian)
- ↳ Помощь
- ↳ Скрипты для Игр
- ↳ Скрипты и библиотеки
- ↳ Статьи и руководства
- ↳ Прочие ресурсы и ПО.
- ↳ Свободное общение
- ↳ Français (French)
- ↳ J'ai besoin d'aide
- ↳ Scripts et Fonctions
- ↳ Tutoriels
- ↳ Autres Utilitaires et Ressources
- ↳ Hors Sujet
- ↳ Português (Portuguese)
- ↳ Ajuda e Suporte Geral
- ↳ Scripts e Funções
- ↳ Tutoriais
- ↳ Outras Ferramentas e Recursos
- ↳ Outros Assuntos
- ↳ 한국어 (Korean)