New to vb but succesful with autoit scripting

red88formula

New member
Joined
Sep 17, 2011
Messages
1
Programming Experience
Beginner
so I have a script/program that i developed in autoit that im interested in converting to vb. The functions i had where A pixelsearch until and a pixelsearch true false along with a sleep delay that read from an input box after delay it would send a keystroke to the game along with mouse move and mouse click and hold. heres a snipet
VB.NET:
Func DETECTLANE()
    $ISLEFT = False
    $ISRIGHT = False
    PixelSearch(442, 380, 449, 388, 2801452, 10)
    If Not @error Then
        $ISLEFT = True
        Return True
    Else
        $ISLEFT = False
    EndIf
    PixelSearch(1227, 380, 1237, 388, 2801452, 10)
    If Not @error Then
        $ISRIGHT = True
        Return True
    Else
        $ISRIGHT = False
    EndIf
    Return False
EndFunc


Func START()
    Opt("SendKeyDelay", 0)
    If Not DETECTLANE() Then
        Return False
    EndIf
    If $ISRIGHT Then
        Do
            $COORD = PixelSearch(859, 393, 866, 405, 13863956, 10)
        Until Not @error
    ElseIf $ISLEFT Then
        Do
            $COORD = PixelSearch(814, 393, 821, 404, 13863956, 10)
        Until Not @error
    EndIf
    Opt("SendKeyDelay", 0)
    $X = Random(875, 886)
    Sleep(GUICtrlRead($INPUT7) * 1000)
    $STOPPED = False
    Send("{Right Down}")
    MouseClick("left", $X, GUICtrlRead($HSLIDER), 1, 0)
    MouseDown("left")
    MouseMove($X, 490, 0)
    Send("{Right Down}")
    Sleep(GUICtrlRead($INPUT1) * 1000)
    Send("{UP}")
    Sleep(GUICtrlRead($INPUT2) * 1000)
    Send("{UP}")
    Sleep(GUICtrlRead($INPUT3) * 1000)
    Send("{UP}")
    Sleep(GUICtrlRead($INPUT4) * 1000)
    Send("{UP}")
    Sleep(GUICtrlRead($INPUT5) * 1000)
    Send("{UP}")
    Sleep(GUICtrlRead($INPUT6) * 1000)
    STOP()
EndFunc


Func STOP()
    Send("{Right Up}")
    $STOPPED = True
EndFunc

Now all of that is done in autoit which is a scripting language. What im interested in is learning how to do this in vb if someone has the time to point me towards the necessary tutorials to do whats listed here i would appreciate it and also on how to save and load from the input boxes
 
Back
Top