Options
All
  • Public
  • Public/Protected
  • All
Menu

oldschooljs

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

ChestSize

ChestSize: "big" | "small"

CustomKillLogic

CustomKillLogic: (options: MonsterKillOptions, currentLoot: Bank) => void

Type declaration

ItemID

ItemID: number

ItemResolvable

ItemResolvable: number | string

RevTableItem

RevTableItem: [number, number]

SeedTier

SeedTier: "1" | "2" | "3" | "4" | "5"

TupleLootItem

TupleLootItem: [number, number]

WorldLocation

WorldLocation: "Australia" | "United Kingdom" | "Germany" | "United States"

Variables

Const ACCOUNT_TYPES

ACCOUNT_TYPES: string[] = ['normal','ironman','ultimate','hardcore','deadman','seasonal','tournament']

Const BASE_API_URL

BASE_API_URL: "https://services.runescape.com" = "https://services.runescape.com"

Const BASE_URL

BASE_URL: "https://secure.runescape.com/m=news/archive?oldschool=1" = `https://secure.runescape.com/m=news/archive?oldschool=1`

Const CLUES

CLUES: string[] = ['all', 'beginner', 'easy', 'medium', 'hard', 'elite', 'master']

Const EMPTY_BIRD_NEST_ID

EMPTY_BIRD_NEST_ID: 5075 = 5075

Const MINIGAMES

MINIGAMES: string[] = ['bountyHunter', 'bountyHunterRogue', 'LMS', 'soulWars']

Const OSRS_BOX_BASE_URL

OSRS_BOX_BASE_URL: "https://www.osrsbox.com/osrsbox-db" = `https://www.osrsbox.com/osrsbox-db`

Const SKILLS

SKILLS: string[] = ['overall','attack','defence','strength','hitpoints','ranged','prayer','magic','cooking','woodcutting','fletching','fishing','firemaking','crafting','smithing','mining','herblore','agility','thieving','slayer','farming','runecraft','hunter','construction']

Const USELESS_ITEMS

USELESS_ITEMS: number[] = [617,8890,6964,2513,19492,11071,11068,21284,24735,21913,4703,4561,2425,4692]

Const bossNameMap

bossNameMap: Map<string, string> = new Map(mappedBossNames)

Const itemNameMap

itemNameMap: Map<string, number> = new Map()

Const items

items: Record<string, Item> = _items as Record<string, Item>

Const itemsExport

itemsExport: Items = new Items()

Const mappedBossNames

mappedBossNames: [string, string][] = [['abyssalSire', 'Abyssal Sire'],['alchemicalHydra', 'Alchemical Hydra'],['barrowsChests', 'Barrows Chests'],['bryophyta', 'Bryophyta'],['callisto', 'Callisto'],['cerberus', 'Cerberus'],['chambersofXeric', 'Chambers of Xeric'],['chambersofXericChallengeMode', 'Chambers of Xeric: Challenge Mode'],['chaosElemental', 'Chaos Elemental'],['chaosFanatic', 'Chaos Fanatic'],['commanderZilyana', 'Commander Zilyana'],['corporealBeast', 'Corporeal Beast'],['crazyArchaeologist', 'Crazy Archaeologist'],['dagannothPrime', 'Dagannoth Prime'],['dagannothRex', 'Dagannoth Rex'],['dagannothSupreme', 'Dagannoth Supreme'],['derangedArchaeologist', 'Deranged Archaeologist'],['generalGraardor', 'General Graardor'],['giantMole', 'Giant Mole'],['grotesqueGuardians', 'Grotesque Guardians'],['hespori', 'Hespori'],['kalphiteQueen', 'Kalphite Queen'],['kingBlackDragon', 'King Black Dragon'],['kraken', 'Kraken'],['kreeArra', "Kree'Arra"],['krilTsutsaroth', "K'ril Tsutsaroth"],['mimic', 'Mimic'],['nightmare', 'The Nightmare'],['phosanisNightmare', "Phosani's Nightmare"],['obor', 'Obor'],['sarachnis', 'Sarachnis'],['scorpia', 'Scorpia'],['skotizo', 'Skotizo'],['tempoross', 'Tempoross'],['theGauntlet', 'The Gauntlet'],['theCorruptedGauntlet', 'The Corrupted Gauntlet'],['theatreofBlood', 'Theatre of Blood'],['theatreofBloodHard', 'Theatre of Blood: Hard Mode'],['thermonuclearSmokeDevil', 'Thermonuclear Smoke Devil'],['tzKalZuk', 'TzKal-Zuk'],['tzTokJad', 'TzTok-Jad'],['venenatis', 'Venenatis'],['vetion', "Vet'ion"],['vorkath', 'Vorkath'],['wintertodt', 'Wintertodt'],['zalcano', 'Zalcano'],['zulrah', 'Zulrah']]

Const monsterData

monsterData: {} = rawMonsterData as { [key: string]: MonsterData }

Type declaration

Const news

news: News = new News()

Const newsArchive

newsArchive: NewsItem[] = _newsArchive as NewsItem[]

Const pollArchive

pollArchive: Poll[] = _pollArchive as Poll[]

Const polls

polls: Polls = new Polls()

Const revsUniqueTable

revsUniqueTable: LootTable = new LootTable().add('Amulet of avarice', 1, 2).add("Craw's bow (u)", 1, 1).add("Thammaron's sceptre (u)", 1, 1).add("Viggora's chainmace (u)", 1, 1)

Functions

JSONClone

  • JSONClone<O>(object: O): O

addArrayOfNumbers

  • addArrayOfNumbers(arr: number[]): number

addArrayToBank

  • Adds an array of items in a bank

    Parameters

    • bank: ItemBank

      A NumberKeyed bank to add items to

    • items: number[]

      An array of item IDs

    Returns ItemBank

addBanks

addItemToBank

  • Adds an item to a bank

    Parameters

    • bank: ItemBank

      A NumberKeyed bank to add items in

    • itemID: number

      The item ID to add

    • Default value amountToAdd: number = 1

      Quantity of items to be added. Defaults to 1

    Returns ItemBank

bankFromLootTableOutput

bankHasAllItemsFromBank

  • Checks if a bank includes all the items from another bank

    Parameters

    Returns boolean

bankHasItem

  • bankHasItem(itemBank: ItemBank, itemID: number, quantity?: number): boolean
  • Checks if a bank includes an amount or more of an item

    Parameters

    • itemBank: ItemBank

      A NumberKeyed bank

    • itemID: number

      The item ID to check for

    • Default value quantity: number = 1

      The quantity of items the bank should have. Defaults to 1

    Returns boolean

cleanString

  • cleanString(str: string): string
  • Removes all whitespace, and uppercases it. Used for comparisons.

    Parameters

    • str: string

      The string to clean.

    Returns string

convertLVLtoXP

  • convertLVLtoXP(lvl: number): number

convertLootBanksToItemBanks

convertXPtoLVL

  • convertXPtoLVL(xp: number, cap?: number): number
  • Parameters

    • xp: number
    • Default value cap: number = 99

    Returns number

fromKMB

  • fromKMB(number: string): number

getAncientShardChanceFromHP

  • getAncientShardChanceFromHP(hitpoints: number): number

getBrimKeyChanceFromCBLevel

  • getBrimKeyChanceFromCBLevel(combatLevel: number): number

getDate

getDom

  • getDom(link: string): Promise<DOMWindow>
  • Gets a DOM for a page.

    Parameters

    • link: string

      The page to fetch a DOM for.

    Returns Promise<DOMWindow>

getTotemChanceFromHP

  • getTotemChanceFromHP(hitpoints: number): number

hiscoreURL

  • hiscoreURL(type: string): string

isArrayOfItemTuples

  • isArrayOfItemTuples(x: readonly unknown[]): x is [string, number | number[]][]

isValidUsername

  • isValidUsername(username: string): boolean
  • Determines whether a string is a valid RuneScape username.

    Parameters

    • username: string

      The username to check.

    Returns boolean

itemID

  • itemID(name: string): number

makeRevTable

multiplyBank

  • Multiplies a bank's contents by the times specified

    Parameters

    • bank: ItemBank

      A NumberKeyed bank whose contents will be multiplied

    • times: number

      How many times should the contents be multiplied

    Returns ItemBank

numItemsBankHasInBank

removeBankFromBank

removeItemFromBank

  • removeItemFromBank(bank: ItemBank, itemID: number, amountToRemove?: number): ItemBank
  • Removes an item or a quantity of items from a bank

    Parameters

    • bank: ItemBank

      A NumberKeyed bank to remove from

    • itemID: number

      The item ID to remove

    • Default value amountToRemove: number = 1

      The quantity to remove. Defaults to 1

    Returns ItemBank

resolveBank

  • resolveBank(bank: Record<string, number>): ItemBank
  • Resolves a bank which uses item names or item IDs.

    Parameters

    • bank: Record<string, number>

      A bank to resolve

    Returns ItemBank

resolveNameBank

  • resolveNameBank<T>(nameBank: Record<string, T>): Record<string, T>
  • Transforms a string-based bank to an ID-based bank

    Type parameters

    • T

    Parameters

    • nameBank: Record<string, T>

      A string-based bank to convert

    Returns Record<string, T>

resolvePlayerFromHiscores

  • resolvePlayerFromHiscores(csvData: string): Player

round

  • round(number: number): string

toKMB

  • toKMB(number: number): string

weirdItemFilter

  • weirdItemFilter(item: Item): boolean

Object literals

Const ErrorDescriptions

ErrorDescriptions: object

ACCOUNT_NOT_FOUND

ACCOUNT_NOT_FOUND: string = "Could not find a RuneScape account with the provided username."

FAILED_REQUEST

FAILED_REQUEST: string = "A request to an API/External resource failed unexpectedly."

INVALID_ACCOUNT_TYPE

INVALID_ACCOUNT_TYPE: string = "A invalid account type (normal, ironman, etc) was passed."

INVALID_USERNAME

INVALID_USERNAME: string = "A malformed, invalid or incorrect username was passed and rejected."

ITEM_NOT_FOUND

ITEM_NOT_FOUND: string = "No item with the provided ID/Name could be found."

Const defaultGetOptions

defaultGetOptions: object

type

type: string = "normal"

virtualLevels

virtualLevels: boolean = false

Const hiscoreURLs

hiscoreURLs: object

deadman

deadman: string = hiscoreURL('hiscore_oldschool_deadman')

hardcore

hardcore: string = hiscoreURL('hiscore_oldschool_hardcore_ironman')

ironman

ironman: string = hiscoreURL('hiscore_oldschool_ironman')

normal

normal: string = hiscoreURL('hiscore_oldschool')

seasonal

seasonal: string = hiscoreURL('hiscore_oldschool_seasonal')

tournament

tournament: string = hiscoreURL('hiscore_oldschool_tournament')

ultimate

ultimate: string = hiscoreURL('hiscore_oldschool_ultimate')