game physics - Please help me write scripts with AutoHotkey -


i've been inspired art of writing scripts on autohotkey. beginner desperately needs insight. appreciate time , input on matter.

primary objective: looping script interaction

i'd have single script running @ time trigger 1 upon given events. have 2 scripts, let's name them , b. a's mission perform given tasks until finds specific image trigger b. b's mission perform given tasks image until disappears trigger a.

as far looping script interaction, here's i've got.

here's a.ahk:-

loop    imagesearch, px, py, 1, 1, 10, 10, %a_workingdir%image.png   if errorlevel = 1     wheeldown   else     run, %a_workingdir%b.ahk  return 

here's b.ahk:-

loop    imagesearch, px, py, 1, 1, 10, 10, %a_workingdir%image.png   if errorlevel = 0     click %px%, %py%   else     run, %a_workingdir%a.ahk  return 

please let me know if doing correctly.. imagesearch, can write x, y, instead of px, py? wondering on differences.

secondary objective: programming mouse movement

i'm lacking knowledge giving specific tasks script a. here's scenario, game called legend of darkness otherwise known darkages. 2d game , avatar idle shown in center of screen. once push spacebar, trigger teleport map overlapping previous screen. however, teleport distance limited shown on teleport map in 2 colors. blue: available teleport red: not available teleport once click desired blue zone, highlighted green. click green confirmation, avatar teleports.

assuming world being rectangular, i'd avatar roam around edge until finds image trigger b script. after dealing image, i'd avatar continue journey point b triggered.

i don't know how should start 'a' script. understand broad question many possible directions of insights on commands should consider studying @ least start me off solving problem. perhaps should correspond teleport limit limiting coordinates? x=n, y=n

once again, appreciate time reading this! input wonders!

a code combined both loops this. 1 other loop, starts first loop a, leaves loop break command, b, leaves b, loops itself.

loop,  {    ;loop    loop,   {     imagesearch, px, py, 1, 1, 10, 10, %a_workingdir%image.png     if errorlevel = 1       wheeldown     else       break   }    ;loop b    loop,   {     imagesearch, px, py, 1, 1, 10, 10, %a_workingdir%image.png     if errorlevel = 0       click %px%, %py%      else       break   }       sleep, 100 }   

regarding px,py. these variable names can use allowed variable name here. x , y totally fine.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -