<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tuxemon.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VXtreniusX</id>
	<title>Tuxepedia - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tuxemon.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VXtreniusX"/>
	<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/Special:Contributions/VXtreniusX"/>
	<updated>2026-06-14T10:31:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18867</id>
		<title>Tuxemon Debug Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18867"/>
		<updated>2021-08-23T09:03:18Z</updated>

		<summary type="html">&lt;p&gt;VXtreniusX: Change &amp;quot;below&amp;quot; to &amp;quot;above&amp;quot; in python command description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tuxemon comes with command line that you can use for debugging purposes. The Tuxemon command line console provides you with a *full* python shell and access to all in-game functions and variables. This page will give you some examples on how you can use the Tuxemon CLI to do things like give yourself monsters or start battles).&lt;br /&gt;
&lt;br /&gt;
== Enabling the CLI ==&lt;br /&gt;
To enable to Tuxemon command line, edit the &amp;lt;code&amp;gt;tuxemon.cfg&amp;lt;/code&amp;gt; configuration file with a text editor and change &amp;lt;code&amp;gt;cli_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://i.imgur.com/hvvblIn.png&lt;br /&gt;
&lt;br /&gt;
After enabling the CLI, run Tuxemon from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python ./tuxemon.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the CLI ==&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
After launching Tuxemon from the command line, you should get a prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a python shell, enter the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now get a python shell prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, you can execute arbitrary Python code. To access the game's objects and variables, use &amp;lt;code&amp;gt;self.app&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print self.app&lt;br /&gt;
    &amp;lt;core.tools.Control object at 0x7f4365302e90&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from pprint import pprint&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; pprint(self.app.__dict__)&lt;br /&gt;
    {'animations': {},&lt;br /&gt;
     'caption': 'Tuxemon',&lt;br /&gt;
     'cli': &amp;lt;core.components.cli.CommandLine instance at     0x7f436532bc68&amp;gt;,&lt;br /&gt;
     'clock': &amp;lt;Clock(fps=62.50)&amp;gt;,&lt;br /&gt;
     'config': &amp;lt;core.components.config.Config object at     0x7f4367617810&amp;gt;,&lt;br /&gt;
     'current_music': {'song': None, 'status': 'stopped'},&lt;br /&gt;
     'current_time': 383013,&lt;br /&gt;
     'done': False,&lt;br /&gt;
     'event_actions': {},&lt;br /&gt;
     'event_conditions': {},&lt;br /&gt;
     'event_data': {},&lt;br /&gt;
     'event_engine': &amp;lt;core.components.event.EventEngine object at 0x7f436530c0d0&amp;gt;,&lt;br /&gt;
     'event_persist': {},&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; dir(self.app)&lt;br /&gt;
    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'animations', 'caption', 'cli', 'clock', 'config', 'controller_event_loop', 'current_music', 'current_time', 'done', 'event_actions', 'event_conditions', 'event_data', 'event_engine', 'event_loop', 'event_persist', 'events', 'exit', 'flip_state', 'fps', 'imports', 'joystick_event_loop', 'key_events', 'keyboard_events', 'keys', 'main', 'main_loop', 'network_event_loop', 'network_events', 'player1', 'rumble', 'rumble_manager', 'screen', 'server', 'setup_states', 'show_fps', 'state', 'state_dict', 'state_name', 'time_passed_seconds', 'toggle_show_fps', 'update']&lt;br /&gt;
&lt;br /&gt;
=== Adding Monsters ===&lt;br /&gt;
You can add a monster to your party by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
    add_monster rockitten 20&lt;br /&gt;
&lt;br /&gt;
Or in the python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_monster&amp;quot;, (&amp;quot;rockitten&amp;quot;, 20))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In these examples, we add the monster &amp;quot;rockitten&amp;quot; at level 20 to the player's monsters.&lt;br /&gt;
&lt;br /&gt;
=== Adding Items ===&lt;br /&gt;
You can add an item to your inventory by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
    add_item Potion&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_item&amp;quot;, (&amp;quot;potion&amp;quot;,))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the item &amp;quot;Potion&amp;quot; to the player's inventory.&lt;br /&gt;
&lt;br /&gt;
=== Start NPC Battle ===&lt;br /&gt;
You can start combat by typing the following into the Tuxemon shell:&lt;br /&gt;
    trainer_battle professor-rockitten&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from tuxemon.event.actions.start_battle import StartBattleActionParameters&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; trainer = &amp;quot;professor-rockitten&amp;quot;&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;create_npc&amp;quot;, (trainer,7,6))&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;start_battle&amp;quot;, (StartBattleActionParameters(npc_slug=trainer)))&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;remove_npc&amp;quot;, (trainer,))&lt;br /&gt;
&lt;br /&gt;
This example starts a battle with the NPC with name &amp;quot;professor-rockitten&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Start Random Battle ===&lt;br /&gt;
You can start a random battle by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
   random_encounter&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;random_encounter&amp;quot;, (&amp;quot;default_encounter&amp;quot;,100))&lt;br /&gt;
&lt;br /&gt;
This example will start a battle with monsters from encounter group &amp;quot;default_encounter&amp;quot;. Executing this is the same as stepping into a random encounter area, which will trigger a battle depending on the monster's encounter rate in the encounter group.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use the following commands (in the &amp;quot;normal&amp;quot; shell, not in the python one.):&lt;br /&gt;
    • help — shows all commands&lt;br /&gt;
    • credits — shows the copyright text&lt;br /&gt;
    • exit — exits the game&lt;br /&gt;
    • add_item &amp;lt;slug&amp;gt; [amount] — Adds the item (defined in slug parameter)&lt;br /&gt;
    • set_health &amp;lt;target_level&amp;gt; [slot] — Sets the health of the monster in your party. Must be a number between 0 and 100. If slot argument isn't specified, all monsters in your party will be affected.&lt;br /&gt;
    • random_encounter — Sets you in a wild tuxemon battle, similar to walking in tall grass.&lt;br /&gt;
    • trainer_battle &amp;lt;npc_slug&amp;gt; — Sets you in a trainer battle with specified npc.&lt;br /&gt;
    • trainer_battle list — Gives you a list of fightable trainers.&lt;br /&gt;
    • teleport &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; [map_file] — Teleports you to the specific tile. If map_file argument is specified, you'll get teleported to a selected map file.&lt;br /&gt;
    • whereami — Prints out the map filename&lt;br /&gt;
    • python — Starts the python shell, that you can use to modify the game directly. For advanced users, used in some examples above.&lt;br /&gt;
    • event_sh — Event shell, used to execute event actions manually.&lt;/div&gt;</summary>
		<author><name>VXtreniusX</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18866</id>
		<title>Tuxemon Debug Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18866"/>
		<updated>2021-08-23T09:01:46Z</updated>

		<summary type="html">&lt;p&gt;VXtreniusX: Add event_sh ti command list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tuxemon comes with command line that you can use for debugging purposes. The Tuxemon command line console provides you with a *full* python shell and access to all in-game functions and variables. This page will give you some examples on how you can use the Tuxemon CLI to do things like give yourself monsters or start battles).&lt;br /&gt;
&lt;br /&gt;
== Enabling the CLI ==&lt;br /&gt;
To enable to Tuxemon command line, edit the &amp;lt;code&amp;gt;tuxemon.cfg&amp;lt;/code&amp;gt; configuration file with a text editor and change &amp;lt;code&amp;gt;cli_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://i.imgur.com/hvvblIn.png&lt;br /&gt;
&lt;br /&gt;
After enabling the CLI, run Tuxemon from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python ./tuxemon.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the CLI ==&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
After launching Tuxemon from the command line, you should get a prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a python shell, enter the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now get a python shell prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, you can execute arbitrary Python code. To access the game's objects and variables, use &amp;lt;code&amp;gt;self.app&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print self.app&lt;br /&gt;
    &amp;lt;core.tools.Control object at 0x7f4365302e90&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from pprint import pprint&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; pprint(self.app.__dict__)&lt;br /&gt;
    {'animations': {},&lt;br /&gt;
     'caption': 'Tuxemon',&lt;br /&gt;
     'cli': &amp;lt;core.components.cli.CommandLine instance at     0x7f436532bc68&amp;gt;,&lt;br /&gt;
     'clock': &amp;lt;Clock(fps=62.50)&amp;gt;,&lt;br /&gt;
     'config': &amp;lt;core.components.config.Config object at     0x7f4367617810&amp;gt;,&lt;br /&gt;
     'current_music': {'song': None, 'status': 'stopped'},&lt;br /&gt;
     'current_time': 383013,&lt;br /&gt;
     'done': False,&lt;br /&gt;
     'event_actions': {},&lt;br /&gt;
     'event_conditions': {},&lt;br /&gt;
     'event_data': {},&lt;br /&gt;
     'event_engine': &amp;lt;core.components.event.EventEngine object at 0x7f436530c0d0&amp;gt;,&lt;br /&gt;
     'event_persist': {},&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; dir(self.app)&lt;br /&gt;
    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'animations', 'caption', 'cli', 'clock', 'config', 'controller_event_loop', 'current_music', 'current_time', 'done', 'event_actions', 'event_conditions', 'event_data', 'event_engine', 'event_loop', 'event_persist', 'events', 'exit', 'flip_state', 'fps', 'imports', 'joystick_event_loop', 'key_events', 'keyboard_events', 'keys', 'main', 'main_loop', 'network_event_loop', 'network_events', 'player1', 'rumble', 'rumble_manager', 'screen', 'server', 'setup_states', 'show_fps', 'state', 'state_dict', 'state_name', 'time_passed_seconds', 'toggle_show_fps', 'update']&lt;br /&gt;
&lt;br /&gt;
=== Adding Monsters ===&lt;br /&gt;
You can add a monster to your party by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
    add_monster rockitten 20&lt;br /&gt;
&lt;br /&gt;
Or in the python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_monster&amp;quot;, (&amp;quot;rockitten&amp;quot;, 20))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In these examples, we add the monster &amp;quot;rockitten&amp;quot; at level 20 to the player's monsters.&lt;br /&gt;
&lt;br /&gt;
=== Adding Items ===&lt;br /&gt;
You can add an item to your inventory by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
    add_item Potion&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_item&amp;quot;, (&amp;quot;potion&amp;quot;,))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the item &amp;quot;Potion&amp;quot; to the player's inventory.&lt;br /&gt;
&lt;br /&gt;
=== Start NPC Battle ===&lt;br /&gt;
You can start combat by typing the following into the Tuxemon shell:&lt;br /&gt;
    trainer_battle professor-rockitten&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from tuxemon.event.actions.start_battle import StartBattleActionParameters&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; trainer = &amp;quot;professor-rockitten&amp;quot;&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;create_npc&amp;quot;, (trainer,7,6))&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;start_battle&amp;quot;, (StartBattleActionParameters(npc_slug=trainer)))&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;remove_npc&amp;quot;, (trainer,))&lt;br /&gt;
&lt;br /&gt;
This example starts a battle with the NPC with name &amp;quot;professor-rockitten&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Start Random Battle ===&lt;br /&gt;
You can start a random battle by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
   random_encounter&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;random_encounter&amp;quot;, (&amp;quot;default_encounter&amp;quot;,100))&lt;br /&gt;
&lt;br /&gt;
This example will start a battle with monsters from encounter group &amp;quot;default_encounter&amp;quot;. Executing this is the same as stepping into a random encounter area, which will trigger a battle depending on the monster's encounter rate in the encounter group.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use the following commands (in the &amp;quot;normal&amp;quot; shell, not in the python one.):&lt;br /&gt;
    • help — shows all commands&lt;br /&gt;
    • credits — shows the copyright text&lt;br /&gt;
    • exit — exits the game&lt;br /&gt;
    • add_item &amp;lt;slug&amp;gt; [amount] — Adds the item (defined in slug parameter)&lt;br /&gt;
    • set_health &amp;lt;target_level&amp;gt; [slot] — Sets the health of the monster in your party. Must be a number between 0 and 100. If slot argument isn't specified, all monsters in your party will be affected.&lt;br /&gt;
    • random_encounter — Sets you in a wild tuxemon battle, similar to walking in tall grass.&lt;br /&gt;
    • trainer_battle &amp;lt;npc_slug&amp;gt; — Sets you in a trainer battle with specified npc.&lt;br /&gt;
    • trainer_battle list — Gives you a list of fightable trainers.&lt;br /&gt;
    • teleport &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; [map_file] — Teleports you to the specific tile. If map_file argument is specified, you'll get teleported to a selected map file.&lt;br /&gt;
    • whereami — Prints out the map filename&lt;br /&gt;
    • python — Starts the python shell, that you can use to modify the game directly. For advanced users, used in some examples below.&lt;br /&gt;
    • event_sh — Event shell, used to execute event actions manually.&lt;/div&gt;</summary>
		<author><name>VXtreniusX</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18700</id>
		<title>Tuxemon Debug Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18700"/>
		<updated>2021-07-14T16:33:24Z</updated>

		<summary type="html">&lt;p&gt;VXtreniusX: Add new cli commands as an option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tuxemon comes with command line that you can use for debugging purposes. The Tuxemon command line console provides you with a *full* python shell and access to all in-game functions and variables. This page will give you some examples on how you can use the Tuxemon CLI to do things like give yourself monsters or start battles).&lt;br /&gt;
&lt;br /&gt;
== Enabling the CLI ==&lt;br /&gt;
To enable to Tuxemon command line, edit the &amp;lt;code&amp;gt;tuxemon.cfg&amp;lt;/code&amp;gt; configuration file with a text editor and change &amp;lt;code&amp;gt;cli_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://i.imgur.com/hvvblIn.png&lt;br /&gt;
&lt;br /&gt;
After enabling the CLI, run Tuxemon from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python ./tuxemon.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the CLI ==&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
After launching Tuxemon from the command line, you should get a prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To start a python shell, enter the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now get a python shell prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, you can execute arbitrary Python code. To access the game's objects and variables, use &amp;lt;code&amp;gt;self.app&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print self.app&lt;br /&gt;
    &amp;lt;core.tools.Control object at 0x7f4365302e90&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from pprint import pprint&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; pprint(self.app.__dict__)&lt;br /&gt;
    {'animations': {},&lt;br /&gt;
     'caption': 'Tuxemon',&lt;br /&gt;
     'cli': &amp;lt;core.components.cli.CommandLine instance at     0x7f436532bc68&amp;gt;,&lt;br /&gt;
     'clock': &amp;lt;Clock(fps=62.50)&amp;gt;,&lt;br /&gt;
     'config': &amp;lt;core.components.config.Config object at     0x7f4367617810&amp;gt;,&lt;br /&gt;
     'current_music': {'song': None, 'status': 'stopped'},&lt;br /&gt;
     'current_time': 383013,&lt;br /&gt;
     'done': False,&lt;br /&gt;
     'event_actions': {},&lt;br /&gt;
     'event_conditions': {},&lt;br /&gt;
     'event_data': {},&lt;br /&gt;
     'event_engine': &amp;lt;core.components.event.EventEngine object at 0x7f436530c0d0&amp;gt;,&lt;br /&gt;
     'event_persist': {},&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; dir(self.app)&lt;br /&gt;
    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'animations', 'caption', 'cli', 'clock', 'config', 'controller_event_loop', 'current_music', 'current_time', 'done', 'event_actions', 'event_conditions', 'event_data', 'event_engine', 'event_loop', 'event_persist', 'events', 'exit', 'flip_state', 'fps', 'imports', 'joystick_event_loop', 'key_events', 'keyboard_events', 'keys', 'main', 'main_loop', 'network_event_loop', 'network_events', 'player1', 'rumble', 'rumble_manager', 'screen', 'server', 'setup_states', 'show_fps', 'state', 'state_dict', 'state_name', 'time_passed_seconds', 'toggle_show_fps', 'update']&lt;br /&gt;
&lt;br /&gt;
=== Adding Monsters ===&lt;br /&gt;
You can add a monster to your party by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
    add_monster rockitten 20&lt;br /&gt;
&lt;br /&gt;
Or in the python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_monster&amp;quot;, (&amp;quot;rockitten&amp;quot;, 20))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In these examples, we add the monster &amp;quot;rockitten&amp;quot; at level 20 to the player's monsters.&lt;br /&gt;
&lt;br /&gt;
=== Adding Items ===&lt;br /&gt;
You can add an item to your inventory by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
    add_item Potion&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_item&amp;quot;, (&amp;quot;potion&amp;quot;,))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the item &amp;quot;Potion&amp;quot; to the player's inventory.&lt;br /&gt;
&lt;br /&gt;
=== Start NPC Battle ===&lt;br /&gt;
You can start combat by typing the following into the Tuxemon shell:&lt;br /&gt;
    trainer_battle professor-rockitten&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from tuxemon.event.actions.start_battle import StartBattleActionParameters&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; trainer = &amp;quot;professor-rockitten&amp;quot;&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;create_npc&amp;quot;, (trainer,7,6))&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;start_battle&amp;quot;, (StartBattleActionParameters(npc_slug=trainer)))&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;remove_npc&amp;quot;, (trainer,))&lt;br /&gt;
&lt;br /&gt;
This example starts a battle with the NPC with name &amp;quot;professor-rockitten&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Start Random Battle ===&lt;br /&gt;
You can start a random battle by typing the following into the Tuxemon shell:&lt;br /&gt;
&lt;br /&gt;
   random_encounter&lt;br /&gt;
&lt;br /&gt;
Python shell equivalent:&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;random_encounter&amp;quot;, (&amp;quot;default_encounter&amp;quot;,100))&lt;br /&gt;
&lt;br /&gt;
This example will start a battle with monsters from encounter group &amp;quot;default_encounter&amp;quot;. Executing this is the same as stepping into a random encounter area, which will trigger a battle depending on the monster's encounter rate in the encounter group.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use the following commands (in the &amp;quot;normal&amp;quot; shell, not in the python one.):&lt;br /&gt;
    • help — shows all commands&lt;br /&gt;
    • credits — shows the copyright text&lt;br /&gt;
    • exit — exits the game&lt;br /&gt;
    • add_item &amp;lt;slug&amp;gt; [amount] — Adds the item (defined in slug parameter)&lt;br /&gt;
    • set_health &amp;lt;target_level&amp;gt; [slot] — Sets the health of the monster in your party. Must be a number between 0 and 100. If slot argument isn't specified, all monsters in your party will be affected.&lt;br /&gt;
    • random_encounter — Sets you in a wild tuxemon battle, similar to walking in tall grass.&lt;br /&gt;
    • trainer_battle &amp;lt;npc_slug&amp;gt; — Sets you in a trainer battle with specified npc.&lt;br /&gt;
    • trainer_battle list — Gives you a list of fightable trainers.&lt;br /&gt;
    • teleport &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; [map_file] — Teleports you to the specific tile. If map_file argument is specified, you'll get teleported to a selected map file.&lt;br /&gt;
    • whereami — Prints out the map filename&lt;br /&gt;
    • python — Starts the python shell, that you can use to modify the game directly. For advanced users, used in some examples below.&lt;/div&gt;</summary>
		<author><name>VXtreniusX</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18699</id>
		<title>Tuxemon Debug Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18699"/>
		<updated>2021-07-14T11:33:09Z</updated>

		<summary type="html">&lt;p&gt;VXtreniusX: Update the &amp;quot;Start Random Battle&amp;quot; section (and also make it trigger a battle 100% of the times)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tuxemon comes with command line that you can use for debugging purposes. The Tuxemon command line console provides you with a *full* python shell and access to all in-game functions and variables. This page will give you some examples on how you can use the Tuxemon CLI to do things like give yourself monsters or start battles.&lt;br /&gt;
&lt;br /&gt;
== Enabling the CLI ==&lt;br /&gt;
To enable to Tuxemon command line, edit the &amp;lt;code&amp;gt;tuxemon.cfg&amp;lt;/code&amp;gt; configuration file with a text editor and change &amp;lt;code&amp;gt;cli_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://i.imgur.com/hvvblIn.png&lt;br /&gt;
&lt;br /&gt;
After enabling the CLI, run Tuxemon from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python ./tuxemon.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the CLI ==&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
After launching Tuxemon from the command line, you should get a prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start a python shell, enter the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now get a python shell prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, you can execute arbitrary Python code. To access the game's objects and variables, use &amp;lt;code&amp;gt;self.app&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print self.app&lt;br /&gt;
    &amp;lt;core.tools.Control object at 0x7f4365302e90&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from pprint import pprint&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; pprint(self.app.__dict__)&lt;br /&gt;
    {'animations': {},&lt;br /&gt;
     'caption': 'Tuxemon',&lt;br /&gt;
     'cli': &amp;lt;core.components.cli.CommandLine instance at     0x7f436532bc68&amp;gt;,&lt;br /&gt;
     'clock': &amp;lt;Clock(fps=62.50)&amp;gt;,&lt;br /&gt;
     'config': &amp;lt;core.components.config.Config object at     0x7f4367617810&amp;gt;,&lt;br /&gt;
     'current_music': {'song': None, 'status': 'stopped'},&lt;br /&gt;
     'current_time': 383013,&lt;br /&gt;
     'done': False,&lt;br /&gt;
     'event_actions': {},&lt;br /&gt;
     'event_conditions': {},&lt;br /&gt;
     'event_data': {},&lt;br /&gt;
     'event_engine': &amp;lt;core.components.event.EventEngine object at 0x7f436530c0d0&amp;gt;,&lt;br /&gt;
     'event_persist': {},&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; dir(self.app)&lt;br /&gt;
    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'animations', 'caption', 'cli', 'clock', 'config', 'controller_event_loop', 'current_music', 'current_time', 'done', 'event_actions', 'event_conditions', 'event_data', 'event_engine', 'event_loop', 'event_persist', 'events', 'exit', 'flip_state', 'fps', 'imports', 'joystick_event_loop', 'key_events', 'keyboard_events', 'keys', 'main', 'main_loop', 'network_event_loop', 'network_events', 'player1', 'rumble', 'rumble_manager', 'screen', 'server', 'setup_states', 'show_fps', 'state', 'state_dict', 'state_name', 'time_passed_seconds', 'toggle_show_fps', 'update']&lt;br /&gt;
&lt;br /&gt;
=== Adding Monsters ===&lt;br /&gt;
You can add a monster to your party by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_monster&amp;quot;, (&amp;quot;rockitten&amp;quot;, 20))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the monster &amp;quot;rockitten&amp;quot; at level 20 to the player's monsters.&lt;br /&gt;
&lt;br /&gt;
=== Adding Items ===&lt;br /&gt;
You can add an item to your inventory by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_item&amp;quot;, (&amp;quot;potion&amp;quot;,))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the item &amp;quot;Potion&amp;quot; to the player's inventory.&lt;br /&gt;
&lt;br /&gt;
=== Start NPC Battle ===&lt;br /&gt;
You can start combat by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from core.components.event.actions.combat import Combat&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; Combat().start_battle(self.app, (None, '1'))&lt;br /&gt;
&lt;br /&gt;
This example starts a battle with the NPC with ID &amp;quot;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Start Random Battle ===&lt;br /&gt;
You can start a random battle by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;random_encounter&amp;quot;, (&amp;quot;default_encounter&amp;quot;,100))&lt;br /&gt;
&lt;br /&gt;
This example will start a battle with monsters from encounter group &amp;quot;default_encounter&amp;quot;. Executing this is the same as stepping into a random encounter area, which will trigger a battle depending on the monster's encounter rate in the encounter group.&lt;/div&gt;</summary>
		<author><name>VXtreniusX</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18698</id>
		<title>Tuxemon Debug Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18698"/>
		<updated>2021-07-13T08:23:18Z</updated>

		<summary type="html">&lt;p&gt;VXtreniusX: Fix the monster's name in the caption to the &amp;quot;adding monsters&amp;quot; section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tuxemon comes with command line that you can use for debugging purposes. The Tuxemon command line console provides you with a *full* python shell and access to all in-game functions and variables. This page will give you some examples on how you can use the Tuxemon CLI to do things like give yourself monsters or start battles.&lt;br /&gt;
&lt;br /&gt;
== Enabling the CLI ==&lt;br /&gt;
To enable to Tuxemon command line, edit the &amp;lt;code&amp;gt;tuxemon.cfg&amp;lt;/code&amp;gt; configuration file with a text editor and change &amp;lt;code&amp;gt;cli_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://i.imgur.com/hvvblIn.png&lt;br /&gt;
&lt;br /&gt;
After enabling the CLI, run Tuxemon from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python ./tuxemon.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the CLI ==&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
After launching Tuxemon from the command line, you should get a prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start a python shell, enter the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now get a python shell prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, you can execute arbitrary Python code. To access the game's objects and variables, use &amp;lt;code&amp;gt;self.app&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print self.app&lt;br /&gt;
    &amp;lt;core.tools.Control object at 0x7f4365302e90&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from pprint import pprint&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; pprint(self.app.__dict__)&lt;br /&gt;
    {'animations': {},&lt;br /&gt;
     'caption': 'Tuxemon',&lt;br /&gt;
     'cli': &amp;lt;core.components.cli.CommandLine instance at     0x7f436532bc68&amp;gt;,&lt;br /&gt;
     'clock': &amp;lt;Clock(fps=62.50)&amp;gt;,&lt;br /&gt;
     'config': &amp;lt;core.components.config.Config object at     0x7f4367617810&amp;gt;,&lt;br /&gt;
     'current_music': {'song': None, 'status': 'stopped'},&lt;br /&gt;
     'current_time': 383013,&lt;br /&gt;
     'done': False,&lt;br /&gt;
     'event_actions': {},&lt;br /&gt;
     'event_conditions': {},&lt;br /&gt;
     'event_data': {},&lt;br /&gt;
     'event_engine': &amp;lt;core.components.event.EventEngine object at 0x7f436530c0d0&amp;gt;,&lt;br /&gt;
     'event_persist': {},&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; dir(self.app)&lt;br /&gt;
    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'animations', 'caption', 'cli', 'clock', 'config', 'controller_event_loop', 'current_music', 'current_time', 'done', 'event_actions', 'event_conditions', 'event_data', 'event_engine', 'event_loop', 'event_persist', 'events', 'exit', 'flip_state', 'fps', 'imports', 'joystick_event_loop', 'key_events', 'keyboard_events', 'keys', 'main', 'main_loop', 'network_event_loop', 'network_events', 'player1', 'rumble', 'rumble_manager', 'screen', 'server', 'setup_states', 'show_fps', 'state', 'state_dict', 'state_name', 'time_passed_seconds', 'toggle_show_fps', 'update']&lt;br /&gt;
&lt;br /&gt;
=== Adding Monsters ===&lt;br /&gt;
You can add a monster to your party by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_monster&amp;quot;, (&amp;quot;rockitten&amp;quot;, 20))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the monster &amp;quot;rockitten&amp;quot; at level 20 to the player's monsters.&lt;br /&gt;
&lt;br /&gt;
=== Adding Items ===&lt;br /&gt;
You can add an item to your inventory by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_item&amp;quot;, (&amp;quot;potion&amp;quot;,))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the item &amp;quot;Potion&amp;quot; to the player's inventory.&lt;br /&gt;
&lt;br /&gt;
=== Start NPC Battle ===&lt;br /&gt;
You can start combat by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from core.components.event.actions.combat import Combat&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; Combat().start_battle(self.app, (None, '1'))&lt;br /&gt;
&lt;br /&gt;
This example starts a battle with the NPC with ID &amp;quot;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Start Random Battle ===&lt;br /&gt;
You can start a random battle by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from core.components.event.actions.combat import Combat&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; Combat().random_encounter(self.app, (None, '1'))&lt;br /&gt;
&lt;br /&gt;
This example will possibly start a battle with monsters from encounter group &amp;quot;1&amp;quot;. Executing this is the same as stepping into a random encounter area, which may or may not trigger a battle depending on the monster's encounter rate in the encounter group.&lt;/div&gt;</summary>
		<author><name>VXtreniusX</name></author>
	</entry>
	<entry>
		<id>https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18697</id>
		<title>Tuxemon Debug Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.tuxemon.org/index.php?title=Tuxemon_Debug_Console&amp;diff=18697"/>
		<updated>2021-07-12T08:58:26Z</updated>

		<summary type="html">&lt;p&gt;VXtreniusX: Update the method to add monsters and items.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Tuxemon comes with command line that you can use for debugging purposes. The Tuxemon command line console provides you with a *full* python shell and access to all in-game functions and variables. This page will give you some examples on how you can use the Tuxemon CLI to do things like give yourself monsters or start battles.&lt;br /&gt;
&lt;br /&gt;
== Enabling the CLI ==&lt;br /&gt;
To enable to Tuxemon command line, edit the &amp;lt;code&amp;gt;tuxemon.cfg&amp;lt;/code&amp;gt; configuration file with a text editor and change &amp;lt;code&amp;gt;cli_enabled&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
http://i.imgur.com/hvvblIn.png&lt;br /&gt;
&lt;br /&gt;
After enabling the CLI, run Tuxemon from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python ./tuxemon.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using the CLI ==&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
After launching Tuxemon from the command line, you should get a prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start a python shell, enter the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Tuxemon&amp;gt;&amp;gt; python&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now get a python shell prompt that looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;gt;&amp;gt;&amp;gt; &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, you can execute arbitrary Python code. To access the game's objects and variables, use &amp;lt;code&amp;gt;self.app&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Examples'''&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; print self.app&lt;br /&gt;
    &amp;lt;core.tools.Control object at 0x7f4365302e90&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from pprint import pprint&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; pprint(self.app.__dict__)&lt;br /&gt;
    {'animations': {},&lt;br /&gt;
     'caption': 'Tuxemon',&lt;br /&gt;
     'cli': &amp;lt;core.components.cli.CommandLine instance at     0x7f436532bc68&amp;gt;,&lt;br /&gt;
     'clock': &amp;lt;Clock(fps=62.50)&amp;gt;,&lt;br /&gt;
     'config': &amp;lt;core.components.config.Config object at     0x7f4367617810&amp;gt;,&lt;br /&gt;
     'current_music': {'song': None, 'status': 'stopped'},&lt;br /&gt;
     'current_time': 383013,&lt;br /&gt;
     'done': False,&lt;br /&gt;
     'event_actions': {},&lt;br /&gt;
     'event_conditions': {},&lt;br /&gt;
     'event_data': {},&lt;br /&gt;
     'event_engine': &amp;lt;core.components.event.EventEngine object at 0x7f436530c0d0&amp;gt;,&lt;br /&gt;
     'event_persist': {},&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; dir(self.app)&lt;br /&gt;
    ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'animations', 'caption', 'cli', 'clock', 'config', 'controller_event_loop', 'current_music', 'current_time', 'done', 'event_actions', 'event_conditions', 'event_data', 'event_engine', 'event_loop', 'event_persist', 'events', 'exit', 'flip_state', 'fps', 'imports', 'joystick_event_loop', 'key_events', 'keyboard_events', 'keys', 'main', 'main_loop', 'network_event_loop', 'network_events', 'player1', 'rumble', 'rumble_manager', 'screen', 'server', 'setup_states', 'show_fps', 'state', 'state_dict', 'state_name', 'time_passed_seconds', 'toggle_show_fps', 'update']&lt;br /&gt;
&lt;br /&gt;
=== Adding Monsters ===&lt;br /&gt;
You can add a monster to your party by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_monster&amp;quot;, (&amp;quot;rockitten&amp;quot;, 20))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the monster &amp;quot;Fruitera&amp;quot; at level 20 to the player's monsters.&lt;br /&gt;
&lt;br /&gt;
=== Adding Items ===&lt;br /&gt;
You can add an item to your inventory by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action = self.app.event_engine.execute_action&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; action(&amp;quot;add_item&amp;quot;, (&amp;quot;potion&amp;quot;,))&lt;br /&gt;
&lt;br /&gt;
In this example, we add the item &amp;quot;Potion&amp;quot; to the player's inventory.&lt;br /&gt;
&lt;br /&gt;
=== Start NPC Battle ===&lt;br /&gt;
You can start combat by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from core.components.event.actions.combat import Combat&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; Combat().start_battle(self.app, (None, '1'))&lt;br /&gt;
&lt;br /&gt;
This example starts a battle with the NPC with ID &amp;quot;1&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Start Random Battle ===&lt;br /&gt;
You can start a random battle by typing the following into the Tuxemon python shell:&lt;br /&gt;
&lt;br /&gt;
    python&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; from core.components.event.actions.combat import Combat&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; Combat().random_encounter(self.app, (None, '1'))&lt;br /&gt;
&lt;br /&gt;
This example will possibly start a battle with monsters from encounter group &amp;quot;1&amp;quot;. Executing this is the same as stepping into a random encounter area, which may or may not trigger a battle depending on the monster's encounter rate in the encounter group.&lt;/div&gt;</summary>
		<author><name>VXtreniusX</name></author>
	</entry>
</feed>