Gametab

This Include contains all Gametab Routines.

Contents

Ability Book and Action Bar

Ability Book and Action Bar related functions

ActiveMainAbilityTab

function ActiveMainAbilityTab(): Integer;

Returns which of the four main Ability Book tabs is currently active.

Note

by euphemism

ActiveSubAbilityTab

function ActiveSubAbilityTab(): Integer;

Returns which of the sub-tabs beneath the active main tab is currently active.

Note

by euphemism

SetAbilityBook

function SetAbilityBook(Tab: Integer): Boolean;

Takes a sub-tab constant (see globals.simba), and changes the main tab and sub-tabs of the Ability Book as necessary to make the target sub-tab the active sub-tab. Returns true if successful.

Note

by euphemism

GetAbilityLocation

procedure GetAbilityLocation(AbilityConstant: Integer; out SubTab, PositionUnderTab: Integer);

Returns the sub-tab (Through SubTab of the Ability Book that the Ability (AbilityConstant) is under, and then the position of the ability within the SubTab (Through PositionUnderTab).

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

Example:

GetAbilityLocation(AB_SURGE, SubTab, PositionUnderTab);
//SubTab would contain 3 (AB_ABILITIES), as that is the constant for the
//Abilities sub-tab, and PositionUnderTab would contain 7, as that is the
//position of the ability within the sub-tab.

AbilitySlotToBox

function AbilitySlotToBox(Slot: Integer): TBox;

Returns a TBox around the specified Ability Book slot. Currently does not work with the standard combat spells tab, as they are aligned to a different grid than the rest of the Ability Book.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

SlotBox := AbilitySlotToBox(AB_SURGE);
MouseBox(SlotBox.x1, SlotBox.y1, SlotBox.x2, SlotBox.y2, mouse_Left);

IsActionBarOpen

function IsActionBarOpen(): Boolean;

Results True if the Action Bar is showing.

Note

by euphemism

ToggleActionBar

function ToggleActionBar(Open: Boolean): Boolean;

Opens or closes the Action Bar, true if had to toggle.

Note

by euphemism, modelled after ToggleXPBarEx by Narcle & IceFire908

ActionBarSlotToBox

function ActionBarSlotToBox(Slot: Integer): TBox;

Returns the TBox (30 x 30) of the action bar at position Slot.

Note

by Slushpuppy

Example:

ActionBarSlotToBox(1);

ActionBarSlotEmpty

function ActionBarSlotEmpty(Slot: Integer): Boolean;

Results True if the specified Action Bar slot is empty.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

if (not ActionBarSlotEmpty(4)) then
  ClearActionBarSlot(4);

GetAbilityCooldown

function GetAbilityCooldown(ActionBarSlotOrAbilityConstant: Integer): Integer;

Returns a number, 0-100 (or -1 in the case that it fails to get the cooldown) indicating the percentage complete of the cooldown of the specified ability, ActionBarSlotOrAbilityConstant. Passing 1-12 will check the ability in the coordinating Action Bar slot, and passing an ability constant, such as AB_SURGE, will open the Ability Book and check there for the ability’s cooldown.

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

Example:

if (GetAbilityCooldown(AB_SURGE) = 100) then
  WriteLn('Ability is ready to use.');

while (GetAbilityCooldown(AB_SURGE) < 100) do
  WriteLn('Ability cooldown is ' + IntToStr(GetAbilityCooldown(AB_SURGE)) + '% complete.');

UseAbility

function UseAbility(ActionBarSlotOrAbilityConstant: Integer): Boolean;

If the ability is ready to use, the function will click the ability and return true or false depending on if the cooldown of the ability begins. Passing 1-12 will use the ability in the coordinating Action Bar slot, and passing an ability constant, such as AB_SURGE, will open the Ability Book and use the ability there.

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

Example:

if (not UseAbility(3)) then
  WriteLn('Was unable to use ability in Action Bar slot 3.');

AbilityInSlot

function AbilityInSlot(AbilityConstant, ActionBarSlot: Integer): Boolean;

Opens up the Ability Book where the ability, AbilityConstant, is located, and checks to see if the ability is in the specified Action Bar slot, ActionBarSlot. This function doesn’t really have a use except for within the following functions.

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

GetAdrenalinePercent

function GetAdrenalinePercent : Integer;

Gets percent(0-100) of adrenaline in the action bar. Function returns -1 if actionbar is not active

Note

by Slushpuppy

Example:

GetAdrenalinePercent;

IsActionBarLocked

function IsActionBarLocked(): Boolean;

Results True if the Action Bar is locked.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

if (IsActionBarLocked()) then
  ToggleActionBarLock(False);

ToggleActionBarLock

function ToggleActionBarLock(Lock: Boolean): Boolean;

Locks or unlocks the Action Bar, true if had to toggle.

Note

by euphemism, modelled after ToggleXPBarEx by Narcle & IceFire908 Last modified: Dec. 21st, 2012 by euphemism

Example:

if (IsActionBarLocked()) then
  ToggleActionBarLock(False);

ActionBarEmpty

function ActionBarEmpty(): Boolean;

Results True if the entire Action Bar slot is empty.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

if (ActionBarEmpty()) then
  Writeln('Action Bar is empty and ready to receive abilities.');

ClearActionBarSlot

function ClearActionBarSlot(Slot: Integer): Boolean;

Results True if the specified Action Bar slot is successfully cleared.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

if (ClearActionBarSlot(4)) then
  Writeln('Action Bar Slot 4 is now empty.');

ClearActionBar

function ClearActionBar(): Boolean;

Results True if the entire Action Bar is successfully cleared.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

if (ClearActionBar()) then
  Writeln('Action Bar is empty and ready to add abilities/prayers/items');

CurrentActionBar

function CurrentActionBar(): Integer;

Members can have five different Action Bars setup. Returns the number of the active Action Bar. Returns -1 if it is unable to grab the text.

Note

by euphemism Last modified: Dec. 21st, 2012 by euphemism

Example:

if (CurrentActionBar() <> 1) then
  SwitchActionBar(1, False);

SwitchActionBar

function SwitchActionBar(WhichBar: Integer; UseBindKey: Boolean): Boolean;

Switch to action bar WhichBar, returns true on success. Set and use ctrl bind key if UseBindKey, otherwise click the arrows or right click to switch.

Note

by riwu

ClickActionBarSlot

function ClickActionBarSlot(Slot: Integer): Boolean;

Clicks the specified Action Bar slot. If the specified Action Bar slot is empty the function will return false. Otherwise, it clicks the slot and returns true.

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

AddAbilityToActionBar

function AddAbilityToActionBar(AbilityConstant, ActionBarSlot: Integer): Boolean;

Adds the specified ability, AbilityConstant, from the Ability Book to the specified slot, ActionBarSlot, of the Action Bar. Returns true on success.

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

Example:

if (AddAbilityToActionBar(AB_SURGE, 5)) then
  WriteLn('Added the Surge ability to Action Bar slot 5.');

AddItemToActionBar

function AddItemToActionBar(InvSlot, ActionBarSlot: Integer): Boolean;

Adds the item (if it exists) in the specified Inventory slot, InvSlot, to the specified slot, ActionBarSlot, of the Action Bar. Returns true on success.

Note

by euphemism Last modified: Jan. 31st, 2013 by euphemism

Example:

if (AddItemToActionBar(4, 5)) then
  WriteLn('Added the item in Inventory slot 4 to Action Bar slot 5.');

GetKeyBind

function GetKeyBind(Slot: Integer): String;

Gets the key binded to the action bar at Slot.

Note

by riwu Last modified: 1 Jan 2012 by riwu

Gametab Functions

GetCurrentTab

function GetCurrentTab: Integer;

Returns current tab.

Note

by Zephyrsfury

Example:

if (not tabExists(TAB_MAGIC)) then
  writeln('We may be in a random event!');

TabExists

function TabExists(tab: integer): boolean;

Returns true if the gametab ‘tab’ exists. Tab constants can be found in globals.simba.

Note

by Zephyrsfury & Icefire908 Last Modified: Mar. 7th, 2012 by Coh3n

Example:

if (not tabExists(TAB_MAGIC)) then
  writeln('We may be in a random event!');

GameTab

function GameTab(Tab: Integer): Boolean;

Returns True if the Tab exists.

Note

by Zephyrsfury

const
  tab_Combat = 21;
  tab_Stats = 22;
  tab_Quest = 23;
  tab_Diary = 24;
  tab_Inv = 25;
  tab_Equip = 26;
  tab_Prayer = 27;
  tab_Magic = 28;
  tab_Objectives = 29;
  tab_Friends = 30;
  tab_Ignore = 31;
  tab_Clan = 32;
  tab_Options = 33;
  tab_Emotes = 34;
  tab_Music = 35;
  tab_Notes = 36;
  tab_LogOut = 37;

Note

Please use the constants and not the numbers! They may change any interface update.

Example:

FTab

function FTab(Tab: Integer): Boolean;

Instead of clicking the Tab this uses the F keys to instantly switch to the tab. Only works with Inv, Equip, Prayer, Magic and Combat tabs (F1-F5). Returns True if the Tab exists.

Note

by Narcle Last Modified: 22/12/12 by riwu

const
  tab_Combat = 21;
  tab_Inv = 25;
  tab_Equip = 26;
  tab_Prayer = 27;
  tab_Magic = 28;

Note

Please use the constants and not the numbers! They may change any interface update.

Example:

Gametab 1

Gametab 1 related functions.

SetFightMode

function SetFightMode(oFightMode: Integer): Boolean;

Sets fight mode. Returns false if failed to set desired mode.

Note

by Nielsie95 & Nava2, fixed by Quickmarch

Example:

GetWeaponName

Function GetWeaponName: String;

Returns the name of the weapon your currently using.

Note

by Narcle

Example:

GetWeaponData

function GetWeaponData(var WArr: array of TStringArray): Boolean;

Grabs weapon data and puts it into T2DStringArray. The data is the information you get when you mouse over the attack styles of the weapon. This then sets it into a array that can be used to set the fight mode of the weapon. It even gets info like ‘Crush’ or ‘Slash’ can be useful if the NPC is weak to that type of attack.

Note

by Narcle

Example:

SetWeaponMode

Function SetWeaponMode(Skill: string; WeaponData: array of TStringArray; SetIt: boolean): boolean;

Sets Combat mode depending on WeaponData given. You can also decide to SetIt which will set it to that particular skill or read it to see if they are ranging, meleeing or using magic (with staff).

Note

by Narcle

Example:

SetCombatType

function SetCombatType(Kind : string): Boolean;

Sets Combat mode inputted into Kind, treat like UpText.

Note

by Narcle & Nava2

Example:

GetCombatLevel

function GetCombatLevel: Integer;

Returns the players combat level.

Note

by Nielsie95 & Narcle Updated 26/11/2012 by riwu

Example:

HasTarget

function HasTarget: Boolean;

Returns true if the player has a combat target currently.

Note

by riwu

Example:

GetTargetCombatLevel

function GetTargetCombatLevel: Integer;

Returns the target combat level.

Note

by riwu, modelled after GetCombatLevel by Nielsie95 & Narcle

Example:

TargetHpPercent

function TargetHpPercent: Integer;

Returns the Hp Percent of the target.

Note

by riwu

Example:

Retaliate

procedure Retaliate(RetTrue: Boolean);

Set’s Auto Retaliate ON of OFF.

Note

by WT-Fakawi & n3ss3s, slight mod by EvilChicken! Updated 26/11/2012 by riwu

Example:

Gametab 2

Gametab 2 related functions.

SkillCoords

function SkillCoords(Row, Column: Integer): TPoint;

Returns Coords of Skill’s Row and Column (Used for GetSkill functions)

Note

by NaumanAkhlaQ

Example:

SkillToCoords

function SkillToCoords(Skill: Variant): TPoint;

Turns skill string into TPoint. If Scroll returns true then you must scroll down.

Note

by Masquerader et. al.

Example:

GetSkillInfo

function GetSkillInfo(Skill: Variant; Amount : Boolean): Integer;

Gets the amount / level of a skill. E.G. 0/15 Amount = True will return 0. Amount = False will return 15 (The actual level). Returns -1 if the level couln’t be grabbed succesfully

Note

by Raymond

Example:

GetSkillLevel

Function GetSkillLevel(skill: Variant): Integer;

Gets the max level for a particular skill.

Note

by Raymond

Example:

IsRunOn

function IsRunOn: Boolean;

Returns True if run button is on.

Note

by Slushpuppy

Example:

IsResting

function IsResting: Boolean;

Returns True if you are currently resting.

Note

by Sabzi

Example:

GetMMLevels

Function GetMMLevels(LevelType : String;var ColorSign : String): integer;

Returns the level shown next to the minimap. Colorsign returns the color of the text (Green,Yellow,Orange,Red). Returns -1 if failed.

Note

by Raymond / Wizzup / Sabzi / NCDS

Example:

Value := GetMMLevels( 'hp' ) ;       // Will retrieve your Hit Points
Value := GetMMLevels( 'pray' ) ;     // Will retrieve your Prayer Points
Value := GetMMLevels( 'run' ) ;      // Will retrieve your Run energy
Value := GetMMLevels( 'summon' ) ;   // Will retrieve your Summoning Points

GetXP

function GetXP(Skill: Variant): Integer;

Returns current xp for a skill. Returns -1 if failed.

Note

by Nielsie95

Example:

XPTillNextLevel

function XpTillNextLevel(Skill: Variant): Integer;

Returns current xp until you level up in a skill. Returns -1 if failed.

Note

by Nielsie95

Example:

HPPercent

function HpPercent: Integer;

Returns Hp left as a percentage. Does not switch tabs if Players[CurrentPlayer].Level[SKILL_HITPOINTS] (HP level) is set. Returns -1 if failed.

Note

by Wizzup?

Example:

GetAllLevels

procedure GetAllLevels;

Sets all 25 skilllevels to Players.Level[0..24]: Refer to the ‘GameTab 2 Related Functions’ above for the order.

Note

by WT-Fakawi & ZephyrsFury

Example:

Gametab 4

Gametab 4 related functions

Gametab 5

Gametab 5 related functions

EquipmentCoords

function EquipmentCoords(EquipSlot: Integer): TPoint;

Returns X and Y of the coordinates of the specified equipment item

Note

by RsN modded by WT-Fakawi and Nielsie95

Example:

GetEquippedItemBounds

function GetEquippedItemBounds(Which: String): TBox;

Returns TBox of eqquipped item in which.

Note

by Nava2

Example:

MouseEquippedItem

procedure MouseEquippedItem(Which : String; Left : Integer);

Mouses Equipped item like MouseItem.

Note

by Nava2

Example:

WearingItem

function WearingItem(i: Integer): Boolean;

Results True if an item is equipped at equpiment slot defined by I.

Note

by RsN

Example:

TakeOff

procedure TakeOff(I: Integer);

UnEquips Item specified in i.

Note

by RsN

Example:

TakeOffAllExcept

procedure TakeOffAllExcept(ExceptionSlots: TIntegerArray);

Takes off equipped items defined by StripSlots.

Note

by EvilChicken!

Example:

TakeOffAllItems

procedure TakeOffAllItems;

Takes off all equipped items.

Note

by EvilChicken!

Example:

CountEquippedItems

function CountEquippedItems: Integer;

Counts the amount of equipped items. Results “-1” if failed.

Note

by EvilChicken!

Example:

Gametab 6

Gametab 6 related functions

Gametab 7

Gametab 7 related functions

Gametab 8

Gametab 8 related functions

CurrentWorld

function CurrentWorld: Integer;

Returns current world from Friends Tab

Note

by Home

Example:

Gametab 9

Gametab 9 related functions

ObjectivePercent

function ObjectivePercent: Integer;

Returns (Roughly) Objective Completion in Percent. Results -1 if failed.

Note

by r!ch!e

Example:

ObjectiveCoords

function ObjectiveCoords(ObjSlot: Integer): TPoint;

Returns Coords of Random Objective Slot (ObjSlot : 1..6)

Note

by r!ch!e & Naum

Example:

HasObjective

function HasObjective: Boolean;

Returns True if an Objective is set.

Note

by r!ch!e

Example:

ClearObjective

function ClearObjective: Boolean;

Returns True if an Objective is Cleared, or no Objective Exists.

Note

by r!ch!e

Example:

SetObjective

function SetObjective(Skill: String; Level: Integer): Boolean;

Sets Objective according to Skill and Level. Returns True if Objective is set.

Note

by r!ch!e

Example:

SetRandomObjective

function SetRandomObjective(ObjectiveSlot: Integer; KeepOld: Boolean): Boolean;

Sets a Random Objective Slot (ObjSlot : 1..6). If an objective is already set KeepOld determines if it is overwritten. Returns True if Objective is set.

Note

by r!ch!e

Example:

Gametab 10

Gametab 10 related functions

Gametab 11

Gametab 11 related functions

SetRun

function SetRun(Run: Boolean): Boolean;

Sets Run on or off.

Note

by Wizzup? & EvilChicken!

Example:

RunEnergy

function RunEnergy(Min: Integer): Boolean;

Toggles run if energy is greater or equal to MinEnergy. Results true if energy is greater or equal to minimum.

Note

by lordsaturn & NCDS

Example:

SetRest

function SetRest: Boolean;

Turns Rest on. Result True if successful.

Note

by ZephyrsFury, edited by NCDS

Example:

RestUntil

function RestUntil(Energy: Integer): Boolean;

Rests until your Run energy is above Energy. Results True if successful.

Note

by ZephyrsFury

Example:

RestUntilHP

function RestUntilHP(HPPerc: Integer): Boolean;

Rests until your Run energy is above the given HP percentage. Results True if successful.

Note

by Mama

Example:

FixGraphics

procedure FixGraphics;

Fixes the Graphic Options if LoggedIn

Note

by Naum & Rasta Magician

Example:

SetGraphics

procedure SetGraphics(Brightness: Integer; vl, rr, gd, td, id, fe, gt, cs: string);

Sets graphic options through the Graphics Screen in GameTab 11. Use: Enter the desired Setting for the desired Option. Leave as ‘’ for no change

Parameter Option Setting vl Visible Levels Current / All rr Remove Roofs Always / Selectively gd Ground Decoration Off / On td Texture Detail Low / High ia Idle Animations Few / Many fe Flickering Effects Off / On gt Ground Textures Few / Many cs Character Shadows Off / On

1 2 3 4
Brightness: <—o—o—o—o—>

EG. SetGraphics(2, ‘current’, ‘’, ‘off’, ‘low’, ‘few’, ‘’, ‘few’, ‘off’); For Autoing: SetGraphics(4, ‘current’, ‘always’, ‘off’, ‘low’, ‘few’, ‘off’, ‘few’, ‘off’); OutDated since 02 Sep 09

Note

by ZephyrsFury

Example:

SetAudio

procedure SetAudio(Volume, SFX, Area: Integer; SMSetting: (Stereo, Mono, NoChange) );

Sets audio options through the Audio screen in GameTab 11 Use: Enter the desired Setting AS A POINT for the desired Option. Make option 0 for no change.

1 2 3 4 5
Volume, SFX, Area: <–o—o—o—o—o–>

EG. SetAudio(1, 4, 0, Stereo);

Note

by ZephyrsFury

Example:

SetBar

procedure SetBar(Brightness, Volume, SFX, Area: Integer);

Sets each bar to the specific point. 1-4 for Brightness, 1-5 for others. For no change in the value make the respective parameter 0.

Note

by ZephyrsFury

Example:

Gametab 12

Gametab 12 related functions

DoEmote

procedure DoEmote(EmoteNumber: Integer);

Clicks on an emote specified by EmoteNumber (1 to 37)

Note

by NaumanAkhlaQ

Example:

GetLobbyTab

function GetLobbyTab: Integer;

Gets current lobby tab.

Note

by Bionicle1800, NCDS

Example:

LobbyTab

function LobbyTab(Tab: Integer): Boolean;

Goes to the lobby tab specified by the integer ‘Tab’. Valid arguments are 1 through 5, as well as PlayerInfo, WorldSelect, FriendsList, ClanChat and Options.

Note

by Bionicle1800

Example:

XP Counter

XP Counter related functions

ToggleXPPopUp

Function ToggleXPPopUp(Disabled: Boolean): Boolean;

Toggles the XP Pop-up to on/off that shows up on main screen. This uses the chat messages to determine if its off or on.

ToggleXPPopUp(True) turns it off and returns True if successful ToggleXPPopUp(False) turns it on and returns True if successful

Note

by Narcle

ISXPBarOpenEx

function IsXPBarOpen(CounterNum: integer): Boolean;

Results True if the XP Bar is showing. Counter number 1 to 3

Note

by Narcle & IceFire908

ISXPBarOpen

function IsXPBarOpen: Boolean;

Results True if the XP Bar is showing. Added for compatability

Note

by Narcle & IceFire908

ToggleXPBarEx

function ToggleXPBarEx(Open: Boolean; CounterNum: integer): Boolean;

Opens or closes the XP Bar, true if had to toggle. Counter number 1 to 3

Note

by Narcle & IceFire908

ToggleXPBar

function ToggleXPBar(Open: Boolean): Boolean;

Opens or closes the XP Bar, true if had to toggle.

Note

by Narcle & IceFire908

GetXPBar

function GetXPBar(CounterNum: integer): LongInt;

Returns the number from your XP Bar. Counter number 1 to 3

Note

by Narcle & IceFire908 edited by Ashaman88

GetXPBarTotal

function GetXPBarTotal: LongInt;

Returns the number from your XP Bar.

Note

by Narcle & IceFire908

ResetXPTotal

function ResetXPTotal: Boolean;

Resets the XP Bar.

Note

by Narcle & IceFire908

MoneyPouch Tab

Money Pouch related functions

IsMoneyPouchOpen

function IsMoneyPouchOpen: Boolean;

Checks if money pouch is open.

Note

by Home

ToggleMoneyPouch

ToggleMoneyPouch(Open: Boolean): Boolean;

Opens the money pouch if closed.

Note

by Home

GetMoneyPouchAmount

function GetMoneyPouchAmount: LongInt;

Returns amount of coins in pouch.

Note

by Home & Richard

Example:

amt := GetMoneyPouchAmount();

DepositToPouch

function DepositToPouch :Boolean;

Deposit’s coins to pouch.

Note

by Home

toolBeltScreen

function toolBeltScreen : Boolean;

Returns True if the Tool Belt screen is open

Note

by Kyle Undefined

Example:

itemSlotFilled

function itemSlotFilled : Boolean;

Returns True if the current tool slot is filled

Note

by Kyle Undefined

Example:

openToolBelt

procedure toolBeltScreen;

Opens the Tool Belt

Note

by Kyle Undefined, edited by riwu.

Example:

setCategory

procedure setCategory(Category : string);

Sets the category of items to be shown

Note

by Kyle Undefined

Example:

checkToolBeltFor

function checkToolBeltFor(Category, Tool : string) : Boolean;

Returns True if the tool is in Tool Belt for the appropriate category

Note

by Kyle Undefined

Example:

GetMusic

function GetMusic: string;

Gets the music that’s currently playing.

Note

by Nielsie95 and ZephyrsFury

Example:

CloseAllScreens

function CloseAllScreens: boolean;

Close BankScreen, DepositScreen, ShopScreen, ToolBeltScreen and the PinScreen. Returns true if any of them is closed.

Note

by Tickyy

Example:

CloseAllScreens();