I decided to share a script I made to help me with making my Gaming Scripts,
I tweaked it a little bit to make it a lot more user friendly
You can find All my "Released" Scripts here (will be updated soon)
Here's the Position Script Revisioned:
Code: Select all
#SingleInstance force
menu, tray, add
menu, tray, add, Made By Sanctus, MadeBy
Menu, Tray, Tip, PositionInfo v1.03`nMade by Sanctus
return
!x::
MouseGetPos, PosX, PosY
PixelGetColor, cRGB , %PosX%, %PosY%,RGB
PixelGetColor, cBGR , %PosX%, %PosY%
WinGetPos,,, w, h, A
gui, new
gui, Default
gui, +LastFound +LabelMyGui
gui, add, groupbox, w205 h330, Info found at Mouse Position
gui, font, s12, Arial
gui, add, text, xm12 ym20 section, MousePos X:
gui, add, text, xp+110 yp, %PosX%
gui, add, text, xp-110 yp+15, MousePos Y:
gui, add, text, xp+110 yp, %PosY%
gui, add, text, xp-110 yp+15, BGR Colour:
gui, add, text, xp+110 yp, %cBGR%
gui, add, text, xp-110 yp+15, RGB Colour:
gui, add, text, xp+110 yp, %cRGB%
gui, font, s8, Arial
gui, add, button, xp-70 yp+17.5 w100 h20 gClip, Copy X and Y
gui, add, button, xp yp+20.5 w100 h20 gClipColor, Copy Colour
gui, font, s12, Arial
gui, add, button, xp+30 yp+25 gDone, OK
gui, add, Progress, xp-7.5 yp+35 w50 h50 c%cRGB%,100
gui, font, s10, Verdana
gui, add, text, yp+40 xp-65, Version: 1.03 (31.03.2014)
gui, add, text, xp+10 yp+20.5, Window Size: %w% x %h%
gui, add, button, xp-10 yp+20.5 w180 h20 gWS, Copy Window Size
gui, add, button, xp yp+20.5 w180 h20 gARF, Copy ARFormula
gui, add, button, xp yp+20.5 w180 h40 gARFB, Copy ARFormula with Border Calculations
gui, show,, Position/Colour of X&Y
return
Done:
{
gui,submit,nohide
gui, destroy
return
}
Clip:
{
clipboard = %PosX% %PosY%
return
}
ClipColor:
{
clipboard = %cBGR%
return
}
WS:
{
clipboard = %w% %h%
return
}
ARF:
{
clipboard = % "% Round(" . PosX . " / (" . w . " / w)) % Round(" . PosY . " / (" . h . " / h))"
return
}
ARFB:
{
clipboard = % "% Round(" . PosX . " / (" . w . " / (w - i))) + l % Round(" . PosY . " / (" . h . " / (h - j))) + k"
return
}
return
MadeBy:
Run http://tus.web1337.net/
return
F7::Reload
F8::ExitApp
- Position your mouse cursor inside a game/program or just on the desktop.
- Press Alt + x to get a pop-up displaying the Coordinates and BGR/RGB colour of that location.
- You can redo that as many times as you want (do not need to close the window).
- Press Esc to Close all active windows of the application.
- Press F8 to Exit the Application (Closes all the Windows)
- Always use the BGR colour by default, ahk doesn't use RGB innately.
- Make sure that anytime your running code with anyres formula to also run [code=autohotkey]WinGetPos,,, w, h, A[/code]
- To get the active window width and height
- Check if the application will always run fullscreen borderless or if it will always run without borders (league of legends for example)
- If that is the case then use the Simple ARFormula heres an example [code=autohotkey]MouseClick, Left, % Round(538 / (1280 / w)), % Round(447 / (800 / h))[/code]
- If the user has the option to run it fullscreen borderless or windowed (has borders)
- You might want to add precations and use the Advanced ARFormula heres an example [code=autohotkey]IniRead, i, borderonoff.ini, border, i IniRead, j, borderonoff.ini, border, j IniRead, k, borderonoff.ini, border, k IniRead, l, borderonoff.ini, border, l F1:: WinGetPos,,, w, h, A MouseClick, Left, % Round(962 / (1920 / (w - i))) + l, % Round(432 / (1080 / (h - j))) + k, Fast return Border: ;For Windowed (with Borders) i = 16 j = 38 l = 8 k = 30 IniWrite, %i%, borderonoff.ini, border, i IniWrite, %j%, borderonoff.ini, border, j IniWrite, %l%, borderonoff.ini, border, l IniWrite, %k%, borderonoff.ini, border, k return Borderless: ;For Fullscreen Borderless i = 0 j = 0 l = 0 k = 0 IniWrite, %i%, borderonoff.ini, border, i IniWrite, %j%, borderonoff.ini, border, j IniWrite, %l%, borderonoff.ini, border, l IniWrite, %k%, borderonoff.ini, border, k return F5:: goto, Border return F6:: goto, Borderless return[/code]
- In Windows7 the border values are 8 each side, 30 top and 8 bottom border. Other Operating Systems may vary
- The Window Border needs to be taken away from the "new" width of the application and then only one side added at the very end of the formula.
To work around fullscreen games:
The fix I implement now instead of often changing into windowmode (which doesnt always work) is this:
Take a screenshot of the game and its interface.
Save it to your computer/desktop.
Open it using Windows Photo Viewer (default photo viewing program in windows)
Press F11 to make it fullscreen
Right Click and Click on Pause (so it doesnt slide to the next image)
Now you have all the time to position your mouse to where you want and capture all locations in one go.
The ARFormula has been tested in 3 games so far and no issues have been detected so far in any resolution.
Good Luck and Enjoy.