<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Mods%2Fbasic_robot%2FRC</id>
	<title>Mods/basic robot/RC - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Mods%2Fbasic_robot%2FRC"/>
	<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;action=history"/>
	<updated>2026-04-24T13:24:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.4</generator>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=12418&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:28, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=12418&amp;oldid=prev"/>
		<updated>2021-04-18T05:28:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:28, 17 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=8653&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:28, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=8653&amp;oldid=prev"/>
		<updated>2021-04-18T05:28:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:28, 17 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=4888&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:28, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=4888&amp;oldid=prev"/>
		<updated>2021-04-18T05:28:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:28, 17 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
	<entry>
		<id>https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=1123&amp;oldid=prev</id>
		<title>&gt;Voxel at 05:28, 18 April 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.minetest.org/index.php?title=Mods/basic_robot/RC&amp;diff=1123&amp;oldid=prev"/>
		<updated>2021-04-18T05:28:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Mods/basic_robot_RC}}&lt;br /&gt;
&lt;br /&gt;
==Intro==&lt;br /&gt;
[[File:BasicRobot-colored-RC.png|thumbnail|Spawner and basic_robot, remotecontrol with colored buttons]]&lt;br /&gt;
This page is dedicated to using [[Mods/basic robot|basic_robot]]s with a remote.&amp;lt;br /&amp;gt;&lt;br /&gt;
A remotecontrol (rc for short) can be used to give orders to a robot.&lt;br /&gt;
&lt;br /&gt;
The rc has 2 modes:&lt;br /&gt;
* manual (leftclick) - without any programming, it shows a form with buttons for moving, turning and digging.&lt;br /&gt;
: Each keypress causes the robot to do one action.&lt;br /&gt;
: This mode is quite useful for mining, because the robot can dig faster then the player.&lt;br /&gt;
&lt;br /&gt;
* programming (rightclick) - shows a small textarea for entering a few lines of code, an id-field, and a SAVE-button.&lt;br /&gt;
: Each click of the remote will cause the robot to execute &lt;br /&gt;
: the code in the textarea once&lt;br /&gt;
&lt;br /&gt;
The id-setting determines which remote controls which robot.&amp;lt;br /&amp;gt;&lt;br /&gt;
So, you can have several robots active at once, and control them with different remotes.&lt;br /&gt;
&lt;br /&gt;
==How to get==&lt;br /&gt;
===Chat-commands===&lt;br /&gt;
: Get a robot-spawner: &amp;quot;/giveme basic_robot:spawner&amp;quot; &lt;br /&gt;
: Get a remote:        &amp;quot;/giveme basic_robot:control&amp;quot;&lt;br /&gt;
This only works in singleplayer, in creative-mode, or for the server-admin.&lt;br /&gt;
&lt;br /&gt;
===Craft===&lt;br /&gt;
Recipe for a spawner:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| M || M || M&lt;br /&gt;
|-&lt;br /&gt;
| M || M || M&lt;br /&gt;
|-&lt;br /&gt;
| S || I || S&lt;br /&gt;
|}&lt;br /&gt;
with M=mese_crystal, S=stone, I=steel_ingot.&amp;lt;br /&amp;gt;&lt;br /&gt;
Cost to build: 6 mese-crystals, 2 stone, 1 steel_ingot.&lt;br /&gt;
&lt;br /&gt;
Recipe for a remotecontrol :&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| s&lt;br /&gt;
|-&lt;br /&gt;
| M&lt;br /&gt;
|}&lt;br /&gt;
with M=mese_crystal, s=stick. &amp;lt;br /&amp;gt;&lt;br /&gt;
Cost to build: 1 mese-crystal, 1 stick.&lt;br /&gt;
&lt;br /&gt;
===Buy (at ROBOTS-Server)===&lt;br /&gt;
On the robots-server at 46.150.38.198:30000, you can simply buy a robot and a remote, &lt;br /&gt;
at the shop next to the spawn-building.&amp;lt;br /&amp;gt;&lt;br /&gt;
The current price is 2 gold-ingots for a spawner and 1 gold for a remote, &lt;br /&gt;
so they are really cheap.&lt;br /&gt;
&lt;br /&gt;
==Demo==&lt;br /&gt;
===Report position 1===&lt;br /&gt;
Place the spawner on the ground, and put the remote on the hotbar.&lt;br /&gt;
&lt;br /&gt;
Rightclick the spawner, enter this program:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 -- Report position of spawner and robot:&lt;br /&gt;
 if not p0 then&lt;br /&gt;
   p0 = self.spawnpos()&lt;br /&gt;
   say(&amp;quot;Spawner-position x=&amp;quot;..p0.x..&amp;quot; y=&amp;quot;.. p0.y..&amp;quot; z=&amp;quot;.. p0.z)&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 -- Report position of robot: &lt;br /&gt;
 p1 = self.pos()&lt;br /&gt;
 say(&amp;quot;Robot-position x=&amp;quot;..p1.x..&amp;quot; y=&amp;quot;.. p1.y..&amp;quot; z=&amp;quot;.. p1.z)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Press the SAVE-button.&lt;br /&gt;
* Press the START-button.&lt;br /&gt;
* Leftclick the remote, to bring up the manual control, and guide the robot around.&lt;br /&gt;
&lt;br /&gt;
The robot should report the position of the spawner once,&lt;br /&gt;
and its current position on every tick.&amp;lt;br /&amp;gt;&lt;br /&gt;
:This works, but fills the chat with text from all those position-reports.&lt;br /&gt;
Running this on a server in multiplayer would require some changes.&lt;br /&gt;
&lt;br /&gt;
===Report position 2===&lt;br /&gt;
* Rightclick the spawner, enter this program:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 -- Report position of spawner:&lt;br /&gt;
 if not p0 then&lt;br /&gt;
   p0 = self.spawnpos()&lt;br /&gt;
   say(&amp;quot;Spawner-position x=&amp;quot;..p0.x..&amp;quot; y=&amp;quot;.. p0.y..&amp;quot; z=&amp;quot;.. p0.z)&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Press the SAVE-button.&lt;br /&gt;
* Press the START-button.&lt;br /&gt;
&lt;br /&gt;
* Rightclick the remote, while pointing at nothing&lt;br /&gt;
: as in, pointing at the sky, or at nodes out of range&lt;br /&gt;
* enter this program:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 -- Report position of robot:&lt;br /&gt;
 p1 = self.pos()&lt;br /&gt;
 say(&amp;quot;Robot-position x=&amp;quot;..p1.x..&amp;quot; y=&amp;quot;.. p1.y..&amp;quot; z=&amp;quot;.. p1.z)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Press the SAVE-button.&lt;br /&gt;
* Leftclick the remote.&lt;br /&gt;
Like above, the spawner-position is reported only once,&amp;lt;br /&amp;gt;&lt;br /&gt;
but now the robot-position is reported only once for each leftclick on the remote.&lt;br /&gt;
&lt;br /&gt;
As that remote is in program-mode now,&amp;lt;br /&amp;gt;&lt;br /&gt;
we need another, 'empty' remote to steer the robot around.&lt;br /&gt;
:So, for a good start, get 1 spawner, and 2-3 remotes.&lt;br /&gt;
&lt;br /&gt;
==Apps==&lt;br /&gt;
This page has a focus on small, useful programs,&lt;br /&gt;
and programs for the remote.&lt;br /&gt;
&lt;br /&gt;
===Report distance===&lt;br /&gt;
The robot only works well if spawner, player and robot are close enough together.&amp;lt;br /&amp;gt;&lt;br /&gt;
The reason is, that in minetest actions only happen &lt;br /&gt;
within a few blocks around the player(s),&amp;lt;br /&amp;gt;&lt;br /&gt;
and the server might unload 'unused' blocks from memory.&amp;lt;br /&amp;gt;&lt;br /&gt;
This distance depends on the server-setting, usually 3-5 blocks.&lt;br /&gt;
:Where a block is 16x16x16 nodes.&lt;br /&gt;
&lt;br /&gt;
Here, we calculate the distance between spawner and robot:&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Spawner:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 -- Report position of spawner:&lt;br /&gt;
 if not p0 then&lt;br /&gt;
   p0 = self.spawnpos()&lt;br /&gt;
   say(&amp;quot;Spawner-position x=&amp;quot;..p0.x..&amp;quot; y=&amp;quot;.. p0.y..&amp;quot; z=&amp;quot;.. p0.z)&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Remote:'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 -- Distance between spawner and robot:&lt;br /&gt;
 p0=self.spawnpos(); p1=self.pos()&lt;br /&gt;
 dx=math.abs(p0.x-p1.x); dy=math.abs(p0.y-p1.y); dz= math.abs(p0.z-p1.z)&lt;br /&gt;
 md=dx+dy+dz  -- Manhatten-distance&lt;br /&gt;
 msg=&amp;quot;Robot-position x=&amp;quot;..p1.x..&amp;quot; y=&amp;quot;.. p1.y..&amp;quot; z=&amp;quot;.. p1.z  --say(msg)&lt;br /&gt;
 self.label(&amp;quot;Distance: &amp;quot;..md)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Here, we calculate the distance as the [https://en.wikipedia.org/wiki/Taxicab_geometry Manhatten-distance].&lt;br /&gt;
&lt;br /&gt;
===Build bridge===&lt;br /&gt;
This 'paves' a walkable bridge, even over water or thru the air.&amp;lt;br /&amp;gt;&lt;br /&gt;
Robot needs the building material in its inventory when starting.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 dig.forward_down()&lt;br /&gt;
 place.forward_down(&amp;quot;default:dirt&amp;quot;)&lt;br /&gt;
 --place.forward_down(&amp;quot;default:cobble&amp;quot;)&lt;br /&gt;
 move.forward()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Todo==&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
[[Category:Mods]]&lt;/div&gt;</summary>
		<author><name>&gt;Voxel</name></author>
	</entry>
</feed>