Jump to content

While statement has no matching Wend Statement - (Locked)


Recommended Posts

So im making a runescape bot and im getting this error and i do not know what i did.\

The error looks  a little like this

Line 27

Func Thieve()

Error: "While" statement has no matching "Wend" statement.

 

HotKeySet("{ESC}","myExit")

WinActivate("Alora")

Opt("CaretCoordmode", 2)
Opt("PixelCoordMode", 2)
Opt("MouseCoordMode", 2)

while(1)

   $thievingfull = False

   ;Steal From Stall
   while(Not($thievingfull))
      Thieve()
      $pix = PixelSearch(1849, 939, 1851, 941, 0xDEDADA, 10)
      if Not (@error) Then
         $thievingfull = True
      EndIf

      ;Find and sell
    while($thievingfull)
      Sell()
   WEnd

Func Thieve()
   $pix = PixelSearch(205, 85, 1625, 950 ,0xB3A48B, 1) ;0xB3A48B
      MouseClick("Left", $pix[1], $pix[1], 1, 3)
      sleep(Random(1750, 4000, 1))
      Mouseclick("Left", 515, 840, 1) ;515 840
      sleep(1200)
   if (@error) Then
      sleep (1000)
   EndIf
EndFunc

Func Sell()
   $pix = PixelSearch(33,70,1646,828,0xDCDCD7)
      MouseClick("Left", $pix[0], $pix[1],1,2)
      sleep(100)
      MouseClick("Left", $pix[0], $pix[1],1,3)
      sleep(4000)
      MouseClick("Left", 305, 942)
      sleep(Random(1000, 1250))
      MouseClick("Left", 254, 892)
      sleep(Random(1000, 1250))
      MouseClick("Right", 1767, 728, 1, 3)
      sleep(Random(1000, 1250))
      MouseClick("Left", 1734, 815, 1, 3)
      sleep(Random(1000, 1250))
      MouseClick("Left", 1174, 285, 1, 3)
      sleep(1000)
      $thievingfull = False
   if (@error) Then
      sleep(1000)
      EndIf
EndFunc

Func myExit()
   msgbox(0,"Exiting","Bot is quitting")
   Exit
EndFunc

 

Link to comment
Share on other sites

  • Developers

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

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