View previous topic :: View next topic |
Author |
Message |
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Fri Jan 18, 2019 10:27 am Post subject: get attached program current position [help] |
|
|
Hello,
how do i get attached program current position in Lua?
thanks
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
Nighthawyun Cheater Reputation: 0
Joined: 21 Jan 2019 Posts: 27
|
Posted: Mon Jan 21, 2019 7:35 pm Post subject: |
|
|
hi lynxz do u know me?
|
|
Back to top |
|
|
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Wed Jan 23, 2019 6:03 am Post subject: |
|
|
aww nighthawk
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Wed Jan 23, 2019 10:28 am Post subject: |
|
|
if you mean x,y position of the window perhaps sendMessage can be used with a comnand to get coordinates (you'll also need to find the window)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Thu Jan 24, 2019 5:21 am Post subject: |
|
|
can you give me an example
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Jan 24, 2019 6:54 am Post subject: |
|
|
MAYBE, to get and show window / screen coordinate position.
Something like...
Code: | f = createForm()
f.width = 200
f.height = 100
lx = createLabel(f)
lx.left = 10
lx.top =10
lx.caption = 'X-pos : '
ly = createLabel(f)
ly.left = lx.width + 50
ly.top =10
ly.caption = 'Y-pos : '
MPos_X = createLabel(f)
MPos_X.top = 10
MPos_X.left = 50
MPos_X.caption = '0'
MPos_X.Font.Color = '0x0311FF'
MPos_X.Font.Style = 'fsBold'
MPos_Y = createLabel(f)
MPos_Y.top = 10
MPos_Y.left = 130
MPos_Y.caption = '0'
MPos_Y.Font.Color = '0x0311FF'
MPos_Y.Font.Style = 'fsBold'
btn1 = createButton(f)
btn1.left = 10
btn1.top = 40
btn1.width = 100
btn1.height = 30
btn1.caption = 'Start Over'
f:show()
--------------
local x, y = getMousePos()
MPos_X.caption = tostring(x)
MPos_Y.caption = tostring(y)
---------------
function startOver()
x=0
y=0
setMousePos({x=0,y=0})
MPos_X.caption = tostring(x)
MPos_Y.caption = tostring(y)
z=createTimer(nil)
z.Interval=100
z.OnTimer=function(z)
--x.destroy()
--y.destroy()
local x, y = getMousePos()
MPos_X.caption = tostring(x)
MPos_Y.caption = tostring(y)
end
z.Enabled=true
end
---------------
btn1.onClick = startOver |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Fri Jan 25, 2019 7:54 am Post subject: |
|
|
Corroder, what i mean is how to get process windows coordinate, thx
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Fri Jan 25, 2019 8:19 am Post subject: |
|
|
Oh, then I don't know how to do it with lua. May something there in LuaAPI.
But, this code with VB to get coordinate running in process (external app) :
Code: | Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll", EntryPoint:="FindWindowW")> _
Private Shared Function FindWindowW(<MarshalAs(UnmanagedType.LPTStr)> ByVal lpClassName As String, <MarshalAs(UnmanagedType.LPTStr)> ByVal lpWindowName As String) As IntPtr
End Function
<DllImport("user32.dll", EntryPoint:="GetWindowRect")> _
Private Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
<StructLayout(LayoutKind.Sequential)> _
Private Structure RECT
Public left, top, right, bottom As Integer
End Structure
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hWnd As IntPtr = FindWindowW(Nothing, "untitled - notepad")
If hWnd <> IntPtr.Zero Then
Dim wr As New RECT
GetWindowRect(hWnd, wr)
MessageBox.Show("The window position is - X=" & wr.left.ToString & " Y=" & wr.top.ToString)
Else
MessageBox.Show("Window not found")
End If
End Sub
End Class |
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL |
|
Back to top |
|
|
|