Simba Code:
function HandleStuff: Boolean;
var x,xm,ym,t, slot, RuneAmount: Integer;
var where:TPoint;
var thebox, WTBox:TBox;
var tempstr:string;
bm:integer;
begin
thebox :=IntToBox(582,325,788,470);
if infight then Exit(False;
for x:= 0 to length(Items) do
begin
case Items[x].u of
1: // disassemble
begin
bm := bitmapfromstring(Items[x].w,Items[x].h,Items[x].bm);
if findbitmapmasktolerance(bm, where, thebox, 10, 10) then
begin
t := GetSystemTime;
Mouse(where.x + 4 + Random(16),where.y + 4 + Random(16));
dragmouse(Point(617 + Random(8),570 + Random(8)));
w8(1);
incEx(Items[x].a,1);
Mouse(422+Random(140),449 + Random(120));
repeat
if WereDone then
begin
Result := True;
Break;
end
until (GetSystemTime > t + 10000);
end;
Freebitmap(bm);
end;
2: // eat
begin
if infight then
begin
Exit(False);
end;
bm := bitmapfromstring(Items[x].w,Items[x].h,Items[x].bm);
if findbitmapmasktolerance(bm, where,thebox, 10, 10) then
begin
xm := Where.x; ym := Where.y;
Mouse(xm ,ym,16,16, MOUSE_LEFT);
incEx(Items[x].a,1);
w8(2);
end;
Freebitmap(bm);
end;
3: // bury
begin
if infight then
begin
Result := False;
exit;
end;
bm := bitmapfromstring(Items[x].w,Items[x].h,Items[x].bm);
if findbitmapmasktolerance(bm, where, thebox, 10, 10) then
begin
xm := Where.x; ym := Where.y;
Mouse(xm ,ym,16,16, MOUSE_LEFT);
incEx(Items[x].a,1);
w8(2);
end;
Freebitmap(bm);
end;
4: // craft
begin
bm := bitmapfromstring(Items[x].w,Items[x].h,Items[x].bm);
if findbitmapmasktolerance(bm, where, thebox, 10, 10) then
begin
t := GetSystemTime;
xm := Where.x; ym := Where.y;
Mouse(xm ,ym,16,16, MOUSE_LEFT);
incEx(Items[x].a,1);
w8(4);
if ClickBlueBut then
begin
repeat
if WereDone then
begin
Result := True;
Break;
end
until (GetSystemTime > t + 10000);
Freebitmap(bm);
incEx(Items[x].a,1);
end
else
Freebitmap(bm);
end;
end;
5: // magic notepaper
begin
bm := bitmapfromstring(Items[x].w,Items[x].h,Items[x].bm); // gem
if findbitmapmasktolerance(bm, where, thebox, 10, 10) then
begin
xm := Where.x; ym := Where.y;
Mouse(xm ,ym,16,16, MOUSE_RIGHT);
if chooseOption.select(['se']) then
begin
incEx(Items[x].a,1);
Mouse(422+Random(140),449 + Random(120));
w8(2);
if FindBitMapToleranceIn(MNP, xm, ym, thebox, 30) then
begin
writeln('found MagicNotePaper. Clicking');
Mouse(point( xm+random(15), ym + Random(14) ),MOUSE_LEFT);
w8(2);
Result := True;
end
result := True;
end;
end;
Freebitmap(bm);
end
6: // HiAlc
begin
bm := bitmapfromstring(Items[x].w,Items[x].h,Items[x].bm);
if findbitmapmasktolerance(bm, where, thebox, 10, 10) then
begin
t := GetSystemTime;
Mouse(where.x + 4 + Random(16),where.y + 4 + Random(16));
dragmouse(Point(700 + Random(8),570 + Random(8)));
w8(1);
incEx(Items[x].a,1);
Mouse(422+Random(140),449 + Random(120));
repeat
if WereDone then
begin
Result := True;
Break;
end
until (GetSystemTime > t + 10000);
end;
Freebitmap(bm);
end
7: // skip
begin
end
end
end;
for x := 1 to 15 do
begin
runeAmount := getItemAmount(tabBackpack.getSlotBox(x));
writeln('amount = ' + IntToStr(RuneAmount));
if runeamount > 50 then
begin
WTBox := tabBackpack.getSlotBox(x);
xm := WTBox.x1; ym := WTBox.y1;
Mouse(xm + 4 + Random(16), ym + 4 + Random(16));
dragmouse2(Point(617 + Random(8),570 + Random(8)));
w8(2);
Mouse(422+Random(140),449 + Random(120));
t := GetSystemTime;
repeat
if WereDone then
begin
Result := True;
Break;
end
until (GetSystemTime > t + 30000);
incEx(Items[17].a,50);
end
end;
cleardebug;
writeln('Worked for ' + TimeRunning);
for x:= 0 to length(Items) do
begin
if Items[x].a <> 0 then
begin
if Items[x].u = 1 then
writeln('Disassembeled ' + IntToStr(Items[x].a) + ' ' + Items[x].n + 's');
if Items[x].u = 2 then
writeln('ate ' + IntToStr(Items[x].a) + ' ' + Items[x].n + 's');
if Items[x].u = 3 then
writeln('buried ' + IntToStr(Items[x].a) + ' ' + Items[x].n + 's');
if Items[x].u = 4 then
writeln('crafted ' + IntToStr(Items[x].a) + ' ' + Items[x].n + 's');
end
end;
end;