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