• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
Resource icon

Variable Tracker v1.0

Pokémon Essentials Version
v18 ➖
Debugging code can be pretty annoying, especially when you don't know the value of a certain variable. That's where this script comes in. It tracks whichever variables you want by displaying their value at the right side of the screen. You can specify the size of the extra window, as well as how many lines a variable may use up to show the value.


uc






Installation

In a new script section above Main, add the following script:
VariableTracker




Documentation

To track the value of a variable, use VariableTracker.track(name, code)
  • name: This is the display name of the variable and can be literally anything as long as it's a string.
  • code: This can either be a String or a Proc. If it's a String, it will evaluate the string and display the return value. If it's a Proc, it will call the proc (without any arguments) and display the return value. It automatically calls .inspect on whatever it's about to display.
You can call this method at any time.


To stop tracking a variable, use VariableTracker.stop_tracking(name). This will stop tracking the variable (so that it won't display it anymore).



When this script tries to display a value but it returns an error, it will print out --- instead.
Credits
  • Marin
Author
Marin
Views
1,296
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Marin

Latest updates

  1. Update v1.1

    Updated to v18.
Back
Top