Help - Search - Members - Calendar
Full Version: Load Rgb question.. yes i already used search
AC Tools Everything Macro > AC Tool > AC Tool Discussion
kyle Thomas
OK so let me give you the lowdown of what i am wanting to do. I am trying to use a screen scraping method to look for a rock to mine in

runescape classic. I have searched the help in ac tool and looked at various of ahk's scripts, but i am still having trouble getting it to work

correctly. What i would like it to do is to scrape the screen for a certain color and then i would like it to move the mouse to the position of

the color when it finds it and click. the problem is the pixels move every so often so i have to use a screen scrape method. Here is my code

so far



CODE
SetActiveWindow

// move character straight north... sleep bag in first spot
// stand on the 3 iron ore rocks


constants
x = 274 // just a statring point
y = 165 // just a starting point
end

loop 10 //
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5 // this should move every 5 pixels , in the x and y direction right ?
end







procedure login
delay 1 sec
getblue 425, 063 = 162
delay 5 sec
mousepos 337,303
leftclick
delay 1 sec
mousepos 363, 277
leftclick
delay 1 sec
mousepos 491, 43
delay 1 sec
leftclick
delay 4 sec
mousepos 491, 43
leftclick
else
end
end

procedure checksleep

getgreen 290, 338 = 255
call sleep
end

end
procedure mine
loop 10 //loop 10 times scanning each 10 pixels going from left to right.
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5
end
if {rgbblue} = 13 // here is the problem i need it to move where it found the rgb blue value of 13 at and click ?

leftclick

end
end




procedure sleep
delay 1 sec
mousepos 491, 43
delay 1 sec
mousepos 482, 78
delay 1 sec
mousepos 293, 81
leftclick
delay 500
delay 5 sec
end


processmessages
while 1 = 1
call login
call checksleep
call mine
end
DaMOB
QUOTE(kyle Thomas @ Mar 25 2009, 05:25 AM) *
OK so let me give you the lowdown of what i am wanting to do. I am trying to use a screen scraping method to look for a rock to mine in

runescape classic. I have searched the help in ac tool and looked at various of ahk's scripts, but i am still having trouble getting it to work

correctly. What i would like it to do is to scrape the screen for a certain color and then i would like it to move the mouse to the position of

the color when it finds it and click. the problem is the pixels move every so often so i have to use a screen scrape method. Here is my code

so far



CODE
SetActiveWindow

// move character straight north... sleep bag in first spot
// stand on the 3 iron ore rocks


constants
x = 274 // just a statring point
y = 165 // just a starting point
end

loop 10 //
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5 // this should move every 5 pixels , in the x and y direction right ?
end







procedure login
delay 1 sec
getblue 425, 063 = 162
delay 5 sec
mousepos 337,303
leftclick
delay 1 sec
mousepos 363, 277
leftclick
delay 1 sec
mousepos 491, 43
delay 1 sec
leftclick
delay 4 sec
mousepos 491, 43
leftclick
else
end
end

procedure checksleep

getgreen 290, 338 = 255
call sleep
end

end
procedure mine
loop 10 //loop 10 times scanning each 10 pixels going from left to right.
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5
end
if {rgbblue} = 13 // here is the problem i need it to move where it found the rgb blue value of 13 at and click ?

leftclick

end
end




procedure sleep
delay 1 sec
mousepos 491, 43
delay 1 sec
mousepos 482, 78
delay 1 sec
mousepos 293, 81
leftclick
delay 500
delay 5 sec
end


processmessages
while 1 = 1
call login
call checksleep
call mine
end
grrrrrrrr. Where, precisely, are you haveing the trouble at?

http://forums.cameroncole.com/index.php?sh...&hl=LoadRGB I found that using the search criteria of LoadRGB and I suggest you read it and comprehend it because your getcolor (i.e. getblue 425, 063 = 162) is gibberish.
kyle Thomas
QUOTE(DaMOB @ Mar 25 2009, 07:04 AM) *
QUOTE(kyle Thomas @ Mar 25 2009, 05:25 AM) *
OK so let me give you the lowdown of what i am wanting to do. I am trying to use a screen scraping method to look for a rock to mine in

runescape classic. I have searched the help in ac tool and looked at various of ahk's scripts, but i am still having trouble getting it to work

correctly. What i would like it to do is to scrape the screen for a certain color and then i would like it to move the mouse to the position of

the color when it finds it and click. the problem is the pixels move every so often so i have to use a screen scrape method. Here is my code

so far



CODE
SetActiveWindow

// move character straight north... sleep bag in first spot
// stand on the 3 iron ore rocks


constants
x = 274 // just a statring point
y = 165 // just a starting point
end

loop 10 //
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5 // this should move every 5 pixels , in the x and y direction right ?
end







procedure login
delay 1 sec
getblue 425, 063 = 162
delay 5 sec
mousepos 337,303
leftclick
delay 1 sec
mousepos 363, 277
leftclick
delay 1 sec
mousepos 491, 43
delay 1 sec
leftclick
delay 4 sec
mousepos 491, 43
leftclick
else
end
end

procedure checksleep

getgreen 290, 338 = 255
call sleep
end

end
procedure mine
loop 10 //loop 10 times scanning each 10 pixels going from left to right.
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5
end
if {rgbblue} = 13 // here is the problem i need it to move where it found the rgb blue value of 13 at and click ?

leftclick

end
end




procedure sleep
delay 1 sec
mousepos 491, 43
delay 1 sec
mousepos 482, 78
delay 1 sec
mousepos 293, 81
leftclick
delay 500
delay 5 sec
end


processmessages
while 1 = 1
call login
call checksleep
call mine
end
grrrrrrrr. Where, precisely, are you haveing the trouble at?

http://forums.cameroncole.com/index.php?sh...&hl=LoadRGB I found that using the search criteria of LoadRGB and I suggest you read it and comprehend it because your getcolor (i.e. getblue 425, 063 = 162) is gibberish.



first of all i think your not comprehending... becasue i need help on the mine procedure.. the login procedure already works thank you very much. it checks the certain color on the screen for the blue value and if it does, it does the commands following the command. that already works. What i am looking to figure out is how to get it to move the mouse to the point of finding the color im searching for. thanks ( under the procedure MINE )

basically like this..

start in the center of the game screen. scan outwards looking for a certain value. find the value and click there. thats all i need to understand.. i have searched, and thats how i came across the loadrgb $x, $y ... and the compute x = $x + 5 ... but any help would be appreciated. thanks
Ahk
Someone posted a modification of ScreenScrape to actually scan using LoadRGB and scan in a circle, from the inside out...I think.

The one I created computes around a center coordinate of where you want to start scanning, and scans as many places as you specify.

Example (from macro)
Call ScreenScrape Icon, 15, 0, 0 //Scrape 0,0 to 14, 14 (0,0 counts as one set of pixels...)

Scans for object Icon, in a 15 pixel range from 0,0...see comment above.

If found ScreenScrape_RetVal is set to 1, if not, it equals 0.

So after a ScreenScrape, you can do this.

If $ScreenScrape_RetVal = 1
MousePos $ScreenScrape_X, $ScreenScrape_Y
Delay 50
LeftClick
End


It's really up to you how you want to handle scanning specific areas of the screen.
DaMOB
QUOTE(kyle Thomas @ Mar 25 2009, 05:15 PM) *
QUOTE(DaMOB @ Mar 25 2009, 07:04 AM) *
QUOTE(kyle Thomas @ Mar 25 2009, 05:25 AM) *
OK so let me give you the lowdown of what i am wanting to do. I am trying to use a screen scraping method to look for a rock to mine in

runescape classic. I have searched the help in ac tool and looked at various of ahk's scripts, but i am still having trouble getting it to work

correctly. What i would like it to do is to scrape the screen for a certain color and then i would like it to move the mouse to the position of

the color when it finds it and click. the problem is the pixels move every so often so i have to use a screen scrape method. Here is my code

so far



CODE
SetActiveWindow

// move character straight north... sleep bag in first spot
// stand on the 3 iron ore rocks


constants
x = 274 // just a statring point
y = 165 // just a starting point
end

loop 10 //
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5 // this should move every 5 pixels , in the x and y direction right ?
end







procedure login
delay 1 sec
getblue 425, 063 = 162
delay 5 sec
mousepos 337,303
leftclick
delay 1 sec
mousepos 363, 277
leftclick
delay 1 sec
mousepos 491, 43
delay 1 sec
leftclick
delay 4 sec
mousepos 491, 43
leftclick
else
end
end

procedure checksleep

getgreen 290, 338 = 255
call sleep
end

end
procedure mine
loop 10 //loop 10 times scanning each 10 pixels going from left to right.
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5
end
if {rgbblue} = 13 // here is the problem i need it to move where it found the rgb blue value of 13 at and click ?

leftclick

end
end




procedure sleep
delay 1 sec
mousepos 491, 43
delay 1 sec
mousepos 482, 78
delay 1 sec
mousepos 293, 81
leftclick
delay 500
delay 5 sec
end


processmessages
while 1 = 1
call login
call checksleep
call mine
end
grrrrrrrr. Where, precisely, are you haveing the trouble at?

http://forums.cameroncole.com/index.php?sh...&hl=LoadRGB I found that using the search criteria of LoadRGB and I suggest you read it and comprehend it because your getcolor (i.e. getblue 425, 063 = 162) is gibberish.



first of all i think your not comprehending... becasue i need help on the mine procedure.. the login procedure already works thank you very much. it checks the certain color on the screen for the blue value and if it does, it does the commands following the command. that already works. What i am looking to figure out is how to get it to move the mouse to the point of finding the color im searching for. thanks ( under the procedure MINE )

basically like this..

start in the center of the game screen. scan outwards looking for a certain value. find the value and click there. thats all i need to understand.. i have searched, and thats how i came across the loadrgb $x, $y ... and the compute x = $x + 5 ... but any help would be appreciated. thanks
Whatever but the fact remains that you posted a macro that you are working on and I am telling you your getgreen 290, 338 = 255 (all of your getcolor stuff) is utter gibberish so expect that to fail as it is written. I did not spot a getgreen, blue, red procedure though.

As far as your mine part look to Ahk.

Now, when you publish a macro you need to be more specific in what it is you are looking for help in and be prepared to have people tell you where you fucked up at in any of your code. If we didn't tell you, or any one, pre hand they just wander back in here crying asking why something is not working. Saves time and effort to tell you up front when something is going to be flaky in the least.
kyle Thomas
QUOTE(DaMOB @ Mar 25 2009, 08:21 PM) *
QUOTE(kyle Thomas @ Mar 25 2009, 05:15 PM) *
QUOTE(DaMOB @ Mar 25 2009, 07:04 AM) *
QUOTE(kyle Thomas @ Mar 25 2009, 05:25 AM) *
OK so let me give you the lowdown of what i am wanting to do. I am trying to use a screen scraping method to look for a rock to mine in

runescape classic. I have searched the help in ac tool and looked at various of ahk's scripts, but i am still having trouble getting it to work

correctly. What i would like it to do is to scrape the screen for a certain color and then i would like it to move the mouse to the position of

the color when it finds it and click. the problem is the pixels move every so often so i have to use a screen scrape method. Here is my code

so far



CODE
SetActiveWindow

// move character straight north... sleep bag in first spot
// stand on the 3 iron ore rocks


constants
x = 274 // just a statring point
y = 165 // just a starting point
end

loop 10 //
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5 // this should move every 5 pixels , in the x and y direction right ?
end







procedure login
delay 1 sec
getblue 425, 063 = 162
delay 5 sec
mousepos 337,303
leftclick
delay 1 sec
mousepos 363, 277
leftclick
delay 1 sec
mousepos 491, 43
delay 1 sec
leftclick
delay 4 sec
mousepos 491, 43
leftclick
else
end
end

procedure checksleep

getgreen 290, 338 = 255
call sleep
end

end
procedure mine
loop 10 //loop 10 times scanning each 10 pixels going from left to right.
loadrgb $x,$y //load rgb value of $x,$y location.

compute x = $x + 5
end
if {rgbblue} = 13 // here is the problem i need it to move where it found the rgb blue value of 13 at and click ?

leftclick

end
end




procedure sleep
delay 1 sec
mousepos 491, 43
delay 1 sec
mousepos 482, 78
delay 1 sec
mousepos 293, 81
leftclick
delay 500
delay 5 sec
end


processmessages
while 1 = 1
call login
call checksleep
call mine
end
grrrrrrrr. Where, precisely, are you haveing the trouble at?

http://forums.cameroncole.com/index.php?sh...&hl=LoadRGB I found that using the search criteria of LoadRGB and I suggest you read it and comprehend it because your getcolor (i.e. getblue 425, 063 = 162) is gibberish.



first of all i think your not comprehending... becasue i need help on the mine procedure.. the login procedure already works thank you very much. it checks the certain color on the screen for the blue value and if it does, it does the commands following the command. that already works. What i am looking to figure out is how to get it to move the mouse to the point of finding the color im searching for. thanks ( under the procedure MINE )

basically like this..

start in the center of the game screen. scan outwards looking for a certain value. find the value and click there. thats all i need to understand.. i have searched, and thats how i came across the loadrgb $x, $y ... and the compute x = $x + 5 ... but any help would be appreciated. thanks
Whatever but the fact remains that you posted a macro that you are working on and I am telling you your getgreen 290, 338 = 255 (all of your getcolor stuff) is utter gibberish so expect that to fail as it is written. I did not spot a getgreen, blue, red procedure though.

As far as your mine part look to Ahk.

Now, when you publish a macro you need to be more specific in what it is you are looking for help in and be prepared to have people tell you where you fucked up at in any of your code. If we didn't tell you, or any one, pre hand they just wander back in here crying asking why something is not working. Saves time and effort to tell you up front when something is going to be flaky in the least.


understandable mob. but still what your not understanding is that that portion of the code already works. it has been tested and works. The commands in ac tool 5.4.0 are there i found them through the help portion. What i did was write a bit of code to find the RGB values at specific pixel location and send them to a notepad and tell me the value of each. Then what i do is have it check to see if the value there is equal to the one in code, if it is it performs the relogging in procedure. But thank you for the help mob. i have checked the help and they work , but thank you for your concern, but its not gibberish. anyways ahk thank you very much that was exactly what i was looking for , and i appreciate the help very much. BTW i always search around profusely, and post very little as i can, usually figure out what i am looking for. I use posting as a last resort. Thank you all for the help

here mob , this is what im talking about

[attachment=1128:getcolors.bmp]
DaMOB
QUOTE(kyle Thomas @ Mar 25 2009, 08:01 PM) *
understandable mob. but still what your not understanding is that that portion of the code already works. it has been tested and works. The commands in ac tool 5.4.0 are there i found them through the help portion. What i did was write a bit of code to find the RGB values at specific pixel location and send them to a notepad and tell me the value of each. Then what i do is have it check to see if the value there is equal to the one in code, if it is it performs the relogging in procedure. But thank you for the help mob. i have checked the help and they work , but thank you for your concern, but its not gibberish. anyways ahk thank you very much that was exactly what i was looking for , and i appreciate the help very much. BTW i always search around profusely, and post very little as i can, usually figure out what i am looking for. I use posting as a last resort. Thank you all for the help

here mob , this is what im talking about

[attachment=1128:getcolors.bmp]

No, no I meant that it would work but it will be flaky at best because I never liked the getcolor commands as opposed to the LoadRGB. I consider it pixel gibberish because you are only checking one color but what happens if the value is correct but the other two color bits are not? To the getcolor it is correct but the on screen color was for something else because the color was not the samecolor just that color bit was. So, flaky at best. If the getcolor works for you then excellent we now have that out of the way but if it stops working or turns weird you will need to move over to the LoadRGB command so the routine is more refined.

Now have you tried what Ahk mentioned for screen scraping? Did it work or no?

btw: I am not being an ass I was really trying to help you and still am. smile.gif
kyle Thomas
QUOTE(DaMOB @ Mar 26 2009, 06:49 AM) *
QUOTE(kyle Thomas @ Mar 25 2009, 08:01 PM) *
understandable mob. but still what your not understanding is that that portion of the code already works. it has been tested and works. The commands in ac tool 5.4.0 are there i found them through the help portion. What i did was write a bit of code to find the RGB values at specific pixel location and send them to a notepad and tell me the value of each. Then what i do is have it check to see if the value there is equal to the one in code, if it is it performs the relogging in procedure. But thank you for the help mob. i have checked the help and they work , but thank you for your concern, but its not gibberish. anyways ahk thank you very much that was exactly what i was looking for , and i appreciate the help very much. BTW i always search around profusely, and post very little as i can, usually figure out what i am looking for. I use posting as a last resort. Thank you all for the help

here mob , this is what im talking about

[attachment=1128:getcolors.bmp]

No, no I meant that it would work but it will be flaky at best because I never liked the getcolor commands as opposed to the LoadRGB. I consider it pixel gibberish because you are only checking one color but what happens if the value is correct but the other two color bits are not? To the getcolor it is correct but the on screen color was for something else because the color was not the samecolor just that color bit was. So, flaky at best. If the getcolor works for you then excellent we now have that out of the way but if it stops working or turns weird you will need to move over to the LoadRGB command so the routine is more refined.

Now have you tried what Ahk mentioned for screen scraping? Did it work or no?

btw: I am not being an ass I was really trying to help you and still am. smile.gif


Ok i thanks man, i have seen some of your posts and thought you were being an ass and thank you for the help, i guess i just misunderstood the whole message your were sending, but no i havent tried the method yet, as i have been working a lot , and drinking some too biggrin.gif but i will be attempting it very soon. thanks for all the help guys
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.