Jump to content

Script dont work Help pls!


ken107
 Share

Recommended Posts

hey guys this is my script i dont know why it dont work hope someone can help me

 

#include <AutoItConstants.au3>


HotKeySet("{F6}", "Start")
HotKeySet("{ESC}", "Stop")

While 1
    Sleep(100)
WEnd

Func Start()
    While 1
        $SearchResult = PixelSearch(836, 921, 836, 921, 0x2F372A, 10) ;;Find Health pixel (Schwarz)
        If Not @error Then

            MouseMove(845, 901, 0) ;; Bewegt maus auf die einheit die low ist

            MouseClick($MOUSE_CLICK_LEFT) ;; Double Click on the target
            MouseClick($MOUSE_CLICK_LEFT)

            $Pixel = PixelSearch(31, 800, 349, 1018, 0xA8B0A3, 10) ;; Find Base Pixel (Weiß)
            If Then

                MouseMove($Pixel[0], $Pixel[1], 3) ;; Move Mouse to Weiß Pixel
                MouseClick($MOUSE_CLICK_RIGHT) ;;Double right click
                MouseClick($MOUSE_CLICK_RIGHT)

                Sleep(200)

                Do

                Until IsArray($SearchResult) = True
                Sleep(500)


            EndIf

            Sleep(100)

        WEnd
    WEnd
EndFunc    ;==>Start

Func Stop()
    Exit
EndFunc    ;==>Stop

 

ERROR:

(40) : ==> "Wend" statement with no matching "While" statement.:
WEnd

 

 

cant find my mistake :( maybe im too dumb ^^
ty for your help

 

Edited by Jos
Link to comment
Share on other sites

  • Developers

Have a look at your Tidied source which shows your issue closing an If with a Wend.
There are other errors in you code which you can easily find by installing the Full SciTE4AutoIt3 package which runs au3check for you.

Jos

PS: Also please read our forum rules as this script seems to be for some sort of game?

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

ty for the fast answer but now i got other error dunno is my while wrong?

 

 

 

 #include <AutoItConstants.au3>


HotKeySet("{F6}","Start")
HotKeySet("{ESC}","Stop")

While 1
Sleep(100)
WEnd

Func Start ()
         While 1
                  $SearchResult = PixelSearch ( 836, 921, 836, 921, 0x2F372A,10)        ;;Find Health pixel (Schwarz)
                  If Not @error Then

                  MouseMove(845, 901,0)    ;; Bewegt maus auf die einheit die low ist

                  MouseClick($MOUSE_CLICK_LEFT)    ;; Double Click on the target
                  MouseClick($MOUSE_CLICK_LEFT)

         While 2

                  $Pixel = PixelSearch ( 31, 800, 349, 1018, 0xA8B0A3,10 )        ;; Find Base Pixel (Weiß)

                     MouseMove($Pixel[0], $Pixel[1], 3)            ;; Move Mouse to Weiß Pixel
                     MouseClick($MOUSE_CLICK_RIGHT)                ;;Double right click
                     MouseClick($MOUSE_CLICK_RIGHT)

                     Sleep(200)

                     Do

                     Until IsArray ($SearchResult) = True
                     Sleep(500)


                     Sleep(100)

               WEnd
         WEnd                                   (row 40)
   EndFunc

Func Stop ()
   Exit
EndFunc

 

 

 

 

 

(40) : ==> "Wend" statement with no matching "While" statement.:
WEnd
Link to comment
Share on other sites

  • Developers
38 minutes ago, InunoTaishou said:

In SciTE press Ctrl+T and you'll see where the problem lies.

Only after loading the full SciTE4AutoIt3 version. ;)

@ken107, please use the code (<>) box option to post scripts for readability.
Did you do as I suggested?

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

triple post? great ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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