NAV
lua

Introduction

Welcome to the API documentation for PROShine.

This documentation describes the functions available for use in the Lua scripts.

Please note that functions are case-sensitive in Lua and all the PROShine functions start with a lowercase letter.

Last updated: April 24, 2018

General functions

Log

function log(message)

log("Hello! This is a message.")
log("I have " .. getTeamSize() .. " pokémon in my team.")

Writes the specified message to the message log.

PARAMETERS

Parameter Type Description
message string Message to display

Fatal

function fatal(message)

fatal("You are not on the correct map, stopping the script!")

Writes the specified message to the message log and stops the bot.

PARAMETERS

Parameter Type Description
message string Message to display

Logout

function logout(message)

Displays the specified message to the message log and logs out.

PARAMETERS

Parameter Type Description
message string Message to display

Relog

function relog(delay, message)

Logs out and logs back in after the specified number of seconds.

PARAMETERS

Parameter Type Description
delay number Number of seconds to wait before logging in again
message string Message to display

StringContains

function stringContains(haystack, needle)

Returns true if the haystack contains the specified needle, ignoring the case.

PARAMETERS

Parameter Type Description
haystack string String to analyze
needle string String to search in the haystack

PlaySound

function playSound(file)

Returns playing a custom sound.

PARAMETERS

Parameter Type Description
file string Sound file to play

RegisterHook

function registerHook(eventName, callback)

Calls the specified function when the specified event occurs.

PARAMETERS

Parameter Type Description
eventName string Event that triggers the specified callback function
callback function Function to call when the specified event occurs

Game conditions

GetPlayerX

function getPlayerX()

Returns the X-coordinate of the current cell.

GetPlayerY

function getPlayerY()

Returns the Y-coordinate of the current cell.

GetAccountName

function getAccountName()

Returns current account name.

GetMapName

function getMapName()

Returns the name of the current map.

GetPokedexOwned

function getPokedexOwned()

Returns Owned Entry of the pokedex.

GetPokedexSeen

function getPokedexSeen()

Returns Seen Entry of the pokedex.

GetPokedexEvolved

function getPokedexEvolved()

Returns Evolved Entry of the pokedex.

GetTeamSize

function getTeamSize()

Returns the amount of pokémon in the team.

IsAccountMember

function isAccountMember()

Returns current account’s membership status.

GetPokemonId

function getPokemonId(index)

Returns the pokédex ID of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonName

function getPokemonName(index)

Returns the name of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonHealth

function getPokemonHealth(index)

Returns the current health of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonHealthPercent

function getPokemonHealthPercent(index)

Returns the percentage of remaining health of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonMaxHealth

function getPokemonMaxHealth(index)

Returns the percentage of remaining health of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonLevel

function getPokemonLevel(index)

Returns the level of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonTotalExperience

function getPokemonTotalExperience(index)

Returns the experience total of a pokemon level.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonRemainingExperience

function getPokemonRemainingExperience(index)

Returns the remaining experience of a pokemon before next level.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonStatus

function getPokemonStatus(index)

Returns the status of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonForm

function getPokemonForm(index)

Returns the form of the specified pokémon in the team (0 if no form).

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonHeldItem

function getPokemonHeldItem(index)

Returns the item held by the specified pokemon in the team, null if empty.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonUniqueId

function getPokemonUniqueId(index)

PROShine unique ID of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

IsPokemonShiny

function isPokemonShiny(index)

Returns the shinyness of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonMoveName

function getPokemonMoveName(index, moveId)

Returns the move of the specified pokémon in the team at the specified index.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

GetPokemonMoveAccuracy

function getPokemonMoveAccuracy(index, moveId)

Returns the move accuracy of the specified pokémon in the team at the specified index.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

GetPokemonMovePower

function getPokemonMovePower(index, moveId)

Returns the move power of the specified pokémon in the team at the specified index.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

GetPokemonMoveType

function getPokemonMoveType(index, moveId)

Returns the move type of the specified pokémon in the team at the specified index.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

GetPokemonMoveDamageType

function getPokemonMoveDamageType(index, moveId)

Returns the move damage type of the specified pokémon in the team at the specified index.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

GetPokemonMoveStatus

function getPokemonMoveStatus(index, moveId)

Returns true if the move of the specified pokémon in the team at the specified index can apply a status.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

GetPokemonNature

function getPokemonNature(index)

Nature of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonAbility

function getPokemonAbility(index)

Ability of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonStat

function getPokemonStat(index, statType)

Returns the value for the specified stat of the specified pokémon in the team.

Full name Short Alternative
Health HP
Attack ATK
Defence DEF Defense
SpAttack SPATK
SpDefence SPDEF SpDefense
Speed SPD

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
statType string Name of the stat (case insensitive).

GetPokemonEffortValue

function getPokemonEffortValue(index, statType)

Returns the effort value for the specified stat of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
statType string Name of the stat (case insensitive).

GetPokemonIndividualValue

function getPokemonIndividualValue(index, statType)

Returns the individual value for the specified stat of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).
statType string Name of the stat (case insensitive).

GetPokemonHappiness

function getPokemonHappiness(index)

Returns the happiness of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonRegion

function getPokemonRegion(index)

Returns the region of capture of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonOriginalTrainer

function getPokemonOriginalTrainer(index)

Returns the original trainer of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonGender

function getPokemonGender(index)

Returns the gender of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetPokemonType

function getPokemonType(index)

Returns the type of the specified pokémon in the team as a table of length 2.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetDamageMultiplier

function getDamageMultiplier(attacker, defender)

Returns the multiplier of the damage type between an attacking type and one or two defending types.

PARAMETERS

Parameter Type Description
attacker string Type of the attacking move.
defender string Type(s) of the defending pokémon.

IsPokemonUsable

function isPokemonUsable(index)

Returns true if the specified pokémon is alive and has an offensive attack available.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

GetUsablePokemonCount

function getUsablePokemonCount()

Returns the amount of usable pokémon in the team.

HasMove

function hasMove(pokemonIndex, moveName)

Returns true if the specified pokémon has a move with the specified name.

PARAMETERS

Parameter Type Description
pokemonIndex number Index of the pokémon (1-6).
moveName string Name of the move (case insensitive).

GetActiveBattlers

function getActiveBattlers()

Returns an array of all NPCs that can be challenged on the current map. Format: {"npcName" = {"x" = x, "y" = y}}.

GetActiveDigSpots

function getActiveDigSpots()

Returns an array of all usable Dig Spots on the current map. Format: {index = {"x" = x, "y" = y}}.

GetActiveHeadbuttTrees

function getActiveHeadbuttTrees()

Returns an array of all usable Headbutt trees on the current map. Format: {index = {"x" = x, "y" = y}}.

GetActiveBerryTrees

function getActiveBerryTrees()

Returns an array of all harvestable berry trees on the current map. Format: {index = {"x" = x, "y" = y}}.

GetDiscoverableItems

function getDiscoverableItems()

Returns an array of all discoverable items on the currrent map. Format: {index = {"x" = x, "y" = y}}.

GetNpcData

function getNpcData()

Returns NPC data on current map. Format: { { "x" = x , "y" = y, "type" = type }, {...}, ... }.

GetRemainingPowerPoints

function getRemainingPowerPoints(pokemonIndex, moveName)

Returns the remaining power points of the specified move of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
pokemonIndex number Index of the pokémon (1-6).
moveName string Name of the move (case insensitive).

GetPokemonMaxPowerPoints

function getPokemonMaxPowerPoints(index, moveName)

Max move PP of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
pokemonIndex number Index of the pokémon (1-6).
moveId number Id of the move (1-4).

HasItem

function hasItem(itemName)

Returns true if the specified item is in the inventory.

PARAMETERS

Parameter Type Description
itemName string Name of the item (case insensitive).

GetItemQuantity

function getItemQuantity(itemName)

Returns the quantity of the specified item in the inventory.

PARAMETERS

Parameter Type Description
itemName string Name of the item (case insensitive).

HasItemId

function hasItemId(itemId)

Returns true if the specified item is in the inventory.

PARAMETERS

Parameter Type Description
itemId number ID of the item.

GetItemQuantityID

function getItemQuantityId(itemId)

Returns the quantity of the specified item in the inventory.

PARAMETERS

Parameter Type Description
itemId number ID of the item.

HasPokemonInTeam

function hasPokemonInTeam(pokemonName)

Returns true if the specified pokémon is present in the team.

PARAMETERS

Parameter Type Description
pokemonName string Name of the pokémon (case insensitive).

IsTeamSortedByLevelAscending

function isTeamSortedByLevelAscending()

Returns true if the team is sorted by level in ascending order.

IsTeamSortedByLevelDescending

function isTeamSortedByLevelDescending()

Returns true if the team is sorted by level in descending order.

IsTeamRangeSortedByLevelAscending

function isTeamRangeSortedByLevelAscending(fromIndex, toIndex)

Returns true if the specified part of the team is sorted by level in ascending order.

PARAMETERS

Parameter Type Description
fromIndex number Lower index of the range (1-5).
toIndex number Upper index of the range (2-6).

IsTeamRangeSortedByLevelDescending

function isTeamRangeSortedByLevelDescending(fromIndex, toIndex)

Returns true if the specified part of the team the team is sorted by level in descending order.

PARAMETERS

Parameter Type Description
fromIndex number Lower index of the range (1-5).
toIndex number Upper index of the range (2-6).

IsNpcVisible

function isNpcVisible(npcName)

Returns true if there is a visible NPC with the specified name on the map.

If the NPC is a pokémon, its name is the character # followed by the pokédex ID.

PARAMETERS

Parameter Type Description
npcName string Name of the NPC (case insensitive).

IsNpcOnCell

function isNpcOnCell(cellX, cellY)

Returns true if there is a visible NPC the specified coordinates.

PARAMETERS

Parameter Type Description
cellX number X coordinate of the cell.
cellY number Y coordinate of the cell.

IsShopOpen

function isShopOpen()

Returns true if there is a shop opened.

IsRelearningMoves

function isRelearningMoves()

Returns true if the player is relearning the move of a Pokemon from an NPC.

GetMoney

function getMoney()

Returns the amount of money in the inventory.

IsMounted

function isMounted()

Returns true if the player is riding a mount or the bicycle.

IsSurfing

function isSurfing()

Returns true if the player is surfing.

IsPrivateMessageEnabled

function isPrivateMessageEnabled()

Check if the private message from normal users are blocked.

GetTime

function getTime()

Returns the current in game hour and minute.

IsMorning

function isMorning()

Returns true if morning time.

IsNoon

function isNoon()

Returns true if noon time.

IsNight

function isNight()

Returns true if night time.

IsOutside

function isOutside()

Returns true if the character is outside.

IsAutoEvolve

function isAutoEvolve()

Returns true if auto-evolve is enabled.

IsPCOpen

function isPCOpen()

Check if the PC is open. Moving close the PC, usePC() opens it.

IsCurrentPCBoxRefreshed

function isCurrentPCBoxRefreshed()

Is the currentPCBox refreshed yet?

GetCurrentPCBoxSize

function getCurrentPCBoxSize()

Current box size.

GetCurrentPCBoxId

function getCurrentPCBoxId()

Get the active PC Box.

GetPCBoxCount

function getPCBoxCount()

Return the number of non-empty boxes in the PC.

GetPCPokemonCount

function getPCPokemonCount()

Return the number of pokemon in the PC.

GetPokemonIdFromPC

function getPokemonIdFromPC(boxId, boxPokemonId)

Pokedex ID of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonNameFromPC

function getPokemonNameFromPC(boxId, boxPokemonId)

Name of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonHealthFromPC

function getPokemonHealthFromPC(boxId, boxPokemonId)

Current HP of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonHealthPercentFromPC

function getPokemonHealthPercentFromPC(boxId, boxPokemonId)

Returns the percentage of remaining health of the specified pokémon in the team.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonMaxHealthFromPC

function getPokemonMaxHealthFromPC(boxId, boxPokemonId)

Max HP of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonLevelFromPC

function getPokemonLevelFromPC(boxId, boxPokemonId)

Level of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonTotalExperienceFromPC

function getPokemonTotalExperienceFromPC(boxId, boxPokemonId)

Total of experience cost of a level for the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonRemainingExperienceFromPC

function getPokemonRemainingExperienceFromPC(boxId, boxPokemonId)

Remaining experience before the next level of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonStatusFromPC

function getPokemonStatusFromPC(boxId, boxPokemonId)

Status of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonTypeFromPC

function getPokemonTypeFromPC(boxId, boxPokemonId)

Type of the pokemon of the current box matching the ID as a table of length 2.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonHeldItemFromPC

function getPokemonHeldItemFromPC(boxId, boxPokemonId)

Returns the item held by the specified pokemon in the PC, null if empty.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonUniqueIdFromPC

function getPokemonUniqueIdFromPC(boxId, boxPokemonId)

PROShine custom unique ID of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonRemainingPowerPointsFromPC

function getPokemonRemainingPowerPointsFromPC(boxId, boxPokemonId, moveId)

Current move PP of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonMaxPowerPointsFromPC

function getPokemonMaxPowerPointsFromPC(boxId, boxPokemonId, moveId)

Max move PP of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

IsPokemonFromPCShiny

function IsPokemonFromPCShiny(boxId, boxPokemonId)

Shinyness of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonMoveNameFromPC

function getPokemonFromPC(boxId, boxPokemonId, moveId)

Move of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonMoveAccuracyFromPC

function getPokemonMoveAccuracyFromPC(boxId, boxPokemonId, moveId)

Returns the move accuracy of the specified pokémon in the box at the specified index.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonMovePowerFromPC

function getPokemonMovePowerFromPC(boxId, boxPokemonId, moveId)

Returns the move power of the specified pokémon in the box at the specified index.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonMoveTypeFromPC

function getPokemonMoveTypeFromPC(boxId, boxPokemonId, moveId)

Returns the move type of the specified pokémon in the box at the specified index.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonMoveDamageTypeFromPC

function getPokemonMoveDamageTypeFromPC(boxId, boxPokemonId, moveId)

Returns the move damage type of the specified pokémon in the box at the specified index.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonMoveStatusFromPC

function getPokemonMoveStatusFromPC(boxId, boxPokemonId, moveId)

Returns true if the move of the specified pokémon in the box at the specified index can apply a status.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
moveId number ID of the move (1-4).

GetPokemonNatureFromPC

function getPokemonNatureFromPC(boxId, boxPokemonId)

Nature of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonAbilityFromPC

function getPokemonAbilityFromPC(boxId, boxPokemonId)

Ability of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonStatFromPC

function getPokemonStatFromPC(boxId, boxPokemonId, statType)

Returns the value for the specified stat of the specified pokémon in the PC.

Full name Short Alternative
Health HP
Attack ATK
Defence DEF Defense
SpAttack SPATK
SpDefence SPDEF SpDefense
Speed SPD

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
statType string Name of the stat (case insensitive).

GetPokemonEffortValueFromPC

function getPokemonEffortValueFromPC(boxId, boxPokemonId, statType)

Returns the effort value for the specified stat of the specified pokémon in the PC.

Full name Short Alternative
Health HP
Attack ATK
Defence DEF Defense
SpAttack SPATK
SpDefence SPDEF SpDefense
Speed SPD

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
statType string Name of the stat (case insensitive).

GetPokemonIndividualValueFromPC

function getPokemonIndividualValueFromPC(boxId, boxPokemonId, statType)

Returns the individual value for the specified stat of the specified pokémon in the PC.

Full name Short Alternative
Health HP
Attack ATK
Defence DEF Defense
SpAttack SPATK
SpDefence SPDEF SpDefense
Speed SPD

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.
statType string Name of the stat (case insensitive).

GetPokemonHappinessFromPC

function getPokemonHappinessFromPC(boxId, boxPokemonId)

Happiness of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonRegionFromPC

function getPokemonRegionFromPC(boxId, boxPokemonId)

Region of capture of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonOriginalTrainerFromPC

function getPokemonOriginalTrainerFromPC(boxId, boxPokemonId)

Original trainer of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonGenderFromPC

function getPokemonGenderFromPC(boxId, boxPokemonId)

Gender of the pokemon of the current box matching the ID.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetPokemonFormFromPC

function getPokemonFormFromPC(boxId, boxPokemonId)

Form of the pokémon in the current box matching the ID. (0 if no form.)

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

GetServer

function getServer()

Returns the connected server name.

Battle conditions

IsOpponentShiny

function isOpponentShiny()

Returns true if the opponent pokémon is shiny.

IsAlreadyCaught

function isAlreadyCaught()

Returns true if the opponent pokémon has already been caught and has a pokédex entry.

IsWildBattle

function isWildBattle()

Returns true if the current battle is against a wild pokémon.

GetActivePokemonNumber

function getActivePokemonNumber()

Returns the index of the active team pokémon in the current battle.

GetOpponentId

function getOpponentId()

Returns the id of the opponent pokémon in the current battle.

GetOpponentName

function getOpponentName()

Returns the name of the opponent pokémon in the current battle.

GetOpponentHealth

function getOpponentHealth()

Returns the current health of the opponent pokémon in the current battle.

GetOpponentHealthPercent

function getOpponentHealthPercent()

Returns the percentage of remaining health of the opponent pokémon in the current battle.

GetOpponentLevel

function getOpponentLevel()

Returns the level of the opponent pokémon in the current battle.

GetOpponentStatus

function getOpponentStatus()

Returns the status of the opponent pokémon in the current battle.

GetOpponentForm

function getOpponentForm()

Returns the form of the opponent pokémon in the current battle (0 if no form).

IsOpponentEffortValue

function isOpponentEffortValue(statType)

Returns true if the opponent is only giving the specified effort value.

The valid values for the stat type are:

Full name Short Alternative
Health HP
Attack ATK
Defence DEF Defense
SpAttack SPATK
SpDefence SPDEF SpDefense
Speed SPD

PARAMETERS

Parameter Type Description
statType string Name of the stat (case insensitive).

GetOpponentEffortValue

function getOpponentEffortValue(statType)

Returns the amount of a particular EV given by the opponent.

The valid values for the stat type are:

Full name Short Alternative
Health HP
Attack ATK
Defence DEF Defense
SpAttack SPATK
SpDefence SPDEF SpDefense
Speed SPD

PARAMETERS

Parameter Type Description
statType string Name of the stat (case insensitive).

GetOpponentType

function getOpponentType()

Returns the type of the opponent pokémon in the current battle as an array of length 2.

Game actions

MoveToCell

function moveToCell(cellX, cellY)

Moves to the specified coordinates.

PARAMETERS

Parameter Type Description
cellX number X coordinate of the cell
cellY number Y coordinate of the cell

MoveToMap

function moveToMap(mapName)

Moves to the nearest cell teleporting to the specified map.

PARAMETERS

Parameter Type Description
mapName string Name of the destination map (case insensitive)

MoveToRectangle

function moveToRectangle(minX, minY, maxX, maxY)

Moves to a random accessible cell inside the specified rectangle.

PARAMETERS

Parameter Type Description
minX number Minimum X coordinate of the rectangle
minY number Minimum Y coordinate of the rectangle
maxX number Maximum X coordinate of the rectangle
maxY number Maximum Y coordinate of the rectangle

MoveToNormalGround

function moveToNormalGround()

Move randomly avoiding water and links.

MoveToGrass

function moveToGrass()

Moves to the nearest grass patch then moves randomly inside it.

MoveToWater

function moveToWater()

Moves to the nearest water area then moves randomly inside it.

MoveNearExit

function moveNearExit(mapName)

Moves near the cell teleporting to the specified map.

PARAMETERS

Parameter Type Description
mapName string Name of the map (case insensitive)

TalkToNpc

function talkToNpc(npcName)

Moves then talks to NPC specified by its name.

If the NPC is a pokémon, its name is the character # followed by the pokédex ID.

PARAMETERS

Parameter Type Description
npcName string Name of the NPC (case insensitive)

TalkToNpcOnCell

function talkToNpcOnCell(cellX, cellY)

Moves then talks to NPC located on the specified cell.

PARAMETERS

Parameter Type Description
cellX number X coordinate of the cell
cellY number Y coordinate of the cell

UsePokecenter

function usePokecenter()

Moves to the Nurse Joy then talks to the cell below her.

SwapPokemon

function swapPokemon(index1, index2)

Swaps the two pokémon specified by their position in the team.

PARAMETERS

Parameter Type Description
index1 number Index of the first pokémon to swap
index2 number Index of the second pokémon to swap

SwapPokemonWithLeader

function swapPokemonWithLeader(pokemonName)

Swaps the first pokémon with the specified name with the leader of the team.

PARAMETERS

Parameter Type Description
pokemonName string Name of the pokémon to swap with the leader (case insensitive)

SortTeamByLevelAscending

function sortTeamByLevelAscending()

Sorts the pokémon in the team by level in ascending order, one pokémon at a time.

SortTeamByLevelDescending

function sortTeamByLevelDescending()

Sorts the pokémon in the team by level in descending order, one pokémon at a time.

SortTeamRangeByLevelAscending

function sortTeamRangeByLevelAscending(fromIndex, toIndex)

Sorts the specified part of the team by level in ascending order, one pokémon at a time.

SortTeamRangeByLevelDescending

function sortTeamRangeByLevelDescending(fromIndex, toIndex)

Sorts the specified part of the team by level in descending order, one pokémon at a time.

BuyItem

function buyItem(itemName, quantity)

buyItem("Potion", 1) -- Buys one Potion
buyItem("Poke Ball", 307) -- Buys 307 Poke Ball

Buys the specified item from the opened shop.

PARAMETERS

Parameter Type Description
itemName string Name of the item to buy (case insensitive)
quantity number Quantity of items to buy

RelearnMove

function relearnMove(moveName)

Relearn a move from the move relearner NPC.

PARAMETERS

Parameter Type Description
moveName string Name of the move to relearn

UsePC

function usePC()

Move to the PC and opens it, refreshing the first box.

OpenPCBox

function openPCBox(boxId)

Open box from the PC.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.

DepositPokemonToPC

function depositPokemonToPC(pokemonUid)

Deposit a pokemon to the PC.

PARAMETERS

Parameter Type Description
pokemonUid number Unique ID of the specified Pokemon

WithdrawPokemonFromPC

function withdrawPokemonFromPC(boxId, boxPokemonId)

Withdraw a pokemon from a known box.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon.

SwapPokemonFromPC

function swapPokemonFromPC(boxId, boxPokemonId, pokemonUid)

Swap a pokemon from the team with a pokemon from the PC.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
boxPokemonId number PROShine unique ID of the specified pokemon to deposit.
pokemonUid number Unique ID of the specified Pokemon to withdraw.

GiveItemToPokemon

function giveItemToPokemon(itemName, pokemonIndex)

Give the specified item on the specified pokemon.

PARAMETERS

Parameter Type Description
itemName string Name of the item (case insensitive).
pokemonIndex number Index of the pokémon (1-6).

TakeItemFromPokemon

function takeItemFromPokemon(index)

Take the held item from the specified pokemon.

PARAMETERS

Parameter Type Description
index number Index of the pokémon (1-6).

ReleasePokemonFromTeam

function releasePokemonFromTeam(pokemonUid)

Releases the specified pokemon in the team.

PARAMETERS

Parameter Type Description
pokemonUid number Unique ID of the specified Pokemon to withdraw.

ReleasePokemonFromPC

function releasePokemonFromPC()

Releases the specified pokemon in the PC.

PARAMETERS

Parameter Type Description
boxId number ID of the specified box.
pokemonUid number Unique ID of the specified Pokemon to withdraw.

EnablePrivateMessage

function enablePrivateMessage()

Enable private messages from users.

DisablePrivateMessage

function disablePrivateMessage()

Disable private messages from users.

EnableAutoEvolve

function enableAutoEvolve()

Enable auto-evolve.

DisableAutoEvolve

function disableAutoEvolve()

Disable auto-evolve.

Battle actions

Attack

function attack()

Uses the most effective offensive move available.

WeakAttack

function weakAttack()

Uses the least effective offensive move available.

Run

function run()

Tries to escape from the current wild battle.

SendUsablePokemon

function sendUsablePokemon()

Sends the first usable pokemon different from the active one.

SendAnyPokemon

function sendAnyPokemon()

Sends the first available pokemon different from the active one.

SendPokemon

function sendPokemon(index)

Sends the specified pokemon to battle.

PARAMETERS

Parameter Type Description
index number Index of pokémon to send.

UseMove

function useMove(moveName)

Uses the specified move in the current battle if available.

PARAMETERS

Parameter Type Description
moveName string Name of the move to use (case insensitive).

UseAnyMove

function useAnyMove()

Uses the first available move or struggle if out of PP.

Other actions

PushDialogAnswer

function pushDialogAnswer(answerIndex)

pushDialogAnswer(2)
pushDialogAnswer(1)
pushDialogAnswer(3)
talkToNpc("Jackson") -- Will select 2, 1 then 3.

Adds the specified answer to the answer queue. It will be used in the next dialog.

This function should be called before a talkToNpc or talkToNpcOnCell.

PARAMETERS

Parameter Type Description
answerIndex number Index of the answer or index of the pokémon to select

UseItem

function useItem(itemName)

useItem("Bicycle")
useItem("Escape Rope")

Uses the specified item.

This function is usable in the field and in battle.

PARAMETERS

Parameter Type Description
itemName string Name of the item (case insensitive)

UseItemOnPokemon

function useItemOnPokemon(itemName, pokemonIndex)

useItemOnPokemon("Potion", 1)
useItemOnPokemon("Rare Candy", 5)

Uses the specified item on the specified pokémon.

This function is usable in the field and in battle.

PARAMETERS

Parameter Type Description
itemName string Name of the item (case insensitive)
pokemonIndex number Index of the pokémon (1-6)

ForgetMove

function forgetMove(moveName)

forgetMove("Dragon Rage")

Only usable when learning a move, inside onMoveLearning.

Forgets the specified move, if existing, in order to learn a new one.

PARAMETERS

Parameter Type Description
moveName string Name of the move (case insensitive)

ForgetAnyMoveExcept

function forgetAnyMoveExcept(moveNames)

forgetAnyMoveExcept({"Fly", "Cut", "Psychic", "Thunder"})

Only usable when learning a move, inside onMoveLearning.

Forgets the first move that is not one of the specified moves.

PARAMETERS

Parameter Type Description
moveNames array of string Name of the moves (case insensitive)

SetOption

function setOption(index, value)

Sets the option at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the option.
value boolean Value of the option (true/false).

GetOption

function getOption(index)

Gets the option at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the option.

SetOptionName

function setOptionName(index, optionName)

Sets the name of the option at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the option.
optionName string Name of the option.

SetOptionDescription

function setOptionDescription(index, optionDescription)

Sets the tooltip description of the option at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the option.
optionDescription string Description of the option.

RemoveOption

function removeOption(index)

Removes the slider option at the specified index.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the option.

SetTextOption

function setTextOption(index, optionText)

Sets the text of the TextOption at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the option.
optionText string Text of the specified TextOption.

GetTextOption

function getTextOption(index)

Returns the text content of the TextOption at a particular index, or an empty string if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the TextOption.

SetTextOptionName

function setTextOptionName(index, optionName)

Sets the name of the TextOption at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the TextOption.
optionName string Name of the TextOption.

SetTextOptionDescription

function setTextOptionDescription(index, optionDescription)

Sets the tooltip description of the TextOption at a particular index, or creates it if it doesn’t exist.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the TextOption.
optionDescription string Description of the TextOption.

RemoveTextOption

function removeTextOption(index)

Removes the text option at the specified index.

This function only affects the PROShine client user interface.

PARAMETERS

Parameter Type Description
index number Index of the TextOption.

SetMount

function setMount(mount)

Sets the item that will be used to mount the player.

PARAMETERS

Parameter Type Description
mount string Name of the mount.

SetWaterMount

function setWaterMount(mount)

Sets the item that will be used when the player begins surfing.

PARAMETERS

Parameter Type Description
mount string Name of the mount.

LogToFile

function logToFile(file, text [, overwrite])

Writes a string, a number, or a table of strings and/or numbers to file. overwrite is an optional parameter, and will append the line(s) if absent.

Files must be located in PROShine-X.X.X.X/Logs.

PARAMETERS

Parameter Type Description
file string Name of the log file.
text string Text to log to the specified file.
overwrite boolean Append absent lines to file (true/false).

ReadLinesFromFile

function readLinesFromFile(file)

Returns a table of every line in file.

Files must be located in PROShine-X.X.X.X/Logs.

PARAMETERS

Parameter Type Description
file string Name of the log file.

Events

onStart

function onStart()

Called when the bot is started.

This is where you should initialize your variables.

onStop

function onStop()

Called when the bot is stopped.

onPause

function onPause()

Called when the bot is paused.

onResume

function onPause()

Called when the bot is resumed from a previous pause.

onPathAction

function onPathAction()

Called when the bot must execute a path action.

You should execute one (and only one) game action in this scope.

onBattleAction

function onBattleAction()

Called when the bot must execute a batlle action.

You should execute one (and only one) battle action in this scope.

onDialogMessage

function onDialogMessage(message)

Called when a dialog message is displayed (because you are talking to a NPC, for instance).

onBattleMessage

function onBattleMessage(message)

Called when a battle message is displayed.

These messages are displayed inside the battle window in-game.

onSystemMessage

function onSystemMessage(message)

Called when a system message is displayed.

These messages are displayed inside the chat in-game.

onLearningMove

function onLearningMove(moveName, pokemonIndex)

Called when a pokémon is learning a move but already has four.

You can call forgetMove or forgetAnyMoveExcept here.

If you do not call these functions, the move will not be learned.

PARAMETERS

Parameter Type Description
moveName string Name of the move that can be learned.
pokemonIndex number Index of the pokémon learning the new move.
lua