Jump to content

im new pleas fix my code


Silk
 Share

Recommended Posts

i would like to script some code the idea is im red box im scanning box (x1,y1,x2,y2) for yellow pixel if i fined it then i click on it and do some other more jobs.

but if in box is not yellow dot i need to move 1 time to blue dot and start scanning box if there is not yellow dot next time i move to green dot  and so on this is my script  that not work.

Pleas what im doing wrong

HotKeySet("{f1}","myExit")
$i=0
$color = 0x1FFC90E
$x1 = 1159
$y1 = 170
$x2 = 1894
$y2 = 910



While(1)

   $Found = PixelSearch ($x1, $y1, $x2, $y2, $color, 5)
       if not @error Then
          ML($Found[0],$Found[1])
        
         Sleep(10000)
         ML(1872,842)
         Sleep(220000)
         ML(974,863)
         Sleep(5000)
         ML(991,834)
         Sleep(10000)
         $scan = True
      Else
         MR(1386,974)
         Sleep(2500)
         $Found = PixelSearch ($x1, $y1, $x2, $y2, $color, 5)
       if not @error Then
          ML($Found[0],$Found[1])
         Sleep(10000)
         ML(1872,842)
         Sleep(220000)
         ML(974,863)
         Sleep(5000)
         ML(991,834)
         Sleep(10000)
         EndIf

      EndIf


WEnd


Func MR($x,$y)
   MouseMove($x, $y,1)
   MouseDown("right")
   sleep(250)
   MouseUp("right")
EndFunc

Func ML($x,$y)
   MouseMove($x, $y,1)
   MouseDown("left")
   sleep(50)
   MouseUp("left")

   EndFunc


Func myExit()
   Exit
   EndFunc

Capture.JPG

Edited by Melba23
Added code tags
Link to comment
Share on other sites

  • Moderators

@Silk no it can't "stay secret". As I explained in your PM, this is against the forum rules, which I am guessing you know already based on your comment.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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