Sign in to follow this  
Followers 0
pezo89

Pixelsearch and loop help requested

4 posts in this topic

#1 ·  Posted (edited)

Hey guys, im pretty new to this Scripting part, but learning abit along the way as i go,

iv checked the Refrence guide regarding this problem, but i cannot seem to find it, might have missed it, and if that is the case, im sry,

Edit: i found out it was easier to just have the pixel search go after one another,

however a few new questions;

Q 1 - how do i set it to be activated in a loop upon pixelsearch or Pixelchecksum,

Q 2- is there a way to have it start with a popup that u can type in amount of runs u want? not infinite loop but a set amount

and then it runs the script with the amount u type in?

MouseClickDrag("Left",593, 430, 656, 654, 20) sleep(2000) send ("{Enter}") sleep ("5000") mouseclick ("Right", 324, 175, 1, 10) sleep (500) mouseclick ("Left", 371, 186, 1, 10) sleep (500) mouseclick ("Left", 185, 749,  2, 10) sleep (10000) mouseclick ("Left", 1216, 418, 2, 10)

if Pixel 1 is not found i want it to look for pixel 2, and then do this action

MouseClickDrag("Left", 656, 654, 593, 430, 20) sleep(2000)sleep ("5000") mouseclick ("Right", 324, 175, 1, 10) sleep (500) mouseclick ("Left", 371, 186, 1, 10) sleep (500) mouseclick ("Left", 185, 749,  2, 10) sleep (10000) mouseclick ("Left", 1216, 418, 2, 10)

and i also want a Pixelchecksum to start the pixelsearch above, and it goes to sleep mode aslong as the pixel is "Black"

what i have written so far can and will seem abit messy i know, but im quite lost :)

while 1
sleep ("5000")
$aPixel = PixelSearch(1003, 67, 1149, 118, 0xD09D7A)
If @error Then
sleep (100)
Else
MouseClickDrag("Left",593, 430, 656, 654, 20)
sleep(2000)
send ("{Enter}")
sleep ("5000")
mouseclick ("Right", 324, 175, 1, 10)
sleep (500)
mouseclick ("Left", 371, 186, 1, 10)
sleep (500)
mouseclick ("Left", 185, 749,  2, 10)
sleep (10000)
mouseclick ("Left", 1216, 418, 2, 10)
EndIf
;Caldari start;
sleep ("500")
$aPixel = PixelSearch(1003, 67, 1149, 118, 0x91B9ce)
If @error Then
sleep (100)
Else
MouseClickDrag("Left", 656, 654, 593, 430, 20)
sleep(2000)
send ("{Enter}")
sleep ("5000")
mouseclick ("Right", 324, 175, 1, 10)
sleep (500)
mouseclick ("Left", 371, 186, 1, 10)
sleep (500)
mouseclick ("Left", 185, 749,  2, 10)
sleep (10000)
mouseclick ("Left", 1216, 418, 2, 10)
EndIf

sleep (300000)

WEnd
Edited by pezo89

Share this post


Link to post
Share on other sites



Q1. Use If/Else, and functions (optional)

If condition1 Then
   myfunc1()  ;or codes
Else
   myfunc2()  ; or codes
EndIf

Q2

$input = InputBox("title","text")

For $i=1 To $input
    insert code here...
Next

or

$counter=0
While $counter<$input
    insert code here...
    $counter += 1
WEnd

Share this post


Link to post
Share on other sites

Q1. Use If/Else, and functions (optional)

If condition1 Then
   myfunc1()  ;or codes
Else
   myfunc2()  ; or codes
EndIf

Q2

$input = InputBox("title","text")

For $i=1 To $input
    insert code here...
Next

or

$counter=0
While $counter<$input
    insert code here...
    $counter += 1
WEnd

cant really say that was helpfull lol, giving me a code without any explanation?

Share this post


Link to post
Share on other sites

What I did is just using functions of Autoit. Try to press F1 and read about:

- If/Else

- For..

- While

- InputBox

These are the basic things to make a script. If you don't know, well....

Share this post


Link to post
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
Sign in to follow this  
Followers 0