Jump to content

"Wend" statement with no matching "While" statement.:


Newpie
 Share

Recommended Posts

Hiya,

My first time scriptin' here.

Could anyone help me with my script? It keeps complaining that, well, the topic says it all.

$i = 1
While $i = 1
Sleep(1500)
MouseMove(925, 486, 1)
MouseClick("left")
Sleep(4000)
$coord = PixelSearch(997, 514, 1051, 567, 0x0000FF)
If Not @error Then
  MouseMove(979, 448, 1)
  MouseClick("left")
  Sleep(4000)
  $coord = PixelSearch(777, 230, 897, 282, 0x0000FF)
  If Not @error Then
   MouseMove(779, 363, 1)
   MouseClick("left")
   Sleep(4000)
   $coord = PixelSearch(642, 466, 745, 555, 0x0000FF)
   If Not @error Then
    MouseMove(607, 358, 1)
    MouseClick("left")
    Sleep(4000)
    $coord = PixelSearch(391, 228, 597, 289, 0x0000FF)
    If Not @error Then
     $i = 2
    Else
     MouseMove(1027, 633)
     MouseClick("left")
     Sleep(1500)
     MouseClick("left")
   Else
    MouseMove(1027, 633)
    MouseClick("left")
    Sleep(1500)
    MouseClick("left")
  Else
   MouseMove(1027, 633)
   MouseClick("left")
   Sleep(1500)
   MouseClick("left")
Else
  MouseMove(1027, 633)
  MouseClick("left")
  Sleep(1500)
  MouseClick("left")
WEnd

The idea is to make a unique record at virtual Minigolf. First it hits the ball, checks if it's at the right place (due to randomness, the place varies a lot), and repeats. If it's not at the right place, it double clicks a certain spot to start a new game, and repeats the whole script. When it finally gets those hits right, the script stops ($i = 2).

So, any ideas?

(I hope the color code is right, pure blue or something.)

Link to comment
Share on other sites

  • Developers

Load the full SciTE4AutoIt3 installer and run your script through Tidy (Ctrl+T from within SciTE)

This will show what is wrong.

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...