CODE
constants
rell_cd = 0
pum_cd = 0
HP_x = 0
HP_y = 410
search_hp_x = 0
search_hp_y = 410
f_r=0
marja_eroare = 0
calc = 0
end
procedure set_new_HP //every 0.4 sec//will modify HP after a certain keyboard was pressed
loop 3
setconst search_hp_x = 455
while $search_hp_x > 238
compute search_hp_x = $search_hp_x - 1
loadRGB $search_hp_x, $search_hp_y
if {RGBRed} = 0
if {RGBGreen} >= 172 and {RGBGreen} <= 181
if {RGBBlue} >= 246 and {RGBBlue} <= 254
if $search_hp_x > $HP_x
setconst HP_x = $search_hp_x
setconst search_hp_x = 230
else
loadRGB $HP_x, $HP_y
if {RGBRed} <> 0
setconst HP_x = $search_hp_x
setconst search_hp_x = 230
end
end
end
end
end
end // from while
end //from loop
if $HP_x <> 0
mousepos $HP_x, $HP_y
end
end // from procedure
while 1=1
ProcessMessages
call set_new_HP
end
rell_cd = 0
pum_cd = 0
HP_x = 0
HP_y = 410
search_hp_x = 0
search_hp_y = 410
f_r=0
marja_eroare = 0
calc = 0
end
procedure set_new_HP //every 0.4 sec//will modify HP after a certain keyboard was pressed
loop 3
setconst search_hp_x = 455
while $search_hp_x > 238
compute search_hp_x = $search_hp_x - 1
loadRGB $search_hp_x, $search_hp_y
if {RGBRed} = 0
if {RGBGreen} >= 172 and {RGBGreen} <= 181
if {RGBBlue} >= 246 and {RGBBlue} <= 254
if $search_hp_x > $HP_x
setconst HP_x = $search_hp_x
setconst search_hp_x = 230
else
loadRGB $HP_x, $HP_y
if {RGBRed} <> 0
setconst HP_x = $search_hp_x
setconst search_hp_x = 230
end
end
end
end
end
end // from while
end //from loop
if $HP_x <> 0
mousepos $HP_x, $HP_y
end
end // from procedure
while 1=1
ProcessMessages
call set_new_HP
end
When the Hp is recovering (in visible screen-wise increments) the cursor moves to the correct place but when it's falling (at bigger increments) it fails to keep up properly(it ends up in the place at first but goes behind and returns back even when the hp isn't moving)
I sincerely hope that someone could help me on this or point me in the right direction
thanks in advance