Originally posted\made by this sweetie -> @0x688 http://ugbase.eu/Thread-Perfect-crosshair-pos?pid=98743
Output parameters are float
Usage : call @crosshair_coords 0 x_out 0@ y_out 1@
[shcode=cpp]
:crosshair_coords
0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen
0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen
0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0
0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0
0093: 22@ = integer 23@ to_float@
006F: 22@ *= 25@
0093: 29@ = integer 23@ to_float
29@ *= 0.0015625
29@ *= 64.0
29@ *= 0.2
29@ *= 0.1
0063: 22@ -= 29@ // (float)
///////
0093: 10@ = integer 24@ to_float
006F: 10@ *= 26@
0093: 11@ = integer 24@ to_float
11@ *= 0.002232143
11@ *= 64.0
11@ *= 0.2
11@ *= 0.1
0063: 10@ -= 11@ // (float)
ret 2 22@ 10@
[/shcode]
Output parameters are float
Usage : call @crosshair_coords 0 x_out 0@ y_out 1@
[shcode=cpp]
:crosshair_coords
0A8D: 23@ = read_memory 0xC9C040 size 4 virtual_protect 0 //x screen
0A8D: 24@ = read_memory 0xC9C044 size 4 virtual_protect 0 //y screen
0A8D: 25@ = read_memory 0xB6EC14 size 4 virtual_protect 0
0A8D: 26@ = read_memory 0xB6EC10 size 4 virtual_protect 0
0093: 22@ = integer 23@ to_float@
006F: 22@ *= 25@
0093: 29@ = integer 23@ to_float
29@ *= 0.0015625
29@ *= 64.0
29@ *= 0.2
29@ *= 0.1
0063: 22@ -= 29@ // (float)
///////
0093: 10@ = integer 24@ to_float
006F: 10@ *= 26@
0093: 11@ = integer 24@ to_float
11@ *= 0.002232143
11@ *= 64.0
11@ *= 0.2
11@ *= 0.1
0063: 10@ -= 11@ // (float)
ret 2 22@ 10@
[/shcode]