Jump to content

Recommended Posts

hi there i am trying to get a pixelcolor from 40 different pixels i have mapped and all, ok here is whats happening.

I tested the script on the desktop returns the right blue values for alle 40 places,

now i make a winactivate on the window i want the colors from, it now changes to the window and gets pixelcolors and dumps then in the ini, problem is that it still gets the colors from the desktop even though the other window is active, the window its surposed to get it from runs with eigther direct3d eller directdraw if this helps.

some one help me i am desperate o:)

p.s. i looked in the faq this time :lmao:

Link to post
Share on other sites

$space1 = PixelGetColor ( 801 , 49 )
$space2 = PixelGetColor ( 844 , 49 )
$space3 = PixelGetColor ( 887 , 49 )
$space4 = PixelGetColor ( 930 , 49 )
$space5 = PixelGetColor ( 973 , 49 )
$space6 = PixelGetColor ( 801 , 92 )
$space7 = PixelGetColor ( 844 , 92 )
$space8 = PixelGetColor ( 887 , 92 )
$space9 = PixelGetColor ( 930 , 92 )
$space10 = PixelGetColor ( 973 , 92 )
$space11 = PixelGetColor ( 801 , 135 )
$space12 = PixelGetColor ( 844 , 135 )
$space13 = PixelGetColor ( 887 , 135 )
$space14 = PixelGetColor ( 930 , 135 )
$space15 = PixelGetColor ( 973 , 135 )
$space16 = PixelGetColor ( 801 , 178 )
$space17 = PixelGetColor ( 844 , 178 )
$space18 = PixelGetColor ( 887 , 178 )
$space19 = PixelGetColor ( 930 , 178 )
$space20 = PixelGetColor ( 973 , 178 )
$space21 = PixelGetColor ( 801 , 221 )
$space22 = PixelGetColor ( 844 , 221 )
$space23 = PixelGetColor ( 887 , 221 )
$space24 = PixelGetColor ( 930 , 221 )
$space25 = PixelGetColor ( 973 , 221 )
$space26 = PixelGetColor ( 801 , 264 )
$space27 = PixelGetColor ( 844 , 264 )
$space28 = PixelGetColor ( 887 , 264 )
$space29 = PixelGetColor ( 930 , 264 )
$space30 = PixelGetColor ( 973 , 264 )
$space31 = PixelGetColor ( 801 , 307 )
$space32 = PixelGetColor ( 844 , 307 )
$space33 = PixelGetColor ( 887 , 307 )
$space34 = PixelGetColor ( 930 , 307 )
$space35 = PixelGetColor ( 973 , 307 )
$space36 = PixelGetColor ( 801 , 350 )
$space37 = PixelGetColor ( 844 , 350 )
$space38 = PixelGetColor ( 887 , 350 )
$space39 = PixelGetColor ( 930 , 350 )
$space40 = PixelGetColor ( 973 , 350 )
WinActivate("Mines", "")
sleep ("10000")
IniWrite ( "color.ini", "color", "color1", $space1 )
IniWrite ( "color.ini", "color", "color2", $space2 )
IniWrite ( "color.ini", "color", "color3", $space3 )
IniWrite ( "color.ini", "color", "color4", $space4 )
IniWrite ( "color.ini", "color", "color5", $space5 )
IniWrite ( "color.ini", "color", "color6", $space6 )
IniWrite ( "color.ini", "color", "color7", $space7 )
IniWrite ( "color.ini", "color", "color8", $space8 )
IniWrite ( "color.ini", "color", "color9", $space9 )
IniWrite ( "color.ini", "color", "color10", $space10 )
IniWrite ( "color.ini", "color", "color11", $space11 )
IniWrite ( "color.ini", "color", "color12", $space12 )
IniWrite ( "color.ini", "color", "color13", $space13 )
IniWrite ( "color.ini", "color", "color14", $space14 )
IniWrite ( "color.ini", "color", "color15", $space15 )
IniWrite ( "color.ini", "color", "color16", $space16 )
IniWrite ( "color.ini", "color", "color17", $space17 )
IniWrite ( "color.ini", "color", "color18", $space18 )
IniWrite ( "color.ini", "color", "color19", $space19 )
IniWrite ( "color.ini", "color", "color20", $space20 )
IniWrite ( "color.ini", "color", "color21", $space21 )
IniWrite ( "color.ini", "color", "color22", $space22 )
IniWrite ( "color.ini", "color", "color23", $space23 )
IniWrite ( "color.ini", "color", "color24", $space24 )
IniWrite ( "color.ini", "color", "color25", $space25 )
IniWrite ( "color.ini", "color", "color26", $space26 )
IniWrite ( "color.ini", "color", "color27", $space27 )
IniWrite ( "color.ini", "color", "color28", $space28 )
IniWrite ( "color.ini", "color", "color29", $space29 )
IniWrite ( "color.ini", "color", "color30", $space30 )
IniWrite ( "color.ini", "color", "color31", $space31 )
IniWrite ( "color.ini", "color", "color32", $space32 )
IniWrite ( "color.ini", "color", "color33", $space33 )
IniWrite ( "color.ini", "color", "color34", $space34 )
IniWrite ( "color.ini", "color", "color35", $space35 )
IniWrite ( "color.ini", "color", "color36", $space36 )
IniWrite ( "color.ini", "color", "color37", $space37 )
IniWrite ( "color.ini", "color", "color38", $space38 )
IniWrite ( "color.ini", "color", "color39", $space39 )
IniWrite ( "color.ini", "color", "color40", $space40 )

yes is called mines use the window spy :lmao:

Link to post
Share on other sites

if this is the entire script i already see your problem

you are gathering the info then activating the window then it writes to the ini file. how are you gonna get the info from the window when you already got the info from the desktop? you need to rescan the window. you ran it before it was activated.

Link to post
Share on other sites

if this is the entire script i already see your problem

you are gathering the info then activating the window then it writes to the ini file. how are you gonna get the info from the window when you already got the info from the desktop? you need to rescan the window. you ran it before it was activated.

<{POST_SNAPBACK}>

can you post a quick sample for a beginner, if this is not the you meen :lmao:

i just though that it got it when i called the varible

so insted is should no use varibles but make the call like this

IniWrite ( "color.ini", "color", "color1", PixelGetColor ( 801 , 49 ))

Link to post
Share on other sites

sorry kinda in a hurry you almost have it just try it like this.

$space1 = PixelGetColor ( 801 , 49 )
$space2 = PixelGetColor ( 844 , 49 )
$space3 = PixelGetColor ( 887 , 49 )
$space4 = PixelGetColor ( 930 , 49 )
$space5 = PixelGetColor ( 973 , 49 )
$space6 = PixelGetColor ( 801 , 92 )
$space7 = PixelGetColor ( 844 , 92 )
$space8 = PixelGetColor ( 887 , 92 )
$space9 = PixelGetColor ( 930 , 92 )
$space10 = PixelGetColor ( 973 , 92 )
$space11 = PixelGetColor ( 801 , 135 )
$space12 = PixelGetColor ( 844 , 135 )
$space13 = PixelGetColor ( 887 , 135 )
$space14 = PixelGetColor ( 930 , 135 )
$space15 = PixelGetColor ( 973 , 135 )
$space16 = PixelGetColor ( 801 , 178 )
$space17 = PixelGetColor ( 844 , 178 )
$space18 = PixelGetColor ( 887 , 178 )
$space19 = PixelGetColor ( 930 , 178 )
$space20 = PixelGetColor ( 973 , 178 )
$space21 = PixelGetColor ( 801 , 221 )
$space22 = PixelGetColor ( 844 , 221 )
$space23 = PixelGetColor ( 887 , 221 )
$space24 = PixelGetColor ( 930 , 221 )
$space25 = PixelGetColor ( 973 , 221 )
$space26 = PixelGetColor ( 801 , 264 )
$space27 = PixelGetColor ( 844 , 264 )
$space28 = PixelGetColor ( 887 , 264 )
$space29 = PixelGetColor ( 930 , 264 )
$space30 = PixelGetColor ( 973 , 264 )
$space31 = PixelGetColor ( 801 , 307 )
$space32 = PixelGetColor ( 844 , 307 )
$space33 = PixelGetColor ( 887 , 307 )
$space34 = PixelGetColor ( 930 , 307 )
$space35 = PixelGetColor ( 973 , 307 )
$space36 = PixelGetColor ( 801 , 350 )
$space37 = PixelGetColor ( 844 , 350 )
$space38 = PixelGetColor ( 887 , 350 )
$space39 = PixelGetColor ( 930 , 350 )
$space40 = PixelGetColor ( 973 , 350 )
IniWrite ( "color.ini", "color", "color1", $space1 )
IniWrite ( "color.ini", "color", "color2", $space2 )
IniWrite ( "color.ini", "color", "color3", $space3 )
IniWrite ( "color.ini", "color", "color4", $space4 )
IniWrite ( "color.ini", "color", "color5", $space5 )
IniWrite ( "color.ini", "color", "color6", $space6 )
IniWrite ( "color.ini", "color", "color7", $space7 )
IniWrite ( "color.ini", "color", "color8", $space8 )
IniWrite ( "color.ini", "color", "color9", $space9 )
IniWrite ( "color.ini", "color", "color10", $space10 )
IniWrite ( "color.ini", "color", "color11", $space11 )
IniWrite ( "color.ini", "color", "color12", $space12 )
IniWrite ( "color.ini", "color", "color13", $space13 )
IniWrite ( "color.ini", "color", "color14", $space14 )
IniWrite ( "color.ini", "color", "color15", $space15 )
IniWrite ( "color.ini", "color", "color16", $space16 )
IniWrite ( "color.ini", "color", "color17", $space17 )
IniWrite ( "color.ini", "color", "color18", $space18 )
IniWrite ( "color.ini", "color", "color19", $space19 )
IniWrite ( "color.ini", "color", "color20", $space20 )
IniWrite ( "color.ini", "color", "color21", $space21 )
IniWrite ( "color.ini", "color", "color22", $space22 )
IniWrite ( "color.ini", "color", "color23", $space23 )
IniWrite ( "color.ini", "color", "color24", $space24 )
IniWrite ( "color.ini", "color", "color25", $space25 )
IniWrite ( "color.ini", "color", "color26", $space26 )
IniWrite ( "color.ini", "color", "color27", $space27 )
IniWrite ( "color.ini", "color", "color28", $space28 )
IniWrite ( "color.ini", "color", "color29", $space29 )
IniWrite ( "color.ini", "color", "color30", $space30 )
IniWrite ( "color.ini", "color", "color31", $space31 )
IniWrite ( "color.ini", "color", "color32", $space32 )
IniWrite ( "color.ini", "color", "color33", $space33 )
IniWrite ( "color.ini", "color", "color34", $space34 )
IniWrite ( "color.ini", "color", "color35", $space35 )
IniWrite ( "color.ini", "color", "color36", $space36 )
IniWrite ( "color.ini", "color", "color37", $space37 )
IniWrite ( "color.ini", "color", "color38", $space38 )
IniWrite ( "color.ini", "color", "color39", $space39 )
IniWrite ( "color.ini", "color", "color40", $space40 )
WinActivate("Mines", "")
sleep ("10000")
$mine1 = PixelGetColor ( 801 , 49 )
$mine2 = PixelGetColor ( 844 , 49 )
$mine3 = PixelGetColor ( 887 , 49 )
$mine4 = PixelGetColor ( 930 , 49 )
$mine5 = PixelGetColor ( 973 , 49 )
$mine6 = PixelGetColor ( 801 , 92 )
$mine7 = PixelGetColor ( 844 , 92 )
$mine8 = PixelGetColor ( 887 , 92 )
$mine9 = PixelGetColor ( 930 , 92 )
$mine10 = PixelGetColor ( 973 , 92 )
$mine11 = PixelGetColor ( 801 , 135 )
$mine12 = PixelGetColor ( 844 , 135 )
$mine13 = PixelGetColor ( 887 , 135 )
$mine14 = PixelGetColor ( 930 , 135 )
$mine15 = PixelGetColor ( 973 , 135 )
$mine16 = PixelGetColor ( 801 , 178 )
$mine17 = PixelGetColor ( 844 , 178 )
$mine18 = PixelGetColor ( 887 , 178 )
$mine19 = PixelGetColor ( 930 , 178 )
$mine20 = PixelGetColor ( 973 , 178 )
$mine21 = PixelGetColor ( 801 , 221 )
$mine22 = PixelGetColor ( 844 , 221 )
$mine23 = PixelGetColor ( 887 , 221 )
$mine24 = PixelGetColor ( 930 , 221 )
$mine25 = PixelGetColor ( 973 , 221 )
$mine26 = PixelGetColor ( 801 , 264 )
$mine27 = PixelGetColor ( 844 , 264 )
$mine28 = PixelGetColor ( 887 , 264 )
$mine29 = PixelGetColor ( 930 , 264 )
$mine30 = PixelGetColor ( 973 , 264 )
$mine31 = PixelGetColor ( 801 , 307 )
$mine32 = PixelGetColor ( 844 , 307 )
$mine33 = PixelGetColor ( 887 , 307 )
$mine34 = PixelGetColor ( 930 , 307 )
$mine35 = PixelGetColor ( 973 , 307 )
$mine36 = PixelGetColor ( 801 , 350 )
$mine37 = PixelGetColor ( 844 , 350 )
$mine38 = PixelGetColor ( 887 , 350 )
$mine39 = PixelGetColor ( 930 , 350 )
$mine40 = PixelGetColor ( 973 , 350 )
IniWrite ( "minecolor.ini", "color", "color1", $mine1 )
IniWrite ( "minecolor.ini", "color", "color2", $mine2 )
IniWrite ( "minecolor.ini", "color", "color3", $mine3 )
IniWrite ( "minecolor.ini", "color", "color4", $mine4 )
IniWrite ( "minecolor.ini", "color", "color5", $mine5 )
IniWrite ( "minecolor.ini", "color", "color6", $mine6 )
IniWrite ( "minecolor.ini", "color", "color7", $mine7 )
IniWrite ( "minecolor.ini", "color", "color8", $mine8 )
IniWrite ( "minecolor.ini", "color", "color9", $mine9 )
IniWrite ( "minecolor.ini", "color", "color10", $mine10 )
IniWrite ( "minecolor.ini", "color", "color11", $mine11 )
IniWrite ( "minecolor.ini", "color", "color12", $mine12 )
IniWrite ( "minecolor.ini", "color", "color13", $mine13 )
IniWrite ( "minecolor.ini", "color", "color14", $mine14 )
IniWrite ( "minecolor.ini", "color", "color15", $mine15 )
IniWrite ( "minecolor.ini", "color", "color16", $mine16 )
IniWrite ( "minecolor.ini", "color", "color17", $mine17 )
IniWrite ( "minecolor.ini", "color", "color18", $mine18 )
IniWrite ( "minecolor.ini", "color", "color19", $mine19 )
IniWrite ( "minecolor.ini", "color", "color20", $mine20 )
IniWrite ( "minecolor.ini", "color", "color21", $mine21 )
IniWrite ( "minecolor.ini", "color", "color22", $mine22 )
IniWrite ( "minecolor.ini", "color", "color23", $mine23 )
IniWrite ( "minecolor.ini", "color", "color24", $mine24 )
IniWrite ( "minecolor.ini", "color", "color25", $mine25 )
IniWrite ( "minecolor.ini", "color", "color26", $mine26 )
IniWrite ( "minecolor.ini", "color", "color27", $mine27 )
IniWrite ( "minecolor.ini", "color", "color28", $mine28 )
IniWrite ( "minecolor.ini", "color", "color29", $mine29 )
IniWrite ( "minecolor.ini", "color", "color30", $mine30 )
IniWrite ( "minecolor.ini", "color", "color31", $mine31 )
IniWrite ( "minecolor.ini", "color", "color32", $mine32 )
IniWrite ( "minecolor.ini", "color", "color33", $mine33 )
IniWrite ( "minecolor.ini", "color", "color34", $mine34 )
IniWrite ( "minecolor.ini", "color", "color35", $mine35 )
IniWrite ( "minecolor.ini", "color", "color36", $mine36 )
IniWrite ( "minecolor.ini", "color", "color37", $mine37 )
IniWrite ( "minecolor.ini", "color", "color38", $mine38 )
IniWrite ( "minecolor.ini", "color", "color39", $mine39 )
IniWrite ( "minecolor.ini", "color", "color40", $mine40 )

Link to post
Share on other sites

You can replace about 80 lines of code with a simple loop and array.

Dim $q = 0
Dim $mine[41]
Dim $space[41]
For $y = 49 to 350 step 43
   For $x = 801 to 930 step 43
      $q = $q + 1
      $space[$q] = PixelGetColor ( $x , $y )
   Next
Next

For $x = 1 to 40 step 1
   IniWrite ( "color.ini", "color", "color" & $x , $space[$x] )
Next

WinActivate("Mines", "")
sleep ("10000")

$q = 0
For $y = 49 to 350 step 43
   For $x = 801 to 930 step 43
      $q = $q + 1
      $mine[$q] = PixelGetColor ( $x , $y )
   Next
Next

For $x = 1 to 40 step 1
   IniWrite ( "minecolor.ini", "color", "color" & $x, $mine[$x] )
Next

That's much cleaner....and easier on the eyes.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...