Sign in to follow this  
Followers 0
ionjolt

arrayed For/Next with PixelGetColor

1 post in this topic

Is there a way for this to be reduced in a For/Next loop?

  $ok1 = PixelGetColor($pos1[0], $pos1[1])
  $ok2 = PixelGetColor($pos2[0], $pos2[1])
  $ok3 = PixelGetColor($pos3[0], $pos3[1])
  $ok4 = PixelGetColor($pos4[0], $pos4[1])
  $ok5 = PixelGetColor($pos5[0], $pos5[1])

something like my $ok variable turn into an array containing an array (is that possible, btw?) and my $pos variable-array (coordinate) also be something like the same, so that this code can be like only 3 lines;

$r = 5

For $q = 1 to $r Step 1

       $ok{$q} = PixelGetColor($pos{$q}[0], $pos{$q}[1])
Next

 

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