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

NewsItemWithDOM

NewsItemWithDOM: NewsItem & { dom: Document }

PollWithDOM

PollWithDOM: Poll & { dom: Document }

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: keyof typeof hiscoreURLs[] = ['normal','ironman','ultimate','hardcore','deadman','seasonal','tournament','skiller','skiller_defence']

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: ["all", "beginner", "easy", "medium", "hard", "elite", "master"] = ['all', 'beginner', 'easy', 'medium', 'hard', 'elite', 'master'] as const

Const EMPTY_BIRD_NEST_ID

EMPTY_BIRD_NEST_ID: 5075 = 5075

Const MINIGAMES

MINIGAMES: ["bountyHunter", "bountyHunterRogue", "LMS", "pvpArena", "soulWars", "riftsClosed"] = ['bountyHunter', 'bountyHunterRogue', 'LMS', 'pvpArena', 'soulWars', 'riftsClosed'] as const

Const OSRS_BOX_BASE_URL

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

Const SKILLS

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

Const USELESS_ITEMS

USELESS_ITEMS: number[] = [617, 8890, 6964, 2513, 19_492, 11_071, 11_068, 21_284, 24_735, 21_913, 4703, 4561, 2425, 4692, 3741,// Pharaoh's sceptres9045, 9046, 9047, 9048, 9049, 9050, 9051, 13_074, 13_075, 13_076, 13_077, 13_078, 16_176, 21_445, 21_446, 26_948,26_950, 26_945]

Const bossNameMap

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

Const frozenErrorStr

frozenErrorStr: "Tried to mutate a frozen Bank." = "Tried to mutate a frozen Bank."

Const hiscoreURLs

hiscoreURLs: { deadman: string; hardcore: string; ironman: string; normal: string; seasonal: string; skiller: string; skiller_defence: string; tournament: string; ultimate: string } = {normal: hiscoreURL('hiscore_oldschool'),ironman: hiscoreURL('hiscore_oldschool_ironman'),ultimate: hiscoreURL('hiscore_oldschool_ultimate'),hardcore: hiscoreURL('hiscore_oldschool_hardcore_ironman'),deadman: hiscoreURL('hiscore_oldschool_deadman'),seasonal: hiscoreURL('hiscore_oldschool_seasonal'),tournament: hiscoreURL('hiscore_oldschool_tournament'),skiller: hiscoreURL('hiscore_oldschool_skiller'),skiller_defence: hiscoreURL('hiscore_oldschool_skiller_defence')} as const

Type declaration

  • deadman: string
  • hardcore: string
  • ironman: string
  • normal: string
  • seasonal: string
  • skiller: string
  • skiller_defence: string
  • tournament: string
  • ultimate: string

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: [keyof BossRecords, 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'],['nex', 'Nex'],['nightmare', 'The Nightmare'],['phosanisNightmare', "Phosani's Nightmare"],['obor', 'Obor'],['phantomMuspah', 'Phantom Muspah'],['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'],['tombsofAmascut', 'Tombs of Amascut'],['tombsofAmascutExpert', 'Tombs of Amascut: Expert Mode'],['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: NewsItemWithDOM[] = _newsArchive as NewsItemWithDOM[]

Const pollArchive

pollArchive: PollWithDOM[] = _pollArchive as PollWithDOM[]

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

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

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

fasterResolveBank

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, undefined | 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

randomVariation

  • randomVariation(value: number, percentage: number): number
  • Adds random variation to a number. For example, if you pass 10%, it can at most lower the value by 10%, or increase it by 10%, and everything in between.

    Parameters

    • value: number

      The value to add variation too.

    • percentage: number

      The max percentage to fluctuate the value by, in both negative/positive.

    Returns number

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, accountType: keyof typeof hiscoreURLs): Player

round

  • round(number: number): string

toKMB

  • toKMB(number: number): string

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: "normal" = "normal"

virtualLevels

virtualLevels: false = false