GithubHelp home page GithubHelp logo

visual-bots's Introduction

visual-bots

A minetest programmable bot

(c) 2019 Nigel Garnett

Vbots are single block "turtle" style bots, programmable in an entirely visual way. They came into existence to amuse my 5 year old daughters, and teach them the basics of computer programming, without too much writing.

Basics

Punch an idle vbot with an empty hand to make it run it's program (or click the run icon in the menu [see below]).

Punch a running vbot with an empty hand to stop the program.

Right click (double tap on android) to open the menu (see below).

Dig the bot by hitting it with anything except an empty hand, but bear in mind the bot can only be dug out if it's inventory is empty.

The Main menu

Main Menu 1

The icons commands and inventory are used to switch between the 2 panels shown here.

The panel above contains the commands for the bot, which can be added to the current sub-program (the red area on the right) simply by clicking on them.

The panel below shows the inventory panel, with the bot's inventory above, and the players inventory below. This panel is used to add things to the bot's inventory (so it can build with them) or to remove things from the bot's inventory after it has been digging.

Main Menu 2

The trash Trash icon, when pressed, deletes the last instruction on the current sub-program page. Next to this icon is another 1x1 inventory slot which works as a trash can, anything dropped into it is destroyed.

The run run icon, works like punching the bot with an open hand, It starts the program runnng.

The save save icon saves the current program & sub-programs under the name of the bot.

the load load icon allows you to choose and load a program into the bot. Also on this menu are icons which allow the deleting & renaming of programs.

The reset reset icon clears the main program, and all subprograms, but NOT the bot's inventory.

The sub-program panel (the red one on the right) has 7 pages. The Lion icon is the page for the 'Main' program, execution starts here when the bot is activated. The other 6 pages are sub-programs which can be called via the 6 'run sub program' icons at the bottom of the command panel. dinosaur goat horse parrot bear rhino

Movement

forward backward up down Move the bot forward, backward, up or down. Movement will fail if the new position is not empty.

home Move the bot back to the position where the bot was placed. Note: the facing of the bot is NOT restored to it's initial facing direction.

clockwise anticlockwise random These commands turn the bot clockwise, anticlockwise or in a random direction.

Actions

dig up dig down dig These commands make the bot dig the node in that direction, and then move into the place it dug from. Note: digging will fail if the node being dug has protection which the owner of the bot could not dig.

build up build down build These commands make the bot place a block in the noted position (if protection allows and the position is empty). The node placed by the bot is the first thing found in the bot's inventory, starting from the first slot.

Special

speed This pseudo command chooses the speed that the bot runs the program. when followed by a number multiplier it will make the bot run that many times faster. When NOT followed by a number, it resets the bot to normal speed.

Multipliers

x2 x3 x4 x5 x6 x7 x8 x9 The Multipliers work the same for all commands except speed (explained above). For all other commands (including call sub-program commands) they make that command run multiple times.

Example1

forward x4 clockwise x2 forward x4 clockwise x2

This program makes the bot move 4 spaces forward (if possible) then turn 180 degrees, move 4 spaces forward (ie back to the start position) and then turn 180 degrees again to face the initial direction.

Example2

(just example1 using a sub-program)

In the dinosaur dinosaur sub program put the following: forward x4 clockwise x2

Then, in the main lion program ( the lion), just call it twice like this: dinosaur x2

Have fun. Nigel

visual-bots's People

Contributors

nyje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

visual-bots's Issues

vbot cannot place block

When running a vbot program with either of the place-block functions, no blocks are placed. Other functions are executed. I loaded the bot with dirt and sand blocks. The amount of items in the bot's inventory stays the same. On the first run of the vbot I get the following in the console:

2020-11-02 10:01:53: WARNING[Server]: Assignment to undeclared global "def" inside a function at ...5.3.0-dev-linux/bin/../mods/visual-bots/register_bot.lua:91.

This doesn't reappear when running the bot's code again.

save / load problems with subprograms

Your vbot is really helpful to teach programming. Unfortunately on our Server (193.31.25.235 Port 30003) saving doesn't work with subprograms. The code is somehow messed up. Is there a way to fix it? How und where is the code saved on the server?

Player grab is unreliable

Apparently, the player is supposed to be moved by the vbot when standing on it while the vbot moves ("register_bot.lua", line 160). However, this does not work reliably. Sometimes, the player falls off. This is really bad if the vbot is being used as an elevator or moving platform high above, since the player can die arbitrarily.

FYI DoBots

Shameless plug! From reading the description of this mod, it appears to do the same thing as DoBots. Maybe there is something to learn from each other's approaches; unfortunately mine currently only works for ComputerCraft, which means MineCraft rather than MineTest.

Perhaps your children have by this time outgrown visual programming, in which case I can recommend AdaBots, since Ada is a very easy first programming language, being composed more of words than symbols, and having been written from the ground up with clarify of code as a priority.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.