On Screen Display of your XYZ Coordinates in game at the top left corner with CTRL+F8 Hotkey.
CTRL+F5 Hotkey set for measuring distance
CTRL+F9 Reloads the script
I nabbed the pointers on a 64bit machine and I don't recall if it was with a 64bit version of the game so it may or may not work for everyone. Also it was done on Win8.1 so YMMV. This script is not the best of work and any improvements would be appreciated. In the event the game is updated the script will likely fail to work anymore and I may or may not have time to update it. Hopefully Playful will have a better solution than this script by then.
I'd also like to thank Kalamity, tic, cmann, and Frankie Bagnardi for the libraries used otherwise the script would be poop.
You'll need the following libraries
https://github.com/Kalamity/classMemory
https://autohotkey.com/boards/viewtopic.php?t=6517
https://autohotkey.com/boards/viewtopic.php?t=1879
https://gist.github.com/brigand/3941326
Small sample of the script in action
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance Force
#Include classMemory.ahk
#Include Gdip_All.ahk
#Include Gdip_Ext.ahk
#Include GdipHelper.ahk
SetFormat, FloatFast, 0.1
Toggle := 0
; #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.
; You can use this code to check if you have installed the class correctly.
if (_ClassMemory.__Class != "_ClassMemory")
msgbox class memory not correctly installed. Or the (global class) variable "_ClassMemory" has been overwritten
; Open a process with sufficient access to read and write memory addresses (this is required before you can use the other functions)
; You only need to do this once. But if the process closes/restarts, then you will need to perform this step again. Refer to the notes section below.
; Also, if the target process is running as admin, then the script will also require admin rights!
; Note: The program identifier can be any AHK windowTitle i.e.ahk_exe, ahk_class, ahk_pid, or simply the window title.
; hProcessCopy is an optional variable in which the opened handled is stored.
CreativerseProcess := new _ClassMemory("ahk_exe creativerse.exe", "", hProcessCopy)
; Check if the above method was successful.
if !isObject(CreativerseProcess)
{
msgbox failed to open a handle
if (hProcessCopy = 0)
msgbox The program isn't running (not found) or you passed an incorrect program identifier parameter.
else if (hProcessCopy = "")
msgbox OpenProcess failed. If the target process has admin rights, then the script also needs to be ran as admin. Consult A_LastError for more information.
ExitApp
}
SetUpGDIP()
#MaxThreadsPerHotkey, 8
^F8::
Toggle := !Toggle
If WinActive("Creativerse ahk_exe creativerse.exe") && Toggle
{
Gui, Hide
Gui, 1: Show, NA
Loop,
{
If Toggle
{
XAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x50)
YAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x58)
ZAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x54)
StartDrawGDIP()
ClearDrawGDIP()
Width := A_ScreenWidth
Height := A_ScreenHeight
Font = Arial
Options = x10 y10 w80p cbbffdc73 ow4 ocFF000000 r4 s20
Gdip_TextToGraphics2(G, "X: " . XAxisCoord . "`nY: " . YAxisCoord . "`nZ: " . ZAxisCoord, Options, Font, Width, Height)
Sleep, 20
EndDrawGDIP()
If !WinActive("Creativerse ahk_exe creativerse.exe")
{
Gui, Hide
AltTabbed := 1
}
If WinActive("Creativerse ahk_exe creativerse.exe") && AltTabbed
{
Gui, 1: Show, NA
AltTabbed := 0
}
}
Else
{
Gui, Hide
Break
}
}
}
return
^F9::
Reload
Return
#MaxThreadsPerHotkey, 8
^F5::
Toggle := !Toggle
If WinActive("Creativerse ahk_exe creativerse.exe") && Toggle
{
XAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x50)
YAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x58)
ZAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x54)
CurrentX := XAxisCoord
CurrentY := YAxisCoord
CurrentZ := ZAxisCoord
Gui, Hide
Gui, 1: Show, NA
Loop,
{
If Toggle
{
XAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x50)
YAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x58)
ZAxisCoord := CreativerseProcess.read(0x00FF5708 + CreativerseProcess.BaseAddress, "UFloat", 0x48, 0x1C, 0x1C, 0x4, 0x20, 0x54)
DistX := (XAxisCoord - CurrentX)
DistY := (YAxisCoord - CurrentY)
DistZ := (ZAxisCoord - CurrentZ)
StartDrawGDIP()
ClearDrawGDIP()
Width := A_ScreenWidth
Height := A_ScreenHeight
Font = Arial
Options = x10 y10 w80p cbbffdc73 ow4 ocFF000000 r4 s20
Gdip_TextToGraphics2(G, "Distance X: " . DistX . "`nDistance Y: " . DistY . "`nDistance Z: " . DistZ, Options, Font, Width, Height)
Sleep, 20
EndDrawGDIP()
If !WinActive("Creativerse ahk_exe creativerse.exe")
{
Gui, Hide
AltTabbed := 1
}
If WinActive("Creativerse ahk_exe creativerse.exe") && AltTabbed
{
Gui, 1: Show, NA
AltTabbed := 0
}
}
Else
{
Gui, Hide
Break
}
}
}
return
Updated Offsets: Sept 27, 2017