Jump to content

Gives off Erorr


snoopy
 Share

Recommended Posts

Hi all :) me again -.-

Such anoob but still need help

#include <GUIConstants.au3>
#include<WindowsConstants.au3>

Global $f_Run = False, $f_AnyChecked = False

Global $Form1 = GUICreate("Form1", 625, 444, 189, 146)
$Pic1 = GUICtrlCreatePic("C:\Users\Snoopy\Desktop\toontown%20awesome%20picture.jpg", 0, 0, 625, 441, 0)
GUISetState($GUI_DISABLE)
GuiCtrlSetState($pic1, $GUI_DISABLE)
Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0)
GUICtrlSetFont(-1, 15, 800, 0, "MS Serif")
GUICtrlSetBkColor(-1, 0xFFFFE1)

$checkbox_dummy_start = GUICtrlCreateDummy()
Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0)
Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0)
Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0)
Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0)
$checkbox_dummy_end = GUICtrlCreateDummy()

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

GUISetState(@SW_SHOW)



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
           
        Case $Credits
            MsgBox(64, "Credits", "Matthew Povolotski, Toon:Sniffy Macnose")
           
        Case $MyButton1
            HotKeySet("{F5}", "_StopIt")
            $f_Run = True
            While $f_Run
                $f_AnyChecked = False
                If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    Local $randomcoords[7][2] = [[210,62],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]]
       $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F)
If IsArray($pixelSearch)=1 Then 
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) 
EndIf
sleep( 100)
        $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999)
If IsArray($pixelSearch)=1 Then 
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0)
EndIf
        $r = Random(0,6,1)
        MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1)
        EndIf

                   
        Case $MyButton2
            HotKeySet("{F5}", "_StopIt")
            $f_Run = True
            While $f_Run
                $f_AnyChecked = False
                If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    Local $randomcoords[7][2] = [[289,83],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]]
       $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F)
If IsArray($pixelSearch)=1 Then 
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0) 
EndIf
sleep( 100)
        $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999)
If IsArray($pixelSearch)=1 Then 
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0)
EndIf
        $r = Random(0,6,1)
        MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1)
        EndIf
                If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1)
                EndIf
                If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1)
                EndIf
                If Not $f_AnyChecked Then ExitLoop
            WEnd
            HotKeySet("{F5}")
    EndSwitch
WEnd

Func _StopIt()
    $f_Run = False
EndFunc


Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0xFFFF) ;LoWord
    Switch $iIDFrom
        Case $checkbox_dummy_start to $checkbox_dummy_end
            for $i = $checkbox_dummy_start to $checkbox_dummy_end
                if $i <> $iIDFrom then GUICtrlSetState($i,4)
            Next
    EndSwitch
EndFunc

what is wrong with my script?

where do i add Wend? -.-?-.-?

Edited by snoopy
Link to comment
Share on other sites

  • Developers

Where did you find the script ?

Use tidy and or au3check to help you show your issues:

#include <GUIConstants.au3>
#include<WindowsConstants.au3>
Global $f_Run = False, $f_AnyChecked = False
Global $Form1 = GUICreate("Form1", 625, 444, 189, 146)
$Pic1 = GUICtrlCreatePic("C:\Users\Snoopy\Desktop\toontown%20awesome%20picture.jpg", 0, 0, 625, 441, 0)
GUISetState($GUI_DISABLE)
GUICtrlSetState($Pic1, $GUI_DISABLE)
Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0)
GUICtrlSetFont(-1, 15, 800, 0, "MS Serif")
GUICtrlSetBkColor(-1, 0xFFFFE1)
$checkbox_dummy_start = GUICtrlCreateDummy()
Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0)
Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0)
Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0)
Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0)
$checkbox_dummy_end = GUICtrlCreateDummy()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Credits
            MsgBox(64, "Credits", "Matthew Povolotski, Toon:Sniffy Macnose")
        Case $MyButton1
            HotKeySet("{F5}", "_StopIt")
            $f_Run = True
            While $f_Run
                $f_AnyChecked = False
                If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    Local $randomcoords[7][2] = [[210, 62],[200, 77],[200, 93],[200, 108],[200, 124],[200, 139],[200, 156]]
                    $pixelSearch = PixelSearch(57, 45, @DesktopWidth, @DesktopHeight, 0xB4EC8F)
                    If IsArray($pixelSearch) = 1 Then
                        MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0)
                    EndIf
                    Sleep(100)
                    $pixelSearch = PixelSearch(153, 62, @DesktopWidth, @DesktopHeight, 0x080999)
                    If IsArray($pixelSearch) = 1 Then
                        MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0)
                    EndIf
                    $r = Random(0, 6, 1)
                    MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1)
                EndIf
            Case $MyButton2
                HotKeySet("{F5}", "_StopIt")
                $f_Run = True
                While $f_Run
                    $f_AnyChecked = False
                    If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then
                        $f_AnyChecked = True
                        Local $randomcoords[7][2] = [[289, 83],[200, 77],[200, 93],[200, 108],[200, 124],[200, 139],[200, 156]]
                        $pixelSearch = PixelSearch(57, 45, @DesktopWidth, @DesktopHeight, 0xB4EC8F)
                        If IsArray($pixelSearch) = 1 Then
                            MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0)
                        EndIf
                        Sleep(100)
                        $pixelSearch = PixelSearch(153, 62, @DesktopWidth, @DesktopHeight, 0x080999)
                        If IsArray($pixelSearch) = 1 Then
                            MouseClick("left", $pixelSearch[0], $pixelSearch[1], 1, 0)
                        EndIf
                        $r = Random(0, 6, 1)
                        MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1)
                    EndIf
                    If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then
                        $f_AnyChecked = True
                        MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1)
                    EndIf
                    If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then
                        $f_AnyChecked = True
                        MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1)
                    EndIf
                    If Not $f_AnyChecked Then ExitLoop
                WEnd
                HotKeySet("{F5}")
;### Tidy Error -> "endswitch" is closing previous "case" on line 25
        EndSwitch
;### Tidy Error -> "wend" is closing previous "switch" on line 24
    WEnd
;### Tidy Error -> while Not closed before "Func" statement.
;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.
    Func _StopIt()
        $f_Run = False
    EndFunc  ;==>_StopIt
;### Tidy Error -> while Not closed before "Func" statement.
;### Tidy Error -> "func" cannot be inside any IF/Do/While/For/Case/Func statement.
    Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
        Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord
        Switch $iIDFrom
            Case $checkbox_dummy_start To $checkbox_dummy_end
                For $i = $checkbox_dummy_start To $checkbox_dummy_end
                    If $i <> $iIDFrom Then GUICtrlSetState($i, 4)
                Next
        EndSwitch
    EndFunc  ;==>WM_COMMAND;### Tidy Error -> while is never closed in your script.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

add a wend to line 59 and then need to declare MyButton2

#include <GUIConstants.au3>
#include<WindowsConstants.au3>

Dim $MyButton2; need to declare MyButton2

Global $f_Run = False, $f_AnyChecked = False

Global $Form1 = GUICreate("Form1", 625, 444, 189, 146)
$Pic1 = GUICtrlCreatePic("C:\Users\Snoopy\Desktop\toontown%20awesome%20picture.jpg", 0, 0, 625, 441, 0)
GUISetState($GUI_DISABLE)
GuiCtrlSetState($pic1, $GUI_DISABLE)
Global $Credits = GUICtrlCreateButton("Credits", 0, 0, 153, 65, 0)
GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif")
Global $MyButton1 = GUICtrlCreateButton("Start", 520, 0, 100, 30, 0)
GUICtrlSetFont(-1, 15, 800, 0, "MS Serif")
GUICtrlSetBkColor(-1, 0xFFFFE1)

$checkbox_dummy_start = GUICtrlCreateDummy()
Global $CheckBox1 = GUICtrlCreateCheckbox("Jump", 520, 32, 100, 30, 0)
Global $CheckBox2 = GUICtrlCreateCheckbox("Beg", 520, 72, 100, 30, 0)
Global $CheckBox3 = GUICtrlCreateCheckbox("Say", 520, 112, 100, 30, 0)
Global $CheckBox4 = GUICtrlCreateCheckbox("Roallover", 520, 160, 100, 30, 0)
$checkbox_dummy_end = GUICtrlCreateDummy()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

GUISetState(@SW_SHOW)



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
           
        Case $Credits
            MsgBox(64, "Credits", "Matthew Povolotski, Toon:Sniffy Macnose")
           
        Case $MyButton1
            HotKeySet("{F5}", "_StopIt")
            $f_Run = True
            While $f_Run
                $f_AnyChecked = False
                If BitAND(GUICtrlRead($CheckBox1), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    Local $randomcoords[7][2] = [[210,62],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]]
       $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F)
If IsArray($pixelSearch)=1 Then
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0)
EndIf
sleep( 100)
        $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999)
If IsArray($pixelSearch)=1 Then
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0)
EndIf
        $r = Random(0,6,1)
        MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1)
        EndIf

WEnd;needed to add a wend here
        Case $MyButton2
            HotKeySet("{F5}", "_StopIt")
            $f_Run = True
            While $f_Run
                $f_AnyChecked = False
                If BitAND(GUICtrlRead($CheckBox2), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    Local $randomcoords[7][2] = [[289,83],[200,77],[200,93],[200,108],[200,124],[200,139],[200,156]]
       $pixelSearch=PixelSearch(57,45,@DesktopWidth,@DesktopHeight,0xB4EC8F)
If IsArray($pixelSearch)=1 Then
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0)
EndIf
sleep( 100)
        $pixelSearch=PixelSearch(153,62,@DesktopWidth,@DesktopHeight,0x080999)
If IsArray($pixelSearch)=1 Then
MouseClick("left",$pixelSearch[0],$pixelSearch[1],1,0)
EndIf
        $r = Random(0,6,1)
        MouseClick("left", $randomcoords[$r][0], $randomcoords[$r][1], 1)
        EndIf
                If BitAND(GUICtrlRead($CheckBox3), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 3", "CheckBox 3 is checked", 1)
                EndIf
                If BitAND(GUICtrlRead($CheckBox4), $GUI_CHECKED) Then
                    $f_AnyChecked = True
                    MsgBox(64, "Checkbox 4", "CheckBox 4 is checked", 1)
                EndIf
                If Not $f_AnyChecked Then ExitLoop
            WEnd
            HotKeySet("{F5}")
    EndSwitch
WEnd

Func _StopIt()
    $f_Run = False
EndFunc


Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord
    Switch $iIDFrom
        Case $checkbox_dummy_start to $checkbox_dummy_end
            for $i = $checkbox_dummy_start to $checkbox_dummy_end
                if $i <> $iIDFrom then GUICtrlSetState($i,4)
            Next
    EndSwitch
EndFunc
Edited by will88
Link to comment
Share on other sites

"where did you find the script"

answer=Made it my self -.-

You wrote this yourself, but don't know what "declare" means...? :lmao:

Riiiiiiiiight!

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • Developers

Man, if you see forum i asked lots of quistions, like pixel and stuff and gatherd info and cam up with this.. -.- what do you mean yeah??

Yeah really means in this case: "You could have fooled me....."

by the way... count me in to that one.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Yeah really means in this case: "You could have fooled me....."

by the way... count me in to that one.

-.- when i tick the check box , it starts to run right away and without even pressing the START on it,

and F5(short cut for stop) doesent seem to work when i try it....

any tips?

however it doesent aply to Jump, and thats what i exacly need, I want it to be ticked and than press start and than it will act , but doesent seem to be what i want it to be like ....

Edited by snoopy
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...