rnd wrote:UPDATE: ..
- builtin book browser/editor/code loader
ERROR[Main]: stack traceback:
ERROR[Main]: ...Minetest-Survival\bin\..\mods\_test\basic_robot\init.lua:779: in function 'action_on'
ERROR[Main]: ...test-Survival\bin\..\mods\mesecons\mesecons/internal.lua:190: in function <...test-Survival\bin\..\mods\mesecons\mesecons/internal.lua:183>
ERROR[Main]: ...t-Survival\bin\..\mods\mesecons\mesecons/actionqueue.lua:93: in function 'execute'
ERROR[Main]: ...t-Survival\bin\..\mods\mesecons\mesecons/actionqueue.lua:84: in function <...t-Survival\bin\..\mods\mesecons\mesecons/actionqueue.lua:61>
ERROR[Main]: ...rdner\Minetest-Survival\bin\..\builtin\game\register.lua:369: in function <...rdner\Minetest-Survival\bin\..\builtin\game\register.lua:349>
see also debug-screenshot
hajo wrote:* ROBOTS-server - Server-portrait .. Suggestions/additions/
hajo wrote:* ROBOTS-server - Server-portrait .. Suggestions/additions
* A map at the top of that page ..
Ideas for some more buildings ...
say("done.") self.remove() say("Bye") say("bye")
rnd wrote:UPDATE: .. -bug fixes
-robot now has "energy", .. to dig stuff, 1 energy is expended
dig.forward()
move.forward()
dig.up()
dig.down()
statements after self.remove() are still executed
is there a way to query the current energylevel, and/or a wait/sleep-statement ?
Also, I get the impression that digging only works correctly upto a certain distance between spawner and robot.
About that new farming/fertilizer mod - is that an existing mod,
or do you plan to publish it as a new mod ?
rnd wrote:is there a way to query the current energylevel, and/or a wait/sleep-statement ?
Each new running step robot has 1 energy. that is all. If you want to pause robot thats trivial:
if not pause then ... PROGRAM CODE .. end
while self.energy() < 1.0 do wait(500) end; dig.up()
rnd wrote:digging only works correctly upto a certain distance between spawner and robot.
minetest shuts down all activity thats far from player location ( depends on
settings in minetest.conf, on my server around 3 chunks = 3*16=48 nodes)
hajo wrote:rnd wrote:is there a way to query the current energylevel, and/or a wait/sleep-statement ?
Each new running step robot has 1 energy. that is all. If you want to pause robot thats trivial:
if not pause then ... PROGRAM CODE .. end
With 'pause' I meant 'sleep/wait before each dig, until there is enough energy available,
then continue with dig', preferably with sleep=do-nothing, instead of busy waiting likeYour phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
while self.energy() < 1.0 do wait(500) end; dig.up()
(or wait/sleep until the next 'running step' starts).
After all, how does the bot know the settings of maxdig, energy-allowance / -requirements, etc. ?
rnd wrote:hajo wrote:is there a way to query the current energylevel,
Each new running step robot has 1 energy. that is all.
ok=dig.up()
return false,"not enough energy"
say("Crafting101")
s="default:wood"
--pickup(8); place.forward(s); dig.forward(s)
ok=check_inventory.self(s)
if ok then say(s.." ok") else say("no "..s) end
s="default:stick"
s="doors:door_wood"
ok=craft(s)
if ok then say(s.." ok") else say(s.." fail") end
self.remove()
hajo wrote:* ROBOTS-server - Server-portrait .. Suggestions/additions
* A map at the top of that page ..
Ideas .. Bank ... Info-Point ...
say("Hello")
self.label("working")
say("I'm "..self.name() )
self.remove()
Users browsing this forum: No registered users and 3 guests