[Mod] Signs Bot [signs_bot]

Post Reply
User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

[Mod] Signs Bot [signs_bot]

by joe7575 » Post

A robot controlled by signs.

Image

The bot can only be controlled by signs that are placed in its path.
After starting, the bot runs in the default direction until it encounters a sign. There, the commands on the sign are processed.
Signs are available for many standard tasks.
There is also a sign that can be programmed by the player, which then is processed by the bot.
But there are not programming skills needed, Bot commands are similar to chat commands.

Videos Tutorials (in German language):
https://youtu.be/odqUJhSBxYY
https://youtu.be/B9-CFvx9X3I
https://youtu.be/_nsvjcQhb6U

Further blocks:
  • Sensors: These can send a signal to an actuator if they are connected to the actuator.
  • Actuators: These perform an action when they receive a signal from a sensor.
Sensors must be connected (paired) with actuators, by means of the Connection Tool. Click on both blocks one after the other. A successful pairing is indicated by a ping / pong noise.

When pairing, the current state of the actuator is important.
The state of the actuator is saved with the pairing and restored by the received signal. For example, the robot can be switched on or off via a node sensor.

An actuator can receive signals from many sensors. A sensor can only be connected to an actuator. However, if several actuators are to be controlled by one sensor, a signal extender block can be used. This connects to a sensor when it is placed next to the sensor. This extender can then be paired with another actuator.

Sensors are:
  • Bot Sensor: sends a signal when the robot passes by
  • Node Sensor: sends a signal when it detects a block (tree, cactus, flower, etc.)
  • Crop Sendor: Sends a signal when, for example, the wheat is fully grown
Actuators are:
  • Control Unit: Can place up to 4 signs and steer the bot e.g. in different directions.
  • Signs Bot Box: Can be turned off and on
  • Bot Chest: Sends a signal depending on the chest state. Possible states are "empty", "not empty", "almost full". The state to be sent is defined while pairing.

In addition, there are currently the following blocks:
  • The duplicator is used to copy Command Signs, i.e. the signs with their own commands.
  • Bot Flap: The "cat flap" is a door for the bot, which he opens automatically and closes behind him.
  • Sensor Extender for controlling additional actuators from one sensor signal


The code is on GitHub.

License
Copyright (C) 2019 Joachim Stolberg
Code: Licensed under the GNU GPL version 3 or later. See LICENSE.txt


Dependencies
default, farming, basic_materials, tubelib2
optional: farming redo, node_io
Attachments
screenshot.png
(119.65 KiB) Not downloaded yet
Last edited by joe7575 on Sun Jul 14, 2019 21:47, edited 1 time in total.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

Sokomine
Member
Posts: 4070
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Signs Bot [signs_bot]

by Sokomine » Post

Looks very cute. I'm sure many players will love the mod if they ever happen to encounter it. Would be nice to have it on a server. Also looks like something that could fit very well into the educational environment.
A list of my mods can be found here.

User avatar
maxx
Member
Posts: 43
Joined: Thu Feb 15, 2018 15:24
GitHub: maxxmodding
In-game: maxx or MrNobody
Location: Germany | Bavaria

Re: [Mod] Signs Bot [signs_bot]

by maxx » Post

The Signs Bot is installed on these two servers:
- Joes Miniwelt (v0.4.17)
- Tech Age Survival (v5)

And of course he’s very cute :)
visit viewtopic.php?f=9&t=19743 to get more information about trainblocks

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

Lift up:

The bot recursively builds a stairway based on a building sign that is placed cyclically and then used again and again (see video).

Image

Video: https://vimeo.com/327372072

Now adapted to techage
Attachments
starway.png
(263.99 KiB) Not downloaded yet
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

Update v1.02:
New program flow commands added for loops and functions:

Code: Select all

    jump <label>    -- jump command, <label> is a word from the characters a-z or A-Z
    <label>:        -- jump label / start of a function
    return          -- return from a function
    repeat <num>    -- start of a loop block, <num> is a number 1..999
    end             -- end of a loop block
    call <label>    -- call of a function (with return via the command 'return')
This allows for example to build a cobble tower around the sign with the script:

Code: Select all

  turn_right
  move 1
  turn_left
  repeat 11
      move_up
      repeat 4
          place_front 0 -1
          move 1
          place_front 0 -1
          move 1
          turn_left
      end
  end
Image
Attachments
bot_tower.png
(155.1 KiB) Not downloaded yet
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

racal
Member
Posts: 68
Joined: Tue May 26, 2020 08:49

Re: [Mod] Signs Bot [signs_bot]

by racal » Post

Can Signs Bot be used to fix defective tubelib items? Say:
  1. Get repair kit from chest
  2. Travel to defective tubelib node
  3. Punch defective tubelib item with repair kit
Wondering if this can be done to fully automate (or almost to near automation) a harvest/quarry system.

PS... Might as well enable Signs Bot to replace SmartLine/SaferLua Controller dead batteries. :D

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

racal wrote:
Thu Jun 04, 2020 06:56
Can Signs Bot be used to fix defective tubelib items?
Currently not, but would be possible.
The question is: How shall the bot know, if any node is defect?
Of course, you can use a bot that visits all relevant nodes cyclically and tries to fix them.

But does this make sense? If a server owner enables the "machine ageing" feature to keep the players busy, is it a good idea to provide a way to bypass this feature?

The same goes for the battery.
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

racal
Member
Posts: 68
Joined: Tue May 26, 2020 08:49

Re: [Mod] Signs Bot [signs_bot]

by racal » Post

I'm trying to farm/harvest a 3x3 flower bed using signs_bot but can't seem to do so. Here's my setup:
+signs_bot cutting
Isn't the set of commands just:
+signs_bot commands
But somehow the cutting command does not work; the bot would just stay there and do nothing. What am I missing?

Also, how do you detect the central flower using the node sensor? Found the answer on the wiki:
Node Sensor: Sends a signal when it detects a change (tree, cactus, flower, etc.) in front of the sensor (over 3 positions)
Thanks.

PS...

A couple of hiccups which I was able to solve:
  1. Just realized bots needed to be charged. I've tried out signs_bot before but don't recall them needing some form of fuel/power to run/start them. I guess you need to charge them (connect to a power grid/source) if you're using it with techage mod(?).
  2. You need to run signs_bot first (without commands/signs) before you pair it with a sensor to enable/trigger "on" on sensors.

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

The Signs Bot has the same Ethereal problem with the flowers as Techage. It can't work, I have to fix that first...
racal wrote:
Wed Jul 08, 2020 09:45
  1. Just realized bots needed to be charged. I've tried out signs_bot before but don't recall them needing some form of fuel/power to run/start them. I guess you need to charge them (connect to a power grid/source) if you're using it with techage mod(?).
  2. You need to run signs_bot first (without commands/signs) before you pair it with a sensor to enable/trigger "on" on sensors.
2x Yes
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

racal
Member
Posts: 68
Joined: Tue May 26, 2020 08:49

Re: [Mod] Signs Bot [signs_bot]

by racal » Post

joe7575 wrote:
Wed Jul 08, 2020 10:22
The Signs Bot has the same Ethereal problem with the flowers as Techage. It can't work, I have to fix that first...
OK.

The dig command works well, though, as an alternative for the time being. :D

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

I fixed the flower issue. Update on GitHub

Instead of your own sign, you can also use the flower sign. Place it in front of the flower field.
+Image
Attachments
growlight.png
(221.91 KiB) Not downloaded yet
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

racal
Member
Posts: 68
Joined: Tue May 26, 2020 08:49

Re: [Mod] Signs Bot [signs_bot]

by racal » Post

How far can signs bots build/move -- how many mapblocks? Will they build/move on/through loaded/unloaded mapblocks?

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

It should also work in unloaded areas
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

racal
Member
Posts: 68
Joined: Tue May 26, 2020 08:49

Re: [Mod] Signs Bot [signs_bot]

by racal » Post

Couple of queries...

I'm trying to dig a 16 x 16 x 1 area (where 1 is the height of the area) using the "sign command" but the signs bot just ends up digging just half of the area. I've also tried laying blocks (same dimensions, 16 x 16 x 1) and it also ends up placing blocks almost half of the area. So, as a workaround, I just ended up running the signs bot twice, i.e. dig/lay blocks in a 16 x 8 x 1 fashion. At first I thought it was a bug then later realized the bot ends up losing power since techage mod is also installed.

Is there a way to increase the power the signs bot can hold? I'm trying to decipher which file/line to tweak to extend the signs bot power capacity. Is it this file/line?

local CYCLE_TIME = 4 in signs_bot/techage.lua

Second, I'm stumped on where to use/apply this command:

low_batt <percent>

Thanks.

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

To increase the power capacity / endurance, change the line 26 in basis.lua

Code: Select all

signs_bot.MAX_CAPA = 600
But I will make it configurable.

The command low_batt <percent> is used to query the battery charge in percent. If the value falls below this, the bot switches off.

Here are the commands of a sign to dig a tunnel. The low_batt command ensures that a row is always completed and the sign is set up again.

Code: Select all

dig_sign 1
move 1
dig_left 1 0
dig_front 1 0
dig_right 1 0
dig_left 1 +1
dig_front 1 +1
dig_right 1 +1
place_sign 1
low_batt 7
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

racal
Member
Posts: 68
Joined: Tue May 26, 2020 08:49

Re: [Mod] Signs Bot [signs_bot]

by racal » Post

joe7575 wrote:
Tue Jul 21, 2020 11:58
To increase the power capacity / endurance, change the line 26 in basis.lua

Code: Select all

signs_bot.MAX_CAPA = 600
But I will make it configurable.
Got it, thanks.
joe7575 wrote:
Tue Jul 21, 2020 11:58
The command low_batt <percent> is used to query the battery charge in percent. If the value falls below this, the bot switches off.

Here are the commands of a sign to dig a tunnel. The low_batt command ensures that a row is always completed and the sign is set up again.

Code: Select all

dig_sign 1
move 1
dig_left 1 0
dig_front 1 0
dig_right 1 0
dig_left 1 +1
dig_front 1 +1
dig_right 1 +1
place_sign 1
low_batt 7
Sorry -- why did you use 7 in low_batt 7 in this case? How do you determine/estimate at what power percentage will the bot switch off? Is it: 1 action = 1 percent power usage?

User avatar
joe7575
Member
Posts: 456
Joined: Mon Apr 24, 2017 20:38
GitHub: joe7575
In-game: JoSto
Location: Germany, in the deep south

Re: [Mod] Signs Bot [signs_bot]

by joe7575 » Post

racal wrote:
Thu Jul 23, 2020 15:05
Is it: 1 action = 1 percent power usage?
No, 1 action is one point from tha capa value
I don't remember, where the value 7 comes from, it is some kind of experience value :)
Sent from my Commodore 64. Some of my Mods: Tech Age, TechPack, Hyperloop, Tower Crane, Lumberjack, Iron Age, Minecart, Signs Bot.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests