AeroLib scripting
Interacting with your in-game interface
As an attempt to better familiarize scripters with AeroLib I've decided to write a few tutorials outlining some of the basics needed to write scripts. Throughout the tutorials I'm going to assume you have at least basic experience working with Simba already. Before we begin I would recommend you read my tutorial about AeroLib Core functionality for a more complete understanding of the very basics of the include as we'll be using this knowledge and putting the code to work. Also, this tutorial will not feature all of the available functions & procedures in each of the given fields, only what I consider the most vital and convenient for scripting. If you'd like to see the full cache of what's available, I invite you to simply explore AeroLib for yourself.
Basically everything excluding the mainscreen. This pretty much pertains to gathering information about your player; your items, levels and so on. So starting with the very beginning of the tutorial, let's take a look at handling game tabs.
Part 1: Code references
GameTabs
AeroLib/core/gametabs/
getCurrentTab()
- Gets the currently opened gametab
- Possible results are: TAB_COMBAT, TAB_STATS, TAB_QUEST, TAB_INV, TAB_EQUIP, TAB_PRAYER, TAB_MAGIC, TAB_FRIENDS, TAB_IGNORE, TAB_LOGOUT, TAB_OPTIONS, TAB_EMOTES, TAB_MUSIC
gameTab(Tab: Integer)
- Switches to the desired game tab via moving the mouse & clicking.
- Will result in True if successfully switched, False if not successful
FTab(Tab: Integer)
- Same as gameTab however F-buttons are used to switch to the desired gametab.
Inventory
AeroLib/core/gametabs/Inventory.simba
invBox(I: Integer)
- Results in a TBox of the inventory slot I
itemInSlot(I: Integer)
- Results True if an item exists in the inventory slot I, False if the slot is empty
- If you've the deposit box screen opened, the function will check if the given slot in the deposit box is currently occupied
getInvCount()
- Gives you the current number of items in your inventory
isInvFull() / isInvEmpty()
- Result True if the inventory is full/empty (respectively), False if not.
getItemAmount(Pnt: TPoint)
- Returns the amount of the item at the given point (not slot)
- Only works for an item in a single slot
interactSlot(Slot: Integer; action: Variant; miss: Boolean=False)
- Moves the mouse to Slot and initiates an action. This could be left/right clicking the item (MOUSE_LEFT/MOUSE_RIGHT) or right-click and selecting an option (ex: 'Drop')
fastDropSlots(Slots: TIntegerArray)
- Quickly drop an array of items within Slots using the shift-click drop method (this must be enabled in your game settings!)
moveItemTo(Slot, targetSlot: Integer)
- Drag an item from Slot to the targetSlot
dragItemToPoint(Slot: Integer; Point: TPoint)
- Same as moveItemTo but drags the item in Slot to a given point, in the parameter Point
slotActivated(Slot: Integer)
- Returns True if the item in Slot is activated (highlighted by selecting "Use"), False if not
anySlotActivated()
- Returns True if any inventory slot is currently activated, False if not
waitInvChange(MaxTime: Integer)
- Waits a given time (MaxTime) for the inventory count to change, whether an item is added or removed
Combat
AeroLib/core/gametabs/Misc.simba
getCombatLevel() (Located in AeroLib/core/gametabs/Skills.simba
- Returns your combat level
setFightMode(Mode: Integer)
- Switch your player's fight mode (1-4)
getSpecialPercent()
- Returns the percent of special special power you have left, if any
enableSpecialAttack(SwitchBack: Boolean=false)
- Initiates a special attack. If SwitchBack is set to True, the script will return to your previous game tab
setRetaliate(Enable: Boolean)
- Enables or disables your auto-retaliate setting
Skills
AeroLib/core/gametabs/Skills.simba
getSkillCurrentLevel(Skill: Variant) / getSkillMaxLevel(Skill: Variant)
- Returns your current or max skill level for Skill. Valid Skill parameters are SKILL_ATTACK through SKILL_FARMING or 'attack' through 'farming'
getTotalLevel()
- Returns your skill total level
getSkillXP(skill: variant)
- Returns the XP you have in skill. Valid Skill parameters are SKILL_ATTACK through SKILL_FARMING or 'attack' through 'farming'
Prayer
AeroLib/core/gametabs/Prayer.simba
isPrayerActive(PrayerName: String)
- Returns True if the prayer PrayerName is active, False if not. A valid PrayerName parameter must be the exact name of the prayer, capitalized. Ex: isPrayerActive('Rapid Heal')
togglePrayer(PrayerName: string; Enable: Boolean)
- Toggles the prayer PrayerName on or off via the parameter Enable
Magic
AeroLib/core/gametabs/Magic.simba
isSpellSelected
- Returns True if any spell is currently selected, False if none
isSpellActive(SpellName:String)
- Returns True if the spell SpellName is able to be cast (Ex: The player has sufficient runes for the given spell), False if the spell is grayed out
castSpell(SpellName: String)
- Left-clicks on the given spell SpellName if the spell is active. Result True if successful, False if not (Ex: Wrong spell book or grayed out spell icon)
Logout / WorldSwitcher
AeroLib/entities/player/Login.simba
AeroLib/core/gametabs/WorldSwitcher.simba
logoutPlayer()
- Logs out the player, even if the world-switcher is currently open
WS_toggle(Open: Boolean = True)
- Toggles the world-switcher. If Open is set to true, the world-switcher will be opened, if set to False it will be closed
WS_switchWorlds(World: Integer)
- Hops to the world labeled as World. Results in True if successful, False if unsuccessful
WS_switchRandomWorld()
- Switches worlds to a random world based off your player's member status
Settings
AeroLib/core/gametabs/Settings.simba
fixGraphics()
- Sets your client settings to the default settings required for most scripts (Max brightness, default camera zoom, 2 mouse buttons, audio disabled, and accept aid disabled)
ChatBox
AeroLib/core/Chat.simba
getDisplayName()
- Returns your display name
clickContinue(DoWait: Boolean)
- Clicks the "Click here to continue" option in the chat box. If DoWait is set to True the script will wait until the message is no longer visible
continueChat(Wait: Boolean = True)
- Same as the above function however the space bar is used as opposed to left-clicking
getChatBoxText(Line, TextCol: Integer)
- Gets the chatbox text on Line with the given color of TextCol
findGameMessageAnyLine(Text: string)
- Returns True if the message Text is found in any chat box line. This function only search for game message (black text)
findBlackChatMessage(ChatMsg: string)
- Returns True if a black chat message is found anywhere in the chat box, False if not
findMSChat()
- Returns True if chat text (yellow text) is found in the mainscreen, False if not
areTalking()
- Returns True if you're currently talk with a NPC, False if not
chatOptionScreen()
- Returns True if chat options screen is open, False if not
findChatOption(Text: string; Click: Boolean)
- Returns True if the chat option Text is found in the chat box, False if not. Also the option will be left-clicked if Click is set to True
doConversation(resultText: TStringArray)
- This will continually continue a chat conversation with an NPC until the chat option(s) resultText is(are) found. If True then the specified chat option will be left-clicked
Orbs
AeroLib/core/minimap/Orbs.simba
clickNorth(RightClick: Boolean=False)
- Left-clicks the compass near the minimap to reset your camera angle to perfect north
toggleXPBar(Enable: Boolean; DoWait: Boolean=False)
- Enables the XP bar if Enable is set to True, disables if set to False
getHealthPercent() / getPrayerPercent()
- Returns your current health percent / prayer percent
getCurrentHealth() / getPrayerPoints()
- Returns your current amount of hitpoints / prayer points
getRunEnergy()
- Returns your current amount of run energy
toggleRunning(Enable: Boolean)
- Enables running if Enable is set to True, disables if set to False
toggleQP(Enable: Boolean)
- Enables quick-prayers if Enable is set to True, disables if set to False
Minimap
AeroLib/core/minimap/Minimap.simba
AeroLib/core/minimap/Mapwalk.simba
AeroLib/core/minimap/Symbol.simba
getCompassAngle()
- Returns your current compass angle
setCompass(Direction: Variant)
- Sets your angle to Direction. This parameter accepts an integer as the angle or the abbreviated letter for the desired direction (Ex: 'N' for North)
setAngle(Angle: Integer)
- Sets your camera angle (pitch) to either highest or lowest by setting Angle to either ANGLE_HIGH or ANGLE_LOW
flagDistance()
- Returns the distance between you and the flag on the minimap, if present
FFlag(Dist: Integer)
- Waits until your player is within distance Dist of the minimap flag
getClosestDot(WhatDot: String)
- Returns a TPoint of the nearest minimap dot WhatDot to your player. This parameter accepts: 'player', 'npc', 'item', 'friend', 'team'
percentBlackMM()
- Returns the percent of the minimap which is black
isPlayerWalking()
- Returns True if the player is currently walking, False if standing still
foundSymbol(Name: string)
- Returns True if the given symbol Name is found on the minimap, False if not. For a full list of all accepted symbol names, please refer to AeroLib/core/minimap/Symbol.simba
findSymbol(var Pnt: TPoint; Name: string)
- Same as the above function however this will give you the point of nearest found symbol, retrieved as the variable Pnt
MMtoMS(MM: TPoint)
- Converts the minimap point MM to a point on point on the mainscreen. The result is the mainscreen point