| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Command ID | BeaterScript Names (EndScr/End/FCall/FJump/Move) | Parameters (orange = ushort, turquoise = const ushort, green = ref ushort, magenta/purple = returnable (int/bool) red = byte, blue = int, light cyan/dark cyan = fx16/fx32). Names must be valid C-style identifiers. | Explanation | PokéScript Package/Class | PokéScript Name | ||||||||||
2 | 0x0 | VMNop | Does nothing. | pokescript.vm.VM | Nop | |||||||||||
3 | 0x1 | VMNop2 | Does nothing. | pokescript.vm.VM | Nop2 | |||||||||||
4 | 0x2 | VMHalt | Ends a script. | pokescript.vm.VM | Halt | |||||||||||
5 | 0x3 | VMSleep | num | Pauses execution for num frames. (30 frames in the overworld = 1 second). | system.Runtime | Sleep | ||||||||||
6 | 0x4 | VMCall | addr | Jumps to a relative script branch and transfers the program counter to it. | pokescript.vm.VM | _Call | ||||||||||
7 | 0x5 | VMReturn | Ends the current script branch and returns the program counter to the original script (?). | pokescript.vm.VM | _Return | |||||||||||
8 | 0x6 | DebugPrint | unused | TODO | pokescript.vm.VM | DebugPrint | ||||||||||
9 | 0x7 | DebugStack | unused | TODO | pokescript.vm.StackCtrl | DebugStack | ||||||||||
10 | 0x8 | StackPushConst | value | Pushes a variable onto the stack. | pokescript.vm.StackCtrl | PushConst | ||||||||||
11 | 0x9 | StackPush | var | Pushes a variable's value onto the stack. | pokescript.vm.StackCtrl | Push | ||||||||||
12 | 0xa | StackPop | dest | Removes a variable from the stack. | pokescript.vm.StackCtrl | PopTo | ||||||||||
13 | 0xb | StackDiscard | Clears the stack (?). | pokescript.vm.StackCtrl | Pop | |||||||||||
14 | 0xc | StackAdd | Adds two variables on the stack. | pokescript.vm.StackCtrl | StackAdd | |||||||||||
15 | 0xd | StackSub | Subtracts two variables on the stack. | pokescript.vm.StackCtrl | StackSub | |||||||||||
16 | 0xe | StackMul | Multiplies two variables on the stack. | pokescript.vm.StackCtrl | StackMul | |||||||||||
17 | 0xf | StackDiv | Divides two variables on the stack. | pokescript.vm.StackCtrl | StackDiv | |||||||||||
18 | 0x10 | StackPushFlag | flag | Stores the flag on the stack(?). | pokescript.vm.StackCtrl | PushFlag | ||||||||||
19 | 0x11 | StackCmp | cond | Compares the two topmost elements of the stack based on a condition and pushes the result back onto the stack. | pokescript.vm.StackCtrl | StackCmp | ||||||||||
20 | 0x12 | WorkAnd | var | operand | var &= operand | pokescript.vm.Math | And | |||||||||
21 | 0x13 | WorkOr | var | operand | var |= operand | pokescript.vm.Math | Or | |||||||||
22 | 0x14 | VMRegSet8 | dstReg | val | Stores an 8-bit integer in a global variable (referenced by id). | pokescript.vm.VM | RegSet8 | |||||||||
23 | 0x15 | VMRegSet32 | dstReg | val | Stores a 32-bit integer in a global variable (referenced by id). | pokescript.vm.VM | RegSet32 | |||||||||
24 | 0x16 | VMRegMov | dstReg | srcReg | TODO | pokescript.vm.VM | RegMov | |||||||||
25 | 0x17 | VMRegCmp8 | lhsReg | rhsReg | Compares the values of two global variables (referenced by id). | pokescript.vm.VM | RegCmp8 | |||||||||
26 | 0x18 | VMRegCmpConst8 | reg | value | Compares the values of a global variable and a user supplied variable. | pokescript.vm.VM | RegCmpConst8 | |||||||||
27 | 0x19 | WorkCmpConst | var | value | Compares the values of a variable and a user supplied number. | pokescript.vm.Math | CmpVarConst | |||||||||
28 | 0x1a | WorkCmpWork | lhsVar | rhsVar | Compares the values of two variables. | pokescript.vm.Math | CmpVarVar | |||||||||
29 | 0x1b | RTCallGlobalAsync | scrId | Calls a common script alongside the currently running script. | system.Runtime | GlobalCallAsync | ||||||||||
30 | 0x1c | RTCallGlobal | scrId | Calls a common script and waits until it completes. | system.Runtime | GlobalCall | ||||||||||
31 | 0x1d | RTEndGlobal | Stops the standard function. | system.Runtime | GlobalEnd | |||||||||||
32 | 0x1e | VMJump | addr | Jumps to and sets the program counter to a relative script branch (whose distance is specified in addr). | pokescript.vm.VM | _Jump | ||||||||||
33 | 0x1f | VMJumpIf | cond | addr | Jumps to and sets the program counter to a relative script branch (whose distance is specified in addr), if the given condition is true. | pokescript.vm.VM | _JumpIf | |||||||||
34 | 0x20 | VMCallIf | cond | addr | Jumps to but doesn't set the program counter to a relative script branch (whose distance is specified in addr), if the given condition is true. | pokescript.vm.VM | _CallIf | |||||||||
35 | 0x21 | RTReserveScript | scrId | Reserves the next executed SCRID to a constant value. Can be used across a warp as well to start another script automatically. | system.Runtime | ReserveScript | ||||||||||
36 | 0x22 | FieldGetContinueFlag | dest | TODO | ||||||||||||
37 | 0x23 | FlagSet | flag | Sets a given system flag to TRUE (1). | system.EventFlags | Set | ||||||||||
38 | 0x24 | FlagReset | flag | Clears the state of a given system flag. | system.EventFlags | Clear | ||||||||||
39 | 0x25 | FlagGet | flag | dest | Reads the value of a flag, and stores it in var. | system.EventFlags | Get | |||||||||
40 | 0x26 | WorkAdd | var | operand | Accesses the second variable, grabs the value of the variable, then adds it to the value in the first variable. | pokescript.vm.Math | Add | |||||||||
41 | 0x27 | WorkSub | var | operand | Accesses the second variable, grabs the value of the variable, then subtracts it from the value in the first variable. | pokescript.vm.Math | Sub | |||||||||
42 | 0x28 | WorkSetConst | var | value | Stores val in the specified variable. | pokescript.vm.Math | SetConst | |||||||||
43 | 0x29 | WorkGet | dest | src | Copies the value in src to the variable dest. Also known as: var.value = src.value | system.EventWorks | Get | |||||||||
44 | 0x2a | WorkSet | dst | src | Copies the value in src to the variable dest. Also known as: var.value = src.value (?) | system.EventWorks | Set | |||||||||
45 | 0x2b | WorkMul | var | operand | Multiplies the value of var by val. Also known as: var.value *= val | pokescript.vm.Math | Mul | |||||||||
46 | 0x2c | WorkDiv | var | operand | Divides the value of var by val. Also known as: var.value /= val | pokescript.vm.Math | Div | |||||||||
47 | 0x2d | WorkMod | var | operand | Divides the value of var by val and returns the remainder of the operation. Also known as: var.value %= val | pokescript.vm.Math | Mod | |||||||||
48 | 0x2e | ActorPauseAll | Freezes all NPCs. | event.actors.Actor | PauseAll | |||||||||||
49 | 0x2f | ActorUnlockAll | Unfreezes all NPCs. | event.actors.Actor | UnpauseAll | |||||||||||
50 | 0x30 | RTFinishSubEvents | Finished all script sub-events that certain commands may have invoked. | system.Runtime | FinishSubEvents | |||||||||||
51 | 0x31 | InputWaitAB | Waits until "A" or "B" is pressed. | system.Input | ABKeyWait | |||||||||||
52 | 0x32 | InputWaitLast | Waits until any of A/B/Up/Down/Left/Right is pressed. | system.Input | LastKeyWait | |||||||||||
53 | 0x33 | MsgSetAutoscrolls | enabled | Enables/disabled message box auto-scrolling. | event.dialogs.Message | SetAutoscrolls | ||||||||||
54 | 0x34 | MsgSystem | msgId | pos | Opens a system message box. | event.dialogs.Message | System | |||||||||
55 | 0x35 | MsgSystemAsync | msgId | pos | Opens a system message box, but allows additional code to run while it's up. | event.dialogs.Message | SystemAsync | |||||||||
56 | 0x36 | MsgSystemClose | Closes the system message box. | event.dialogs.Message | CloseSystem | |||||||||||
57 | 0x37 | MsgSetLoadingSpinner | hide | Shows/hides a loading spinner at the system message box. | event.dialogs.Message | SetLoadingSpinner | ||||||||||
58 | 0x38 | MsgInfo | msgId | pos | Opens a message which isn't associated with an NPC. | event.dialogs.Message | Info | |||||||||
59 | 0x39 | MsgInfoClose | Closes the message which isn't associated with an NPC. | event.dialogs.Message | CloseInfo | |||||||||||
60 | 0x3a | MsgMulti | msgId | x | y | handle | Opens a message at position (x, y). The coordinates are based on screen hardware tiles (8 pixels). | event.dialogs.Message | Multi | |||||||
61 | 0x3b | MsgWinCloseNo | handle | Closes a message window handle. | event.dialogs.Message | CloseWin | ||||||||||
62 | 0x3c | MsgActorEx | textFile | msgId | actorId | pos | type | Open a message window bound to an actor. The actor is specified manually. | event.dialogs.Message | ActorEx | ||||||
63 | 0x3d | MsgActor | textFile | msgId | pos | type | Open a message window bound to an actor. The actor is automatically determined. | event.dialogs.Message | Actor | |||||||
64 | 0x3e | MsgActorClose | Closes the actor message. | event.dialogs.Message | CloseActor | |||||||||||
65 | 0x3f | MsgWinCloseAll | Closes all message windows. | event.dialogs.Message | CloseAll | |||||||||||
66 | 0x40 | MoneyWinDisp | x | y | Shows the money box at coords (x, y). | event.dialogs.MoneyWin | Show | |||||||||
67 | 0x41 | MoneyWinClose | Closes the money box. | event.dialogs.MoneyWin | Close | |||||||||||
68 | 0x42 | MoneyWinUpdate | Updates the values in the money box. | event.dialogs.MoneyWin | Update | |||||||||||
69 | 0x43 | MsgPlaceSign | msgId | type | Opens a place sign message window. | event.dialogs.Message | PlaceSign | |||||||||
70 | 0x44 | MsgPlaceSignClose | Closes the place sign message window. | event.dialogs.Message | ClosePlaceSign | |||||||||||
71 | 0x45 | MsgCheckerBG | msgId | posX | posY | unused | Opens a message with a checkerboard background. | event.dialogs.Message | CheckerMsg | |||||||
72 | 0x46 | MsgCheckerBGClose | Closes the checkerboard message. | event.dialogs.Message | CloseCheckerMsg | |||||||||||
73 | 0x47 | YesNoWin | dest | Opens a box with two options, yes or no. The result of the choice made by the player is stored in dest. | event.dialogs.YesNoWin | Show | ||||||||||
74 | 0x48 | MsgActorGendered | textFile | msgIdM | msgIdF | actorId | pos | type | A message which changes depending on the player's gender. | event.dialogs.Message | ActorGendered | |||||
75 | 0x49 | MsgActorVersioned | textFile | msgIdW | msgIdB | actorId | pos | type | A message which changes depending on whether the game is Black or White. | event.dialogs.Message | ActorVersioned | |||||
76 | 0x4a | MsgScream | id | pos | Opens a message with a spiked border. Known as the angry message by some. | event.dialogs.Message | Spiked | |||||||||
77 | 0x4b | MsgWaitAdvance | Waits until all messages have finished scrolling. | event.dialogs.Message | WaitAdvance | |||||||||||
78 | 0x4c | WordSetPlayerName | strbufIdx | Stores the name of the player to a string buffer. | system.text.WordSet | LoadPlayerName | ||||||||||
79 | 0x4d | WordSetItemName | strbufIdx | itemId | TODO | system.text.WordSet | LoadItemName | |||||||||
80 | 0x4e | WordSetItemNameEx | strbufIdx | itemId | amount | article | TODO | system.text.WordSet | LoadItemNameEx | |||||||
81 | 0x4f | WordSetItemNameWithArticle | strbufIdx | itemId | TODO | system.text.WordSet | LoadItemNameWithArticle | |||||||||
82 | 0x50 | WordSetTMMoveName | strbufIdx | itemId | TODO | system.text.WordSet | LoadTMMoveName | |||||||||
83 | 0x51 | WordSetMoveName | strbufIdx | moveId | TODO | system.text.WordSet | LoadMoveName | |||||||||
84 | 0x52 | WordSetItemPocketName | strbufIdx | itemId | TODO | system.text.WordSet | LoadItemPocketName | |||||||||
85 | 0x53 | WordSetPartyPokeSpecies | strbufIdx | partyIdx | TODO | system.text.WordSet | LoadPartyPokeSpecies | |||||||||
86 | 0x54 | WordSetPartyPokeName | strbufIdx | partyIdx | TODO | system.text.WordSet | LoadPartyPokeName | |||||||||
87 | 0x55 | WordSetDaycarePokeSpecies | strbufIdx | daycareSlot | TODO | system.text.WordSet | LoadDaycarePokeSpecies | |||||||||
88 | 0x56 | WordSetPokeTypeName | strbufIdx | typeId | TODO | system.text.WordSet | LoadPokeTypeName | |||||||||
89 | 0x57 | WordSetPokeSpecies | strbufIdx | species | TODO | system.text.WordSet | LoadPokeSpecies | |||||||||
90 | 0x58 | WordSetPokeSpeciesWithArticle | strbufIdx | species | TODO | system.text.WordSet | LoadPokeSpeciesWithArticle | |||||||||
91 | 0x59 | WordSetPlaceName | strbufIdx | zoneId | TODO | system.text.WordSet | LoadPlaceName | |||||||||
92 | 0x5a | WordSetTrendName | strbufIdx | trendId | TODO | system.text.WordSet | LoadTrendName | |||||||||
93 | 0x5b | WordSetDaycarePokeName | strbufIdx | species | TODO | system.text.WordSet | LoadDaycarePokeName | |||||||||
94 | 0x5c | WordSetNumber | strbufIdx | value | magnitude | TODO | system.text.WordSet | LoadNumber | ||||||||
95 | 0x5d | WordSetMusicalInfo | strbufIdx | type | index | TODO | system.text.WordSet | LoadMusicalInfo | ||||||||
96 | 0x5e | WordSetCountry | strbufIdx | countryId | TODO | system.text.WordSet | LoadCountry | |||||||||
97 | 0x5f | WordSetHobbyName | strbufIdx | hobbyId | TODO | system.text.WordSet | LoadHobbyName | |||||||||
98 | 0x60 | WordSetPassPowerName | strbufIdx | passPowerId | TODO | system.text.WordSet | LoadPassPowerName | |||||||||
99 | 0x61 | WordSetTrainerClassName | strbufIdx | classId | TODO | system.text.WordSet | LoadTrainerClassName | |||||||||
100 | 0x62 | WordSetTrainerClassNameWithArticle | strbufIdx | classId | TODO | system.text.WordSet | LoadTrainerClassWithArticle | |||||||||