Le Jingle
2012-09-04 00:02:13
Here's a little snippet, that aids for those chat box options when you use items on each other / objects.
Here's the example / image of what I mean, and what this snippet will click.

It only supports up to 5 boxes, because after that you need to slide the options to get to more options (done by hovering the mouse over the arrow). Here's an example / image of what I mean by too many boxes:

However I found this to be very helpful for things like cooking, potion making, bonefire firemaking (especially when you have 2 types of wood in your invent, such as maples and willows @ Daemonheim Woodcut Resource area, etc.), etc etc.
Also NOTE: This isn't any cool algorithmic function :/ but if you can turn the T2DIntegerArray into one, I'd be so grateful as it would definitely teach me something! :)
Also Also Note: It only works, AFTER you have used your item to make the chat interface appear.
Cheers,
Lj
Edit; noticed that each array increases/decreases (w/ exception that twice it will stay at 259), distance from 259 by approx 49 each time.. but still stumped on a better equation. D:
Here's the example / image of what I mean, and what this snippet will click.

It only supports up to 5 boxes, because after that you need to slide the options to get to more options (done by hovering the mouse over the arrow). Here's an example / image of what I mean by too many boxes:

However I found this to be very helpful for things like cooking, potion making, bonefire firemaking (especially when you have 2 types of wood in your invent, such as maples and willows @ Daemonheim Woodcut Resource area, etc.), etc etc.
Also NOTE: This isn't any cool algorithmic function :/ but if you can turn the T2DIntegerArray into one, I'd be so grateful as it would definitely teach me something! :)
Also Also Note: It only works, AFTER you have used your item to make the chat interface appear.
program new;
{$i srl/srl.simba}
{
Ex. of usage =
if FindClickBox(3, 1) then
writeln('found 3 fletch choices, picking shortbow box, aka the 1st box.');
}
function FindClickBox(HowManyBoxes, WhichBox: Integer): Boolean;
var
MiddleXs: T2DIntegerArray;
begin
result := false;
if not inrange(HowManyBoxes, 1, 5) then
srl_warn('LogsChatBox', 'Too little/many boxes to choose!', warn_AllVersions);
MiddleXs := [TIntegerArray([259]),
TIntegerArray([211,307]),
TIntegerArray([161,259,357]),
TIntegerArray([112,210,308,406]),
TIntegerArray([105,182,259,336,413])];
if (CountColorTolerance(1710098, MCX1, MCY1, MCX2, MCY2, 1) > 500) then
begin
Mouse(MiddleXs[HowManyBoxes - 1][WhichBox - 1], 477 - 50, 25, 25, mouse_left);
result := WaitColorCount(9614019, MCX1, MCY1, MCX2, MCY2, 42, 1000, 56000, 5000);
end else
Writeln('Not enough colors found in chat box.');
end;
begin
SetupSRL;
ActivateClient;
if FindClickBox(1, 1) then
writeln('success');
end.
Cheers,
Lj
Edit; noticed that each array increases/decreases (w/ exception that twice it will stay at 259), distance from 259 by approx 49 each time.. but still stumped on a better equation. D:
