Hi,
I'm pretty sure there's better ways to achieve the same goal;
I tried breadcrumbrling with the perimeter color and it worked weomewhat well, but if anyone would like to try and expand on this, and maybe correct where I went wrong I'd appreciate.
It freezes at around 359 degrees, and increasingly skips at 180.
In concept, it is somehow able to follow a moving, variable perimeter by estimating it's center position.
So, here it is:
#SingleInstance, force
#MaxThreadsperHotkey 2
SysGet, Monitor2, Monitor, 2
CoordMode, Pixel
CoordMode, Mouse
SetBatchLines, 10
SetDefaultMouseSpeed, 0
SetKeyDelay, 0, 0
SetMouseDelay, 0
SetWorkingDir A_ScriptDir
SetFormat, FloatFast, 0.3
RCtrl & F10:: Reload
RCtrl & F11:: Pause
RCtrl & F12:: ExitApp
^!x::
MouseGetPos, X0, Y0
;msgbox %X0%, %Y0%
PixelSearch, PerimeterX0, PerimeterY0, X0, Y0, 2*A_ScreenWidth, Y0 + 1, 0xFF2C2C,, Fast RGB
If ErrorLevel
MsgBox, That color was not found in the specified region.
Else {
Radius:= PerimeterX0 - X0
n:= 0
Cycles:= 0
Degrees:= n
Radians:= n * 0.0174533
RadiusCos0:= Radius * Cos(Radians)
RadiusSin0:= Radius * Sin(Radians)
Loop {
Radians:= n * 0.0174533
Xn:= X%n%
Yn:= Y%n%
RadiusCos%A_Index%:= Radius * Cos(Radians)
RadiusSin%A_Index%:= Radius * Sin(Radians)
RadiusCosA_Index:= RadiusCos%A_Index%
RadiusSinA_Index:= RadiusSin%A_Index%
ScanX%A_Index%:= Xn + RadiusSinA_Index
ScanY%A_Index%:= Yn - RadiusCosA_Index
ScanXA_Index:= ScanX%A_Index%
ScanYA_Index:= ScanY%A_Index%
PixelSearch, PerimeterXA_Index, PerimeterYA_Index, ScanXA_Index - 45, ScanYA_Index - 45, ScanXA_Index + 45, ScanYA_Index + 45, 0xFF2C2C,, Fast RGB
If (ErrorLevel = 0) {
MouseMove, PerimeterXA_Index, PerimeterYA_Index
X%n%:= PerimeterXA_Index - RadiusSinA_Index
Y%n%:= PerimeterYA_Index + RadiusCosA_Index
Xn:= X%n%
Yn:= Y%n%
MovX%A_Index%:= PerimeterXA_Index - ScanXA_Index
MovY%A_Index%:= PerimeterYA_Index - ScanYA_Index
MovXA_Index:= MovX%A_Index%
MovYA_Index:= MovY%A_Index%
X%A_Index%:= Xn - MovXA_Index
Y%A_Index%:= Yn - MovYA_Index
XA_Index:= X%A_Index%
YA_Index:= Y%A_Index%
;Msgbox XA_Index %XA_Index%, YA_Index %YA_Index%, MovXA_Index %MovXA_Index%, MovYA_Index %MovYA_Index%, Xn %Xn%, Yn %Yn%, RadiusCosA_Index %RadiusCosA_Index%, RadiusSinA_Index %RadiusSinA_Index%, ScanXA_Index %ScanXA_Index%, ScanYA_Index %ScanYA_Index%`n`rn Degrees %n%, A_Index %A_Index%
}
If (ErrorLevel = 1) {
PartialTurnCount:= n/360
PartialTurn:= Round (PartialTurnCount, 2)
MsgBox, Out of Bounds, %Cycles% cycles, %PartialTurn% PartialTurns, %n% degrees, %A_Index% iterations
Break
}
n+= 1
If (n > 359) {
n:= 0
Cycles+= 1
}
}
}
Return
Best regards;
- Home Board index AutoHotkey (v1.1 and older) Scripts and Functions (v1)
- Search
-
- It is currently 19 Apr 2024, 22:12
- All times are UTC-05:00
Temptive moving perimeter scan
Post your working scripts, libraries and tools for AHK v1.1 and older
Return to “Scripts and Functions (v1)”
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)
Who is online
Users browsing this forum: No registered users and 232 guests