SRL Archive - OSR Help

Human like object finding?


NoUserName

2012-06-02 11:58:17

Hey People =]

Looking to find a way off collecting an object that there are multiples off from floor not a problem pretty easy right well as usual ive become stuck with making this more human like it kind off collects were ever it wants to and not from closest.

Ive tried using TPA’s and just finding colour (findcoloursprial) but both return the same result random clicking off the objects all over the screen =[

Any idea’s on how I can make it search and collect more human like

[deleted all my code snippets in anger *face palm*


im trying to get the bot to collect an item until it has an iv but it keeps running all over the place to get them if it helps im collecting bones

J J

2012-06-03 04:39:36

Use FindColorsSpiralTolerance to get a TPA that has all the color co-ordinates stored. Then use SplitTPAEx to make an ATPA that has multiple splitted TPA's stored. Then you can sort the ATPA from size or just from the closest point near your character. Then you can use MiddleTPA to get the middle point, move the mouse there, check for uptext, if the uptext is correct loot the item. Then wait until walking or wait until a new item has been added to your inventory. Then repeat that process.

Example
function RopeFail: Boolean;
var
X, Y, i: Integer;
LadderCl: TPointArray;
LadderClSplit: Array of TPointArray;

begin
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.12, 1.01);
if FindColorsSpiralTolerance(X, Y, LadderCl, 3030082, MSCX-100, MSCY-50, MSCX, MSCY+50, 11) then
begin
SplitTPAExWrap(LadderCl, 1, 1, LadderClSplit);
SortATPASize(LadderClSplit, True);
for i:=0 to High(LadderClSplit) do
begin
MiddleTPAEx(LadderClSplit[i], X, Y);
MMouse(X, Y, RandomRange(-2, 2), RandomRange(-2, 2));
if WaitUpTextMulti(['limb', 'up', 'adder', 'Climb', 'Ladder'], 500) then
begin
ClickMouse2(1);
Wait(4000 + Random(1000));
Result:=True;
Break;
end;
end;
end;
end;

NoUserName

2012-06-03 16:52:41

thanks will have to have a look in to it i think i have used this method but with no luck will have to give it another go