Sign in to follow this  
Followers 0
Newpie

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

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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

This will show what is wrong.

Jos


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

Share this post


Link to post
Share on other sites

Hi Newpie,

also read the forum rules, as discussing automation of games is not permitted on these forums.

Thread reported.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0