Eragon Posted April 29, 2021 Posted April 29, 2021 (edited) 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 April 29, 2021 by Eragon
Moderators JLogan3o13 Posted April 29, 2021 Moderators Posted April 29, 2021 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!
Eragon Posted April 29, 2021 Author Posted April 29, 2021 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now