Mods/basic robot/Todo: Difference between revisions

From Minetest
>Voxel
(mods do not need their own category)
 
>Voxel
(mods do not need their own category)

Revision as of 13:45, 8 April 2021

Todo/WIP

Mods/basic_robot/Todo

Examples that don't work yet.

Sandbox-Test

The code-check doesn't ignore comments:

 if not pn then pn="sandbox-test 2017-03-03"; say(pn)
 
 say("Test0: ")   -- works
 size=1000
 for x = 1,size do  
  say(x) 
 end
 
 s="Test1 "  -- works
 size=1000
 for x = 1,size do  say(s..x) end
 
 s="Test2 with func_tion " -- works
 size=1000
 for x = 1,size do  say(s..x) end
 
 s="Test3 "; say(s)   -- stops
 -- this is not a function   --!! causes 'Exec.count exceeded'
 size=100
 for x = 1,size do  say(s..x) end

 --fun_ction bla(x) return "xx" end
 end
 
 self.remove()


Todo1 - Dig6

(Fixme - issue with sandbox)

Dig one block in every direction.

This comes in handy when the detector says "found X within range 2".
dig.forward()  dig.backward()
dig.left() dig.right()
dig.up()   dig.down()

Todo2 - DigDownstairs

(Fixme - issue with sandbox)

Digs one step downstairs with each buttonpress.

dig.forward()   dig.down()  dig.up() 
move.forward()  move.down()

Or:

dig.down() turn.left()
dig.up()   turn.right()
dig.forward()
move.forward()  move.down()

Caution: don't run this as-is on the spawner, or without moving the robot first.
Because that first "dig.down()" would destroy the spawner,

...

Todo3

Todo / Ideas:

  • dig/check all 3x3x3 blocks around position
  • dig/check all visible stone-blocks within a radius of 3 blocks
  • dig a shaft/staircase up/down

...

type()

 i=1  t=type(i)  say(i.." -->"..t)
 i="Hi"  say(i.." -->"..type(i) )
 p=self.pos()  say(p.x..","..p.y..","..p.z.."--> "..type(p))
 i=read_node.down()  say(i.." -->"..type(i) )
 --
 self.remove()

Bugs

if i==nil then say("Test")  i=0 end

i=i+1
say("while dogs are cute, cats are also cute") 

if i then say("done.") self.remove()  end

...