Jump to content

VB6 MOUSEMOVE on AutoIt, needs help!


Eragon
 Share

Recommended Posts

So i'm trying to set a pixelcolor by pressing letter "J" and then search for it near the mouse.

It works in a 2d enviroment, however, if I enter in a 3D environment, the camera starts to Spin out looking down. I don't know why it works on 2D and not 3D.

Here is the code:

Declare Variables:

Option Explicit

Public AUTOIT As New AutoItX3
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer

Public MOUSEX As Long
Public MOUSEY As Long
Public colordepixel As Long
Public arraypixelsearch() As Variant

Public activobusqueda As Boolean
Private Sub Timer1_Timer()

On Error Resume Next

MOUSEX = AUTOIT.MouseGetPosX
MOUSEY = AUTOIT.MouseGetPosY

If GetAsyncKeyState(vbKeyJ) Then
 colordepixel = AUTOIT.PixelGetColor(MOUSEX, MOUSEY)
    
      Label1.Caption = "J pressed: " & colordepixel
 activobusqueda = Not activobusqueda

     End If
arraypixelsearch() = AUTOIT.PixelSearch(AUTOIT.MouseGetPosX - 100, AUTOIT.MouseGetPosY - 100, AUTOIT.MouseGetPosX + 100, AUTOIT.MouseGetPosY + 100, colordepixel)
If activobusqueda = True Then

Call AUTOIT.MouseMove(arraypixelsearch(0), arraypixelsearch(1))
End If
End Sub

 

Any help would be appreciated.

Thanks in advance,

Luke

Edited by Eragon
Link to comment
Share on other sites

  • Moderators

So, since literally every one of your posts thus far has been about pixelsearch and VB for game automation, even though you have been warned multiple times, please explain in detail what you are trying to accomplish with this latest script, and how it is NOT going against the forum rules.

 

                                              ==================In case you missed it, this is a Mod stepping into a thread==================

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Hi!

It's not game automatization,

i'm trying to create a 3d rendering engine using Truevision 3d Engine in VB6, i'm trying to create a tutorial inside it to explain new players how are the mechanics, thus trying to move their mouse.

The fact is that in the 3d Environment pixelsearch is not working very well.

Thanks,

Lucas

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...