Beast Of Burden

The BeastofBurden file holds functions and procedures that are used in the Runescape beast of burden familiar inventory screen.

The source for this file can be found here.

Consts, Types, Vars

The following constants, types and variables are used throughout the beastOfBurden methods.

const Button Types

Integer constants that represent the button types in the beast of burden interface.

  • BUTTON_GIVE_ITEMS
  • BUTTON_TAKE_ITEMS

const Slot Types

Integer constants that represent the slot types in the beast of burden interface.

  • SLOTS_FAMILIAR
  • SLOTS_PLAYER

type TRSBeastOfBurden

type
  TRSBeastOfBurden = type TRSInterface;

A type that stores the beast of burden interface properties.

var beastOfBurden

var
  beastOfBurden: TRSBeastOfBurden;

A variable through which scripters can access the TRSBeastOfBurden type methods.

TRSBeastOfBurden methods

The following methods should be called through the beastOfBurden variable.

Example:

beastOfBurden.open();

isOpen

function TRSBeastOfBurden.isOpen(waitTime: integer = 0): boolean;

Returns true if the beast of burden screen is open. Includes an optional parameter ‘waitTime’ (default 0) which will search for the beast of burden screen until ‘waitTime’ is reached.

Note

  • by Olly
  • Last Updated: 03 October 2014 by Clarity

Example:

if beastOfBurden.isOpen() then
  writeln('The beast of burden screen is open!');

open

function TRSBeastOfBurden.open(): boolean;

Opens the beast of burden interface via the actionbar.

Note

  • by Clarity
  • Last Updated: 04 October 2014 by Clarity

Example:

beastOfBurden.open();

close

function TRSBeastOfBurden.close(escape: boolean = true): boolean;

Returns true if the beast of burden interface is successfully closed. It uses the ESC key by default, but the escape parameter can be set to false to close via the mouse.

Note

  • by Olly
  • Last Updated: 02 October 2014 by Clarity

Example:

if beastOfBurden.close() then
  writeln('Closed the beastOfBurden screen!');

clickButton

function TRSBeastOfBurden.clickButton(button: integer): boolean;

Returns true if it successfully clicks the button **button*. The button can be one of the two button constants at the top of this page.

Note

  • by Clarity
  • Last Updated: 03 October 2014 by Clarity

Example:

if beastOfBurden.clickButton(BUTTON_TAKE_ITEMS) then
  writeln('We withdrew stored items via the take items button!');

getSlotBoxes

function TRSBeastOfBurden.getSlotBoxes(slotType: Integer): TBoxArray;

Returns a TBoxArray of all of the item slots in the familiar’s or player’s inventory, dependant on slotType . The slotType is one of the two slot type constants at the top of this page.

Note

  • by Clarity
  • Last Updated: 04 October 2014 by Clarity

Example:

boxArr := beastOfBurden.getSlotBoxes(SLOTS_FAMILIAR);
boxArr := beastOfBurden.getSlotBoxes(SLOTS_PLAYER);

getSlotBox

function TRSBeastOfBurden.getSlotBox(slot, slotType: integer): TBox;

Returns the TBox of the desired item slot in the beast of burden interface. Slots start at the top left at 1 and count across the columns. The ** slotType** is one of the two slot type constants at the top of this page.

Note

  • by Coh3n & Clarity
  • Last Updated: 04 October 2014 by Clarity

Example:

var
  b: TBox;
begin
  b := beastOfBurden.getSlotBox(1, SLOTS_PLAYER);

getItemCount

function TRSBeastOfBurden.getItemCount(slotType: integer): integer;

Returns the number of items in either the familiar’s or the player’s inventory. The slotType is one of the two slot type constants at the top of this page.

Note

  • by Coh3n
  • Last Updated: 04 October 2014 by Clarity

Example:

var
  c: integer;
begin
  c := beastOfBurden.getItemCount(SLOTS_PLAYER);

isItemInSlot

function TRSBeastOfBurden.isItemInSlot(slot, slotType: integer): boolean;

Returns true if an item is in the slot slot . The slotType is one of the two slot type constants at the top of this page.

Note

  • by Olly
  • Last Updated: 04 October 2014 by Clarity

Example:

if (beastOfBurden.isItemInSlot(1, SLOTS_FAMILIAR)) then
  writeln('We have an item in familiar slot number 1');

isFull

function TRSBeastOfBurden.isFull(slotType: integer): boolean;

Returns true if either the familiar or player slots are full. The slotType is one of the two slot type constants at the top of this page.

Note

  • by Olly & Clarity
  • Last Updated: 04 October 2014 by Clarity

Example:

if beastOfBurden.isFull(SLOTS_FAMILIAR) then
  writeln('Beast of burden familiar is full!');

isEmpty

function TRSBeastOfBurden.isEmpty(slotType: integer): boolean;

Returns true if our either the familiar or player slots are empty. The slotType is one of the two slot type constants at the top of this page.

Note

  • by Olly & Clarity
  • Last Updated: 04 October 2014 by Clarity

Example:

if beastOfBurden.isEmpty(SLOTS_PLAYER) then
  writeln('our beastOfBurden player pack is empty!');

getCountDTM

function TRSBeastOfBurden.getCountDTM(dtm, slotType: integer): integer;

Searches for the dtm dtm in each familiar or player slot and returns how many matches it finds. The slotType is one of the two slot type constants at the top of this page.

Note

  • by Olly
  • Last Updated: 04 October 2014 by Clarity

Example:

var
  dtm: integer;
  i: integer;
begin
  dtm := dtmFromString('lotsofstuffhere');
  i := beastOfBurden.getCountDTM(dtm, SLOTS_FAMILIAR);
  writeln('We counted ' + intToStr(i) + ' items in our familiar pack.');
end;

getCountBitmap

function TRSBeastOfBurden.getCountBitmap(bmp, tolerance, slotType: integer): integer;

Searches for the bitmap bmp with tolerance tolerance in each familiar or player slot and returns how many matches it finds. The slotType is one of the two slot type constants at the top of this page.

Note

  • by Olly
  • Last Updated: 04 October 2014 by Clarity

Example:

var
  bmp: integer;
  i: integer;
begin
  bmp := bitmapFromString('lotsofstuffhere');
  i := beastOfBurden.getCountBitmap(bmp, tol, SLOTS_PLAYER);
  writeln('We counted ' + intToStr(i) + ' items in our player pack.');
end;

withdraw

function TRSBeastOfBurden.withdraw(slot, amount: integer; mouseOverText: TStringArray): boolean;

Withdraws the the amount amount from the beast of burden slot slot if the mouseOverText is correct. The amount can be any number or the following:

  • WITHDRAW_AMOUNT_ALL

Note

  • by Olly & Clarity
  • Last Updated: 4 October 2014 by Clarity

Example:

// To withdraw 28 items from slot 1 if mouseover text is valid
beastOfBurden.withdraw(1, 28, ['Death rune']);

// To withdraw all items from slot 10 if mouseover text is valid
beastOfBurden.withdraw(10, WITHDRAW_AMOUNT_ALL, ['Death rune']);

// To withdraw 28 items from slot 1 and will *ignore* mouse-over text
beastOfBurden.withdraw(1, 28, ['']);

store

function TRSBeastOfBurden.store(slots: TIntegerArray; amounts: TIntegerArray = []; oneByOne: boolean = false): boolean;

Stores items from the player pack into the familiar pack. Has the capability of storing all items, storing a specific amount of items, and clicking each item one by one.

  • slots : The slots you want to store.
  • amounts : The amounts of the slots to store. Set index to -1 to store all. Stores all of every item by default.
  • oneByOne : Will click items one by one to store (default = false)

Note

  • by Coh3n
  • Last Updated: 04 October 2014 by Clarity

Examples:

beastOfBurden.store([2..28]); // All of slot 2 to 28
beastOfBurden.store([1, 2, 3, 4], [-1, 10, 15, 14]);  // Slots and amounts
beastOfBurden.store([1..28], [], true); // One by one