Simba Code:
function PickPineapple: Boolean;
var
MS: TPoint;
PineappleDTM, PineappleRingDTM: Integer;
ICount: Integer;
begin
Result := False;
if InvCount > 20 then
Exit;
WriteLn('Getting ready to pick up pineapple');
ICount := InvCount;
MS := TileToMS(Tile(2775, 2749), 0);
Result := FindColorSpiralTolerance(MS.X, MS.Y, 2003166,
MS.X - 50, MS.Y - 50,
MS.X + 50, MS.Y + 50,
20);
WriteLn('Trying to find pineapple color: ' + BoolToStr(Result));
if not Result then
Exit;
MMouse(MS.X, MS.Y, 3, 3);
if not WaitUptext('Pick', 100) then
begin
Result := False;
WriteLn('Looking for uptext: ' + BoolToStr(Result));
Exit;
end;
WriteLn('Looking for uptext: ' + BoolToStr(True));
// Picking up pineapple
Mouse(MS.X, MS.Y, 3, 3, True);
FailTimer := GetSystemTime;
while (ICount = InvCount) and (FailTimer + 10000 > GetSystemTime) do
Wait(100);
Result := not (FailTimer + 1000 > GetSystemTime);
WriteLn('Trying to pick up pineapple: ' + BoolToStr(Result));
if not Result then
Exit;
// Finding picked up pineapple in inventory
PineappleDTM := DTMFromString('mQwAAAHicY2ZgYKhkYmCoAeISIGZgZGD4AaS+AfGSbHEG3hh+MEYGjEgYCAD3CQV7');
Result := ExistsItemDTM(PineappleDTM, MS.X, MS.Y);
FreeDTM(PineappleDTM);
WriteLn('Trying to pineapple in inventory: ' + BoolToStr(Result));
if not Result then
Exit;
// Clicking on knife
InvMouse(1, 1);
FailTimer := GetSystemTime;
while (not ItemActivated(1)) and (FailTimer + 2000 > GetSystemTime) do
Wait(100);
Result := ItemActivated(1);
WriteLn('Clicking on the knife: ' + BoolToStr(Result));
if not Result then
Exit;
// Clicking on pineapple
//Mouse(MS.X, MS.Y, 3, 3, True);
WriteLn('Using knife on pineapple in inventory: ' + BoolToStr(Mouse(MS.X, MS.Y, 3, 3, True)));
// Clicking to slice the pineapple
PineappleRingDTM := DTMFromString('mLgAAAHicY2JgYDgGxGeAeA8jA8N2IN45WYphUaM4AwwwQjEDAwCr6AWs');
FailTimer := GetSystemTime;
while (not FindDTM(PineappleRingDTM, MS.X, MS.Y, MCX1, MCY1, MCX2, MCY2)) and (FailTimer + 2000 > GetSystemTime) do
Wait(100);
Result := FindDTM(PineappleRingDTM, MS.X, MS.Y, MCX1, MCY1, MCX2, MCY2);
WriteLn('Choosing the option to slice pineapple: ' + BoolToStr(Result));
FreeDTM(PineappleRingDTM);
if not Result then
Exit;
Mouse(MS.X, MS.Y, 3, 3, True);
end;