Powers Screen

The PowersScreen file holds functions and procedures that are used in the runescape powers screen.

The source for this file can be found here.

Consts, Types, Vars

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

const Main Tabs and Sub Tabs

Constants that represent the Main Tabs and Sub Tabs of the powersScreen.

Main Tabs:
  • POWERS_TAB_MELEE
  • POWERS_TAB_RANGED
  • POWERS_TAB_MAGIC
  • POWERS_TAB_DEFENSIVE
  • POWERS_TAB_PRAYERS
  • POWERS_TAB_SETTINGS
Sub Tabs:
  • SUB_TAB_ATTACK
  • SUB_TAB_STRENGTH
  • SUB_TAB_RANGED
  • SUB_TAB_ABILITIES
  • SUB_TAB_COMBAT_SPELLS
  • SUB_TAB_TELEPORT_SPELLS
  • SUB_TAB_SKILLING_SPELLS
  • SUB_TAB_DEFENCE
  • SUB_TAB_CONSTITUTION

const Combat Modes, Combat Styles and Experience Types

Constants that represent different Combat Modes, Styles and Experience Types.

Combat Modes:
  • MODE_MANUAL
  • MODE_REVOLUTION
  • MODE_MOMENTUM
Combat Styles:
  • MELEE_STYLE
  • RANGED_STYLE
  • MAGIC_STYLE
Experience Types:
  • XP_BALANCED
  • XP_RANGED_AND_DEFENCE
  • XP_MAGIC_AND_DEFENCE
  • XP_ATTACK
  • XP_STRENGTH
  • XP_RANGED
  • XP_MAGIC
  • XP_DEFENCE

const Abilities and Spells

Constants that represent the location of each ability or spell within the powersScreen.

Attack Abilities:
  • PS_SLAUGHTER
  • PS_SLICE
  • PS_OVERPOWER
  • PS_HAVOC
  • PS_BACKHAND
  • PS_FORCEFUL_BACKHAND
  • PS_SMASH
  • PS_BARGE
  • PS_FLURRY
  • PS_SEVER
  • PS_HURRICANE
  • PS_MASSACRE
  • PS_METEOR_STRIKE
  • PS_BALANCED_STRIKE
Strength Abilities:
  • PS_STOMP
  • PS_KICK
  • PS_PUNISH
  • PS_DISMEMBER
  • PS_FURY
  • PS_DESTROY
  • PS_QUAKE
  • PS_BERSERK
  • PS_CLEAVE
  • PS_ASSAULT
  • PS_DECIMATE
  • PS_PULVERISE
  • PS_FRENZY
Ranged Abilities:
  • PS_PIERCING_SHOT
  • PS_SNAP_SHOT
  • PS_DEADSHOT
  • PS_SNIPE
  • PS_DAZING_SHOT
  • PS_BINDING_SHOT
  • PS_NEEDLE_STRIKE
  • PS_TIGHT_BINDINGS
  • PS_FRAGMENTATION_SHOT
  • PS_ESCAPE
  • PS_RAPID_FIRE
  • PS_RICOCHET
  • PS_BOMBARDMENT
  • PS_INCENDIARY_SHOT
  • PS_UNLOAD
  • PS_DEATHS_SWIFTNESS
Magic Abilities:
  • PS_ASPHYXIATE
  • PS_WRACK
  • PS_OMNIPOWER
  • PS_DRAGON_BREATH
  • PS_SONIC_WAVE
  • PS_IMPACT
  • PS_CONCENTRATED_BLAST
  • PS_DEEP_IMPACT
  • PS_COMBUST
  • PS_SURGE
  • PS_DETONATE
  • PS_CHAIN
  • PS_WILD_MAGIC
  • PS_METAMORPHOSIS
  • PS_TSUNAMI
  • PS_SUNSHINE
Magic Combat Spells:
  • PS_AIR_STRIKE
  • PS_CONFUSE
  • PS_WATER_STRIKE
  • PS_EARTH_STRIKE
  • PS_WEAKEN
  • PS_FIRE_STRIKE
  • PS_AIR_BOLT
  • PS_CURSE
  • PS_BIND
  • PS_WATER_BOLT
  • PS_EARTH_BOLT
  • PS_FIRE_BOLT
  • PS_AIR_BLAST
  • PS_WATER_BLAST
  • PS_SNARE
  • PS_SLAYER_DART
  • PS_EARTH_BLAST
  • PS_FIRE_BLAST
  • PS_DIVINE_STORM
  • PS_AIR_WAVE
  • PS_WATER_WAVE
  • PS_VULNERABILITY
  • PS_EARTH_WAVE
  • PS_ENFEEBLE
  • PS_FIRE_WAVE
  • PS_STORM_OF_ARMADYL
  • PS_ENTANGLE
  • PS_POLYPORE_STRIKE
  • PS_STAGGER
  • PS_AIR_SURGE
  • PS_WATER_SURGE
  • PS_TELEPORT_BLOCK
  • PS_EARTH_SURGE
  • PS_FIRE_SURGE
Magic Teleport Spells:
  • PS_HOME_TELEPORT
  • PS_MOBILISING_ARMIES_TELEPORT
  • PS_VARROCK_TELEPORT
  • PS_LUMBRIDGE_TELEPORT
  • PS_FALADOR_TELEPORT
  • PS_HOUSE_TELEPORT
  • PS_CAMELOT_TELEPORT
  • PS_ARDOUGNE_TELEPORT
  • PS_WATCHTOWER_TELEPORT
  • PS_GOD_WARS_DUNGEON_TELEPORT
  • PS_TROLLHEIM_TELEPORT
  • PS_APE_ATOLL_TELEPORT
  • PS_TELE_OTHER_LUMBRIDGE
  • PS_TELE_OTHER_FALADOR
  • PS_TELE_OTHER_CAMELOT
Magic Skilling Spells:
  • PS_ENCHANT_CROSSBOW_BOLT
  • PS_LVL_1_ENCHANT
  • PS_BONES_TO_BANANAS
  • PS_LOW_LEVEL_ALCHEMY
  • PS_LVL_2_ENCHANT
  • PS_TELEKINETIC_GRAB
  • PS_SUPERHEAT_ITEM
  • PS_LVL_3_ENCHANT
  • PS_HIGH_LEVEL_ALCHEMY
  • PS_CHARGE_WATER_ORB
  • PS_LVL_4_ENCHANT
  • PS_BONES_TO_PEACHES
  • PS_CHARGE_EARTH_ORB
  • PS_CHARGE_FIRE_ORB
  • PS_CHARGE_AIR_ORB
  • PS_LVL_5_ENCHANT
  • PS_LVL_6_ENCHANT
Defensive Abilities:
  • PS_ANTICIPATION
  • PS_BASH
  • PS_REVENGE
  • PS_PROVOKE
  • PS_IMMORTALITY
  • PS_FREEDOM
  • PS_REFLECT
  • PS_RESONANCE
  • PS_REJUVENATE
  • PS_DEBILITATE
  • PS_PREPARATION
  • PS_BARRICADE
Constitution Abilities:
  • PS_WEAPON_SPECIAL_ATTACK
  • PS_REGENERATE
  • PS_SIPHON
  • PS_INCITE

type TRSPowersScreen

type
  TRSPowersScreen = type TRSInterface;

A type that stores the powersScreen interface properties.

var powersScreen

var
  powersScreen: TRSPowersScreen;

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

TRSPowersScreen methods

The following methods should be called through the powersScreen variable.

Example:

if powersScreen.isOpen() then
  writeln('Powers screen is open!');

isOpen

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

Returns true if the powersScreen interface is open. The optional waitTime parameter (default = 0) is the maximum time (in milliseconds) it will keep looking.

Note

  • by Olly
  • Last Updated: 17 July 2015 by The Mayor

Example:

if powersScreen.isOpen() then
  writeln('The Powers screen is open!');

open

function TRSPowersScreen.open(waitTime: integer = 3000): boolean;

Returns true if the powersScreen is successfully opened. The optional waitTime parameter (default = 3000) is the maximum time (in milliseconds) it will keep looking.

Note

  • by The Mayor
  • Last Updated: 6 July 2014 by The Mayor

Example:

if powersScreen.open() then
  writeln('We opened the powers screen');

close

function TRSPowersScreen.close(): boolean;

Returns true if the powersScreen is successfully closed.

Note

  • by The Mayor
  • Last Updated: 30 January 2014 by The Mayor

Example:

if powersScreen.close() then
  writeln('We just closed the powersScreen');

openTab

function TRSPowersScreen.openTab(tab: integer): boolean;

Returns true if it successfully opens the Main Tab tab . Main Tab constants are found at the top of this page.

Note

  • by The Mayor
  • Last Updated: 17 July 2015 by The Mayor

Example:

powersScreen.openTab(POWERS_TAB_MELEE);

getAbilitySlotBox

function TRSPowersScreen.getAbilitySlotBox(slot: integer): TBox;

Returns the TBox around the ability slot slot . Slots start at 0 in the top left corner, and cound across the row.

Note

  • by Olly
  • Last Updated: 30 January 2014 by The Mayor

Example:

box := powersScreen.getAbilitySlotBox(10);

end;

openSubTab

function TRSPowersScreen.openSubTab(subTab: integer): boolean;

Returns true if it successfully opens the Sub Tab subTab . Sub Tab constants are found at the top of this page.

Note

  • by The Mayor
  • Last Updated: 30 January 2014 by The Mayor

Example:

powersScreen.openSubTab(SUB_TAB_COMBAT_SPELLS);

getActionBarSlotBoxes

function TRSPowersScreen.getActionBarSlotBoxes(): TBoxArray;

Returns a TBoxArray of all of the action bar slot boxes.

Note

  • by Olly
  • Last Updated: 6 July 2014 by The Mayor

Example:

boxArr := powersScreen.getActionBarSlotBoxes();

getActionBarSlot

function TRSPowersScreen.getActionBarSlot(slot: integer): TBox;

Returns the TBox of the actionBar slot slot

Note

  • by Olly
  • Last Updated: 6 July 2014 by The Mayor

Example:

box := powersScreen.getActionBarSlot(1);

isActionBarSlotEmpty

function TRSPowersScreen.isActionBarSlotEmpty(slot: integer): boolean;

Returns true the Action bar slot slot is empty.

Note

  • by euphemism
  • Last Updated: 6 July 2014 by The Mayor

Example:

if powersScreen.isActionBarSlotEmpty(1) then
  writeLn('There is no ability in slot 1');

isActionBarEmpty

function TRSPowersScreen.isActionBarEmpty(): boolean;

Returns true if the action bar is empty.

Note

  • by The Mayor
  • Last Updated: 30 January 2014 by The Mayor

Example:

if powersScreen.isActionBarEmpty() then
  writeLn('There are no abilities on the Action bar');

clearActionBar

function TRSPowersScreen.clearActionBar(): boolean;

Returns true if it clears all the abilities from the action bar.

Note

  • by The Mayor
  • Last Updated: 6th July 2014 by The Mayor

Example:

if powersScreen.clearActionBar() then
  writeLn('There are no longer abilities on the action bar');

clearActionBarSlot

function TRSPowersScreen.clearActionBarSlot(slot: integer): boolean;

Returns true if it clears an ability from the action bar slot slot . It will attempt up to 3 times to drag the ability to the trash can.

Note

  • by The Mayor
  • Last Updated: 30 January 2014 by The Mayor

Example:

if powersScreen.clearActionBarSlot(1) then
  writeLn('There is no longer an ability in slot 1');

addAbilityToActionBar

function TRSPowersScreen.addAbilityToActionBar(ability: TIntegerArray; slot: integer): boolean;

Returns true if it successfully drags the ability or spell ability to the action bar slot slot . If an ability already exists in the slot, it will clear the slot first. It will attempt up to 3 times. Ability and Spell constants are located at the top of this page.

Note

  • by The Mayor
  • Last Updated: 30 January 2014 by The Mayor

Example:

if powersScreen.addAbilityToActionBar(PS_SLICE, 3) then
  writeLn('We put the slice ability in actionbar slot 3');

getCombatExperience

function TRSPowersScreen.getCombatExperience(combatStyles: integer): integer;

Returns the integer of the currently selected Experience Type for the Combat Style ** conbatStyle** . For example, getCombatExperience(MELEE_STYLE) might return balanced xp (1) or defence xp (4). The Combat Style constants are found at the top of this page.

Note

  • by The Mayor
  • Last Updated: 4th April 2014 by The Mayor

Example:

currentMeleeXPType := powersScreen.getCombatExperience(STYLE_MELEE);

setCombatExperience

function TRSPowersScreen.setCombatExperience(combatStyle, experienceType): boolean;

Sets the Experience Type experienceType for the Combat Style combatStyle. Combat Style constants and Experience Type constants are located at the top of this page.

Note

  • by The Mayor
  • Last Updated: 4th April 2014 by The Mayor

Example:

// Setting the melee combat style to balanced XP
powersScreen.setCombatExperience(MELEE_STYLE, XP_BALANCED);

// Setting the ranged combat style to defence XP
powersScreen.setCombatExperience(RANGED_STYLE, XP_DEFENCE);

// Setting the magic combat style to magic and defence XP
powersScreen.setCombatExperience(MAGIC_STYLE, XP_MAGIC_AND_DEFENCE);

getCombatMode

function TRSPowersScreen.getCombatMode(): integer;

Returns the integer of currently selected Combat Mode. For example, it could return MODE_REVOLUTION (1) or MODE_MOMENTUM (4).

Note

  • by The Mayor
  • Last Updated: 4th April 2014 by The Mayor

Example:

if powersScreen.getCombatMode() = 3 then
  writeLn('We are using the Momentum Combat Mode');

setCombatMode

function TRSPowersScreen.setCombatMode(combatMode): boolean;

Returns true if it successfully sets the players Combat Mode to combatMode. Combat Mode constants are located at the top of this page.

Note

  • by The Mayor
  • Last Updated: 5th July 2014 by The Mayor

Example:

// Setting the players Combat Mode to momentum
powersScreen.setCombatMode(MODE_MOMENTUM);