Sign in to follow this  
Followers 0
PR3BI

Problem with script

8 posts in this topic

#1 ·  Posted (edited)

I've made this script:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.10.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
Dim $My_Color = 0xFFFFFF
Dim $Game, $MID
HotKeySet("{F8}")
HotKeySet("{F9}")

Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)

GUICreate("Aimbot Test", 614, 370)
GUISetFont(9, 400, "MS Sans Serif")
$B_oIE3 = ObjCreate("Shell.Explorer.2")
$Breaktime = GUICtrlCreateObj($B_oIE3, -45, -140, 540, 510)
$html2 = "about:<br><text> This is only a test.</text></br>"
$B_oIE3.navigate ($html2)
GUICtrlCreateLabel ("Game Bot", 503, 80, 150)
GUICtrlSetFont( -1, 12, 700)
GUICtrlCreateLabel ("PixelSearch", 505, 120, 150)
GUICtrlSetFont (-1, 12, 700)
$BrkStart = GUICtrlCreateButton("Enter Game", 505, 300, 80, 25)
$BrkEnd = GUICtrlCreateButton("Exit", 505, 330, 80, 25)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $BrkEnd Then
        Exit
    EndIf
    If $msg = $BrkStart Then
        $B_oIE3.navigate ("file:///C:/Users/P/Desktop/pingpong.swf")
        Sleep(1500)
        $B_oIE3.navigate ("file:///C:/Users/P/Desktop/pingpong.swf")
        Sleep(1500)
        MsgBox(262208, "How to Play", "Move the racket to hit the ball" & @CRLF & "Or, press [F9] to use the Game Bot")
        ToolTip("Press F9 to use the Game Bot", 0, 0)
    EndIf
WEnd
Func Game_Bot()
    $Game = Not $Game
    if $Game then tooltip("Press F9 to exit the Game Bot", 0, 0)
        While $Game
            $ball = PixelSearch (375, 482, 638, 473, 904. 485, $My_Color, 50, 10)
            If Not @error Then MouseClick("left",  $ball[0], $ball[1], 1, 0)
            WEnd
            ToolTip("")
        EndFunc
        
        Func Get_coord()
            $MID = NOT $MID
            While $MID
                $pos = MouseGetPos()
                ToolTip("Mouse Coordinates" & @CRLF & " X = " & $pos[0] & " Y = " & $pos[1], 0, 0)
                Sleep(20)
            WEnd
            ToolTip("")
            
            EndFunc

And the problem is that the bot won't start when i hit the start button (of the bot it self).

Perhaps I've put in the wrong color, but i think it's the right one, cuz the ball's white, and I've put in 0xFFFFFF in $My_Color. So, if u can figure out the problem, i would be very greatful.

PS, It's my first script. :D

Edited by PR3BI

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Well I don't think your Hot Key's are going to do much :D

Try editing

HotKeySet ("{F9}")

To:

HotKeySet("{F9}", "Game_Bot")

Considering f8 is the start key!

Same would go to the F8 key too, but for whatever function it is meant to call =]

Edited by Dampe

Share this post


Link to post
Share on other sites

Thx! I'll try it.

PS: The F8 isn't the start button, it's a "quick" get coord for where i hold my mouse. :D :D

Share this post


Link to post
Share on other sites

Damn! I got that problem out, and got a new one x) Now there's something wrong with my coords. Which i don't understand, cuz they're right accourding 2 the game :/ Sooo i thill need help guys :D

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thx! I'll try it.

PS: The F8 isn't the start button, it's a "quick" get coord for where i hold my mouse. :):D

Oh, sorry :D

Mis-read that.

Well if F9 is the start key,

HotKeySet("{F8", "Get_coord")

HotKeySet ("{F9}", "Game_Bot")

Try that =]

Edited by Dampe

Share this post


Link to post
Share on other sites

I did, but there's something wrong with my coords now =S

Share this post


Link to post
Share on other sites

BUMP

Share this post


Link to post
Share on other sites

See this line: $ball = PixelSearch (375, 482, 638, 473, 904. 485, $My_Color, 50, 10)

Try change it to: $ball = PixelSearch (375, 482, 638, 473, 904, 485, $My_Color, 50, 10)

Share this post


Link to post
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
Sign in to follow this  
Followers 0