Our members are dedicated to PASSION and PURPOSE without drama!

[VB.NET] Clicker question

Started by Cristal2000, August 22, 2013, 04:43:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cristal2000

Hello to all
I tried this code to find the calculator window
But I have this error



What could it be? Thanks

VLS

Hello dear friend, what's the actual error output from the compiler?

...let's "spat" this bug! [smiley]cps/up.gif[/smiley]

Email/Paypal: betselectiongmail.com
-- Victor

Cristal2000

I've been out for so long
Now I started again the study of VB

I read this old post where there was the code yourself (VLS) entered to create a clicker

ok, the clicker I've already done ...
But I had to do another form to MOVE the window of the casino in an exact position to have ALWAYS
so I always have the usual right coordinates for the bets

Now I would make sure that the window of the casino can put it wherever I want, I remembered your code and I decided to try it, but I got this error





Remember the 6x6? I'm slowly updating with bot ...

this is a video of my test ...  :cheer:


http://youtu.be/sUdrtHyOPvs


Stepkevh

I think that you have declared you're  your GetwindowRect dll import wrong
You have

<DllImport("user32.dll")> _
Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As RECT) As IntPtr
End Function

while it should be

<DllImport("user32.dll")> _
Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As RECT) As Boolean
End Function
Skype :    stepke_vh@hotmail.com

VLS

Quote from: Cristal2000 on August 22, 2013, 08:13:48 PMBut I had to do another form to MOVE the window of the casino in an exact position to have ALWAYSso I always have the usual right coordinates for the bets

Cristal, if you need to use absolute coordinates, remember you can easily calculate the right coordinates for the target window wherever it is.

If you aimed to have window's position always at:

0,0

But it is currently at:

50,75

And your target X,Y coordinate pair is at:

26,37

You simply need to use:

current left + X, current top + Y

In this case:

50 + 26, 75 + 37

=

76, 112

as your new absolute coordinates pair.

Email/Paypal: betselectiongmail.com
-- Victor

Face

Hello Cristal!
When it will be available on the 6x6  Bot program?

Cristal2000

Thank you all ....  :cheer:

I managed somehow to find the coordinates of the window casino
in this way:
first memorize the coordinates of the numbers
with the window casino in position 0;0
and then add the value of the coordinates of the ACTUAL POSITION window casino



Imports System.Runtime.InteropServices
   <System.Runtime.InteropServices.DllImport("user32.dll")> _

    Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As System.IntPtr

    End Function
 
    Dim casinoHwnd As IntPtr

    Dim stRect As RECT
 
    'RECT structure

    Structure RECT

        Public Left As Integer

        Public Top As Integer

        Public Right As Integer

        Public Bottom As Integer

    End Structure
 
    <System.Runtime.InteropServices.DllImport("user32")> _

    Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As RECT) As IntPtr

    End Function
 


    Sub CoordWINDOW()
casinoHwnd = FindWindow(vbNullString, "Casino Window title")

        GetWindowRect(casinoHwnd, stRect)
          Label2.Text = stRect.Left '#### COORD LEFT (X) WINDOW CASINO

        Label1.Text = stRect.Top  '#### COORD TOP (Y) WINDOW CASINO
End Sub


I modified the code
  <System.Runtime.InteropServices.DllImport("user32")> _

     Private Shared Function GetWindowRect (ByVal hwnd As IntPtr, ByRef lpRect As RECT) As IntPtr


I put: lpRect As RECT
and not: lpRect As Rectangle

because I gave this error:

Error 1 Can not convert value of type 'WindowsApplication1.TEST.RECT​​' in 'System.Drawing.Rectangle'.


maybe it's wrong!
but at least something works




small example using the calculator
with the buttons 1, 2, 3, and "+" and "="

I move the window, and always the right button is clicked


http://youtu.be/pcpHcsjMgXM


I then register now coordinates with the window of the casino in position 0 0

and then add the REAL COORDINATES window casino



sorry for my english, I live in Italy

thank you very much  :thumbsup:

Cristal2000

ok, I'm done ...

I was able, thanks to all ...   :cheer: :cheer: :cheer: :cheer: :cheer:

http://youtu.be/FE38icbY3lY


VLS

Congrats dear Cristal [smiley]cps/up.gif[/smiley]


It's very exciting to see your progress.

Email/Paypal: betselectiongmail.com
-- Victor