SRL Archive - OSR Help

Mouse hovering


Pakyakkistan

2014-02-27 18:15:08

What function should I call for, while waiting for my player to finish mining (during the mining process) to hover the mouse over the next potential ore rock? I have no ideas on this other then ones that will cause it to continually hop around to the other ores even if we have found one to hover over. Do I need do use a 'while' loop? Currently my waiting procedure is in a repeat until loop if that will change how the function that can/will be used, will be used. Any help or ideas on this would be greatly appreciated. Thanks - Pakki

Hoodz

2014-02-27 18:38:45

You can do this with tpoint arrays (aca). Not 100% sure how to do it though

Sk1nyNerd

2014-02-27 18:52:05

you can get the point of the first rock when the mouse clicks it and create a box around it, you then can start searching for the next rock while you check for a color change inside the box and if it doesnt change colors in x amount of time move the mouse back and click on it again otherwise if the color changes (you mined the ore) click on the new ore and repeat.

that might work, when you move it might throw off the x,y of the box though…

i feel like reflection might be able to do this

Pakyakkistan

2014-02-27 19:26:49

From: hoodz
You can do this with tpoint arrays (aca). Not 100% sure how to do it though


From: Sk1nyNerd
you can get the point of the first rock when the mouse clicks it and create a box around it, you then can start searching for the next rock while you check for a color change inside the box and if it doesnt change colors in x amount of time move the mouse back and click on it again otherwise if the color changes (you mined the ore) click on the new ore and repeat.

that might work, when you move it might throw off the x,y of the box though…

i feel like reflection might be able to do this


Indeed I felt as if reflection may be the best here and now that I have had a thought on this due to what you have said I may rewrite the mining procedure to use reflection for the mining process.
Thought of the TPoint array but I don't really know enough about them, felt like it would effect how the script looks for the rocks right now. Trying to keep it in its 'good' stage now and not work backwards again. May end up not even worrying about the mouse hovering, but if I can implement it needs to be done for a more human style mining process.
Thank you both for input + ideas.

Pakyakkistan

2014-02-27 19:31:02

Wow and then I post that and then started thinking back to my varrock knife smither, I may be able to call search for color in tile with reflection(think the function/procedure is R_ChooseOptionTileColor and I can even modify this if needed…) If I used this tho, how will I go about preventing it from hopping to several rock options? Make a case function? While loop? This is what my current mining procedure looks like -

If FindObjCustom(x, y, ['Mine', 'Rocks', 'Mine Rocks'], [MithColor ], 1) then
begin
Al_FastClick(Mouse_left);
if R_WaitForAnimation(3500+random(750)) then
If ClickContinueEx(False, False) = true then
if InvCount < 27 then
begin
PickLost;
end else;
Repeat
WaitingForOre;//This would be where I will need to put the hover option? Or, maybe somewhere else that I don't see?
until R_IsAnimating = False;
end else;