I'm coding it but I have already notice a problem.
I need to add to the mining time the time my char needs to reach the ore.
When mining starts a green bar appears so I need to start the mining time count once the mining starts.
How to do that?
Code: Select all
function am_I_mining()
r,g,b = getPixel(hdc, x, y);
-- check for the green bar
if( r,g,b = green with little offset ) then
return true;
else
return false;
end
end
I think this code should work but, where do I insert this function?
Maybe this way?
Code: Select all
If am_I_mining() = true then
mining time
pickup
----
Have a similar problem with my fighting routine, it works well but some skills are "lost" cause they are being cast while my char is still moving towards the target. So to check if battle has started or not I think a similar code like above should work, just checking the first target's life pixel.
So, intead starting the fighting function once I have a target it should start after the first hit.
Code: Select all
function battle()
r,g,b = getPixel(hdc, x, y);
-- check for the first pixel of the enemy life bar
if( r,g,b = gray with little offset ) then
fight();
else
... else what?????;
end
end
Will this keep a track of that first pixel or will it be checked only once?
Should I ad a bucle:
Code: Select all
for i = 0,10 do
battle()
yrest(500)
This should check battle status every half second?
Do I need something like this?
If yes, there is a better way to do this? That last code looks really crappy to me.
---
Thanks for your time. I'm enjoying a lot the scripting thingy
