Jump to content
Sign in to follow this  
snoopy

Gives off Erorr

Recommended Posts

snoopy

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

Share this post


Link to post
Share on other sites
snoopy

it Shows off Erorr when i try and Run but cant figure out where the error acures

Share this post


Link to post
Share on other sites
Jos

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.

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
will88

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

Share this post


Link to post
Share on other sites
snoopy

"where did you find the script"

answer=Made it my self -.-

Share this post


Link to post
Share on other sites
snoopy

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

tnx Taara :) declare you mean?Dec?

Share this post


Link to post
Share on other sites
PsaltyDS

"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

Share this post


Link to post
Share on other sites
snoopy

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??

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
snoopy

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

Share this post


Link to post
Share on other sites
snoopy

Sure... debug it....

Jos

Could I use Auto Debugger? would it work?

Share this post


Link to post
Share on other sites
snoopy

Sure...

man.....I would like to learn to use debbuger.

can anyone give me 1st tips of how debbugging through auto dibbuger?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.