From: Bad Boy JH
What about stackables such as water runes or feathers…I know I would love to use this for my water runecrafter/ess miner….
Yeah good notice…
function RandomItem: Integer;
var Rand: Integer;
begin
if ( not InvEmpty ) then begin
Rand := RandomRange( 1, 28 );
if ( ExistsItem( Rand ) ) then
Result := Rand
else
Result := RandomItem
end;
end;
function PriceCheckerOpen: Boolean;
begin
Result := FindTextTPA( 2070783, 20, 213, 26, 308, 41, 'Price Checker', UpChars, Nothing );
end;
function OpenPriceChecker: Boolean;
var x, y: Integer;
begin
if ( not PriceCheckerOpen ) then begin
GameTab( tab_Equip );
if ( FindColorTolerance( x, y, 5095891, 623, 413, 661, 452, 10 ) ) then begin
Mouse( 640, 430, 10, 10, True );
Result := True;
Wait( 500 + Random( 50 ) );
end else
Result := False
end else
Result := True
end;
procedure ClosePriceChecker;
begin
if ( PriceCheckerOpen ) then begin
Mouse( 486, 35, 3, 3, True );
Wait( 1000 + Random( 50 ) );
end;
end;
function PCItem( var Value: Integer; Item: Integer ): Boolean;
var x, y: Integer;
ItemTP: TPoint;
ItemTB: TBox;
begin
if ( OpenPriceChecker ) then begin
if ( InvEmpty ) then begin
Result := False;
Exit;
end;
if ( Item = 0 ) then begin
Item := RandomItem;
end;
Wait( 100 + Random( 50 ) );
if ( ExistsItem( Item ) ) then begin
ItemTP := ItemCoords( Item );
ItemTB := InvBox( Item );
if ( FindColorTolerance( x, y, 65535, ItemTB.X1, ItemTB.Y1, ItemTB.X2, ItemTB.Y2, 5 ) ) then begin
Mouse( ItemTP.X, ItemTP.Y, 5, 5, False );
Wait( 100 + Random( 100 ) );
ChooseOptionMulti( ['Add-All', 'dd-A', 'All'] );
end else
Mouse( ItemTP.X, ItemTP.Y, 5, 5, True )
end;
Wait( 600 + Random( 250 ) );
Value := StrToInt( GetNumbers( GetTextAtEx( 25, 310, 100, StatChars, False, True, 0, 1, -1, 40, True, tr_Digits ) ) );
ClosePriceChecker;
Result := True;
end else
Result := False
end;
function PCItems( var Value: Integer; Items: TIntegerArray ): Boolean;
var I, x, y: Integer;
ItemTP: TPoint;
ItemTB: TBox;
begin
if ( OpenPriceChecker ) then begin
if ( InvEmpty ) then begin
Result := False;
Exit;
end;
for I := 0 to High( Items ) do begin
if ( ExistsItem( Items[ I ] ) ) then begin
ItemTP := ItemCoords( Items[ I ] );
ItemTB := InvBox( Items[ I ] );
if ( FindColorTolerance( x, y, 65535, ItemTB.X1, ItemTB.Y1, ItemTB.X2, ItemTB.Y2, 5 ) ) then begin
Mouse( ItemTP.X, ItemTP.Y, 5, 5, False );
Wait( 100 + Random( 100 ) );
ChooseOptionMulti( ['Add-All', 'dd-A', 'All'] );
end else begin
Mouse( ItemTP.X, ItemTP.Y, 5, 5, True );
end;
Wait( 400 + Random( 300 ) );
end;
Wait( 600 + Random( 250 ) );
end;
Value := StrToInt( GetNumbers( GetTextAtEx( 25, 310, 100, StatChars, False, True, 0, 1, -1, 40, True, tr_Digits ) ) );
ClosePriceChecker;
Result := True;
end else
Result := False
end;