some amateur work of mine:
my birds nest function, should work independently
Code:
function FindBirdsNest1: Boolean;
var // seed nest [(5073, 1, (2726, 3492)), ring nest (5074, 1, (2726, 3493))]
i: Integer;
itemsInArea:TGroundItemArray;
begin
itemsInArea:=R_GetGroundItemsDistance(10);
for i:=0 to high(itemsInArea) do
begin
if((itemsInArea[i].ID = 5073) or (itemsInArea[i].ID = 5074)) then
begin
birdsnest:=birdsnest+1;
Writeln('Birds Nest Found.');
Result:=R_ChooseOptionTile('Take',itemsInArea[i].Tile);
end;
end;
end;
this won't work independently, but is my ent detection function. it works very well for me. in my chop function it stores the current trees' tile and matches it against the ent npcs tile. perhaps the idea might be helpful
Code:
Function FindEnt: tpoint;
begin
if (R_Findnpc('Magic tree',ent)) then
begin
entnpcs:=r_getallnpcs;
result:=ent.tile;
if(ent.tile = currentTree) then
begin
if(not evacced) then
begin
Writeln ('An ent has been detected...');
ents:=ents+1;
R_BlindWalk(R_Gettileglobal.x+randomrange(-1,1),R_Gettileglobal.y+randomrange(-1,1)));
evacced:=true
end;
end;
end
else
begin
evacced:=false;
result:=point(0,0);
end;
end;
this is my frog solver for the time being, not really a catchall, but a stop gap. it gets me out of the cave at least. (the one time i've tested it ~ not sure if the npc id's change per instance)
Code:
function withinZone(topLeft,botRight: tpoint): boolean;
begin
MyLoc:=R_GetTileGlobal;
result:=((myloc.x>topLeft.x) and (myloc.x<botRight.x) and (myloc.y<topLeft.y) and (myloc.y>botRight.y));
end;
function froggieRandom: boolean;
var
Peach:Tnpc;
i:integer;
begin
result:=false;
if(withinZone(point(2450,4797),point(2480,4760))) then //thecave
begin
R_FindNPC(1329,Peach);
R_BlindWalk(Peach.tile);
for i:=0 to 5 do
begin
R_FindNPC(1329,Peach);
Mouse(R_TiletoMs(Peach.tile).x,R_TiletoMS(Peach.Tile).y,3,3,true);
wait(2000+random(1000));
if(aretalking)then
break;
end;
if(aretalking) then
begin
ClickContinueEx(true,true);
ClickText('back','CharsNPC07',MCX1,MCY1,MCX2,MCY2,true);
wait(randomrange(600,800));
ClickContinueEx(true,true);
ClickContinueEx(true,true);
result:=true;
end;
end;
end;
i'm hoping someone finds these useful