[Mod] ComputerTest
- Neuromancer
- Member
- Posts: 1014
- Joined: Tue Jun 12, 2012 22:28
- GitHub: Neuromancer56
[Mod] ComputerTest
The point of this mod is to bring something similar to http://www.computercraft.info/ ComputerCraft Mod to Minetest. Especially Turtles.
The cool thing is that ComputerCraft uses lua to program the Turtles. There are already thousands of shared Computer Craft community programs written in lua that make these turtles do things.
In fact there is already a website that lets us create this lua code, along with the entire TurtleAPI using blockly here:
http://blockly-lua.appspot.com/static/a ... index.html
So all that really needs to be done is to create a turtle node that can read lua files, and execute them.
GitHub: https://github.com/Neuromancer56/ComputerTest/
If you want to help out please feel free to ask to become a member of the team!
The cool thing is that ComputerCraft uses lua to program the Turtles. There are already thousands of shared Computer Craft community programs written in lua that make these turtles do things.
In fact there is already a website that lets us create this lua code, along with the entire TurtleAPI using blockly here:
http://blockly-lua.appspot.com/static/a ... index.html
So all that really needs to be done is to create a turtle node that can read lua files, and execute them.
GitHub: https://github.com/Neuromancer56/ComputerTest/
If you want to help out please feel free to ask to become a member of the team!
Last edited by Neuromancer on Tue Mar 11, 2014 00:25, edited 1 time in total.
Mods:Immersive Sounds
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
- Neuromancer
- Member
- Posts: 1014
- Joined: Tue Jun 12, 2012 22:28
- GitHub: Neuromancer56
I got the github set up here: https://github.com/Neuromancer56/ComputerTest/
It contains the basics. It has a turtle node, and a folder called apps with a sample program. I'm looking for help on the trickiest part. Once we get past that, the rest should be straightforward. What I want to happen is this. If the player places a turtle in the world, and punches it (or maybe right clicks it) that should activate the turtle. What that means is that any .lua file in the apps folder under the mod becomes a command. In this case there is a sample file already there called test.lua. So now I want if the user types /test (or something like that) then test.lua is executed. Does anyone know how to do that?
First I guess we need to find out what files are in the apps folder, loop through them, and then do a minetest.register_chatcommand for each filename. Ideas on how to do this?
It contains the basics. It has a turtle node, and a folder called apps with a sample program. I'm looking for help on the trickiest part. Once we get past that, the rest should be straightforward. What I want to happen is this. If the player places a turtle in the world, and punches it (or maybe right clicks it) that should activate the turtle. What that means is that any .lua file in the apps folder under the mod becomes a command. In this case there is a sample file already there called test.lua. So now I want if the user types /test (or something like that) then test.lua is executed. Does anyone know how to do that?
First I guess we need to find out what files are in the apps folder, loop through them, and then do a minetest.register_chatcommand for each filename. Ideas on how to do this?
Last edited by Neuromancer on Sat Jan 25, 2014 14:17, edited 1 time in total.
Mods:Immersive Sounds
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
I had made a mod like that, but not finished it: https://github.com/Novatux/turtle. However, in that one the turtle in programmed in Forth, and there are a few commands still missing, but globally it works... feel free to use it.
Last edited by Nore on Sat Jan 25, 2014 16:00, edited 1 time in total.
- Neuromancer
- Member
- Posts: 1014
- Joined: Tue Jun 12, 2012 22:28
- GitHub: Neuromancer56
Thanks much! It looks like there is quite a bit to this mod. I've placed a turtle and right clicked it, and a dialog comes up with 16 slots, and a box where I can type stuff. I thought I could type test, or turtle.refuel(), but nothing happened. Can you give the basics on how to use the turtle? There's also a square (and I can put objects like coal in here) and a green rectangle. Not sure what they are for.Nore wrote:I had made a mod like that, but not finished it: https://github.com/Novatux/turtle. However, in that one the turtle in programmed in Forth, and there are a few commands still missing, but globally it works... feel free to use it.
How do I fuel the turtle? Stick coal in the first slot and type something?
I think I found the commands that the turtle can execute in turtle.lua get_turtle_funcs. It looks like I call them by doing turtle. forward() etc. But I'm not sure how to fuel the turtle, or get him to run programs.
Last edited by Neuromancer on Sun Jan 26, 2014 22:28, edited 1 time in total.
Mods:Immersive Sounds
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
- Neuromancer
- Member
- Posts: 1014
- Joined: Tue Jun 12, 2012 22:28
- GitHub: Neuromancer56
I found this post that showed and explained how the turtle mod is supposed to work:
viewtopic.php?id=6291
The problem is that the open and save buttons are now gone:

Is this due to maybe this mod not working with Minetest 4.7 and above? (also the code box is gone too.)
viewtopic.php?id=6291
The problem is that the open and save buttons are now gone:

Is this due to maybe this mod not working with Minetest 4.7 and above? (also the code box is gone too.)
Last edited by Neuromancer on Wed Jan 29, 2014 02:40, edited 1 time in total.
Mods:Immersive Sounds
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
Phonics
Eden Game Natural Beauty Textures
Try out dropbox and get me free space: https://db.tt/JjjTr7fl
i created textures for standart pc and turtle
Download: http://ubuntuone.com/6Nl8JUPRrdNUvatdksc098
Download: http://ubuntuone.com/6Nl8JUPRrdNUvatdksc098
- domtron vox
- Member
- Posts: 111
- Joined: Thu Feb 20, 2014 21:07
- GitHub: DomtronVox
- IRC: Domtron
- In-game: Domtron
Just figured this out in my ranksNKits mod.Neuromancer wrote:First I guess we need to find out what files are in the apps folder, loop through them, and then do a minetest.register_chatcommand for each filename. Ideas on how to do this?
Code: Select all
local dir = minetest.get_modpath(minetest.get_current_modname()).."/apps/"
local filenames
--code based off of https://github.com/cornernote/minetest-towntest/blob/master/towntest_chest/init.lua
--its probably linux/mac
if os.getenv('HOME') and kits_dir then
os.execute('ls "'..dir..'" | grep .lua > "'..dir..'/.apps"')
local file, err = io.open(dir..'/.apps', 'rb')
if not err then
filenames = file:lines()
end
os.execute('rm "'..dir..'/.apps"')
--its probably windows
else
filenames = io.popon('dir "'..dir..'"'):lines()
end
if not filenames then
error(Some error message)
else
for filename in filenames do
--do what you need to do
end
end
EDIT: Added a check for when the folder is missing.
Last edited by domtron vox on Sun Mar 30, 2014 02:33, edited 1 time in total.
To make this server friendly, each computer will need a "sandbox" I recomend you google them for more info but basically it isolates the computer and prevents them from having access to functions that they shouldn't. (like all of the minetest.* functions). Here's a post I just made. I think that it is relevant here.
I~=Spam wrote:Hello all! First post! :-)
I am not sure what you are talking about but I have a working lua sandboxed environment in which you can specify what you want to included in the environment and you can also specify specific functions in tables that you want omitted (like string.dump). It even can't take up all of the processing power of the server because I have set a debug hook which, after running a specified number of lua expressions (not lines) it while call the debug hook which temporarily pauses the computer.
Although there is a catch. Sadly it doesn't run in luajit 2.0 or lua5.1. It only works in lua5.2 (might work in luajit1.0 using a third party addon) because in lua5.2 the c stack was changed to allow yielding across c boundaries. Even telling luajit not to compile using jit.off(function) sadly doesn't work. Using lua lanes might work but a new problem comes up (i haven't confirmed this though). All functions that are not in the base library must be re-required. And it is impossible to require the essential "minetest.*" table. Furthermore it is virtually impossible to require other mods that may want to mod comptuercraft.
In other words, I am out of ideas for how to make a lua comptuer mod written in lua due to the fact minetest uses luajit. :-(
I think that this may be possible to do if someone were willing to write some of the mod in c. Although the problem is I am not even sure where the c moder would start. All I would need to get this mod to work is the ability to run a function be able to pause execution of that program periodically (and return to the main program) after a specified number of expressions of lua code.
Last edited by I~=Spam on Fri Apr 18, 2014 17:01, edited 1 time in total.
Re: [Mod] ComputerTest
Progress! In theory I can do this using coroutines despite the problems I mentioned before. The downside though is that it is pretty hackish and abuses the stack somewhat and for this reason I am not sure how many computers will be able to be run at a time. I will post when I have something more presentable if this is possible.
Re: [Mod] ComputerTest
Okay, what works, what not?I~=Spam wrote:Progress! In theory I can do this using coroutines despite the problems I mentioned before. The downside though is that it is pretty hackish and abuses the stack somewhat and for this reason I am not sure how many computers will be able to be run at a time. I will post when I have something more presentable if this is possible.
Re: [Mod] ComputerTest
Help with GUI
I can't understand GUI creating official instructions and i need help with this or find easy tutorial.

Can anyone create or help with creating, and how to change position and more?
thanks in advance, tima_gt.
I can't understand GUI creating official instructions and i need help with this or find easy tutorial.

Can anyone create or help with creating, and how to change position and more?
thanks in advance, tima_gt.
Re: [Mod] ComputerTest
I have pretty much dropped this idea because formspecs are very limited. Don't get me wrong I think that mods aren't run clietside but this decreases the number of mod ideas that are possible to make (in comparison to minecraft) by unimaginable amounts. Doing it this way even adds sequrity to the clients but (as far as I know) it is impossible to create a computercraft equivalent to minetest.
In a nutshell, (according to my current understanding) there cannot be any mod-made custom drawing logic, thus, no computercraft.
Too bad because if it weren't for this I actually would create mods for minetest. (and I would have made computertest by now.)
In a nutshell, (according to my current understanding) there cannot be any mod-made custom drawing logic, thus, no computercraft.
Too bad because if it weren't for this I actually would create mods for minetest. (and I would have made computertest by now.)
- ninnghazad
- Member
- Posts: 36
- Joined: Fri Sep 26, 2014 12:33
- GitHub: ninnghazad
- IRC: ninnghazad
- In-game: ninnghazad
Re: [Mod] ComputerTest
Heho,
electrodude512 and me have something in the workings, and so far the working is good. displays are realized using composite textures, not formspecs. input-however still uses formspecs until proper methods are available in minetest itself. it is not ready for public use, however it is in a state that proves that a mod like computercraft is absolutely possible. there still is the input problem and a mt-bug with textures, but there already are drones (turtles) and the first test-quarries have run. forceloading also is an issue, but well, its 0.4 - so we by no means have exhausted the possibilities.
https://github.com/ninnghazad/dronetest
electrodude512 and me have something in the workings, and so far the working is good. displays are realized using composite textures, not formspecs. input-however still uses formspecs until proper methods are available in minetest itself. it is not ready for public use, however it is in a state that proves that a mod like computercraft is absolutely possible. there still is the input problem and a mt-bug with textures, but there already are drones (turtles) and the first test-quarries have run. forceloading also is an issue, but well, its 0.4 - so we by no means have exhausted the possibilities.
https://github.com/ninnghazad/dronetest
- BirgitLachner
- Member
- Posts: 393
- Joined: Thu May 05, 2016 10:18
- In-game: Bibs
Re: [Mod] ComputerTest
Hello ...
anyone out there!?!
Is there still someone working on this idea? A big problem is in my opinion, that there are so many nearly similiar projects and the guys who started them all should work together ... okay, that's not a simple problem.
I started a new thread viewtopic.php?f=47&t=15665 and was asking for help to realize a Mod like ComputerCraft because this is one thing that are many teacher waiting for before switching to Minetest instead of Minecraft.
In my opinion a Mod to let young users start with programming inside Minetest should offer the following steps, like they are realized in ComputerCraftEDU (http://computercraftedu.com/):
1.) Customize you turtle to have a relationship to your turtle. Change the color and fit it out with some funny accessories.
2.) Have a remote control, connect it with your turtle and move the turtle around by clicking on some buttons that stands for the basic actions of the turtle like movement (forward, backward, up, down, left, right), turn around (90° right or left), take a block (only? in front of the turtle), put a block.
3.) Have a visual editor with blocks that give the syntax like in scratch. It is fantastic that there is already a blockly-like editor for Lua (http://blockly-lua.appspot.com/static/a ... index.html). In this stage the kids should learn the basic possibilities of programming, using if-statements and loops and they can use it to build 3D buildings with their turtle. For more advanced users the possibilities of the turtle should be updated (new texture?) to have sensors and thus more possibilities to use these sensors to build/take blocks depending on the environment.
4.) Next step will be a text-editor. At first the kids can program in the visual-editor and see the code that stands behind that. May be a computer-terminal should be connected to the turtle and an other update of the turtle to have this connection. Cool looking turtles will help to spur the children to improve their programming abilities.
For some programs it would be easier to change little things or copy parts of the code in the text-editor and so hopefully they will move to do more text-coding.
Well ... hopefully nice ideas, but who will do this?
I'm willing to help, but I only have basic knowledge how to build Mods (simple blocks and craftitems). I can draw textures and give some ideas how to improve the appearance of the turtle.
I know some teachers that will create maps to learn programming with the turtle for Minetest because they already did that in Minecraft. And because of the idea of Microsoft only to offer the new Minecraft Education Version for Windows 10 they will switch to Minetest as soon there is an appropriate replacement for ComputerCraft.
Would it be difficult to realize the ideas?
As far as I understand Minetest ...
nr. 1.) should not too difficult to realize. That is like changing the skin of a user and wearing armour. And that is not the most important for the Mod.
nr. 2.) would not be to difficult too, hopefully. Drawing a craftitem and have a formspec (with nice background) for the buttons. The actions would not be too difficult (hopefully) as they are only internal commands to move the block around.
nr. 3.) ... okay ... that will be more difficult ... I don't have any idea how to realize it.
nr. 4.) may be not so difficult as I think that is a bit like programming with digilines. There are already text-editors!
Okay guys ... now give me the punch!!!
anyone out there!?!
Is there still someone working on this idea? A big problem is in my opinion, that there are so many nearly similiar projects and the guys who started them all should work together ... okay, that's not a simple problem.
I started a new thread viewtopic.php?f=47&t=15665 and was asking for help to realize a Mod like ComputerCraft because this is one thing that are many teacher waiting for before switching to Minetest instead of Minecraft.
In my opinion a Mod to let young users start with programming inside Minetest should offer the following steps, like they are realized in ComputerCraftEDU (http://computercraftedu.com/):
1.) Customize you turtle to have a relationship to your turtle. Change the color and fit it out with some funny accessories.
2.) Have a remote control, connect it with your turtle and move the turtle around by clicking on some buttons that stands for the basic actions of the turtle like movement (forward, backward, up, down, left, right), turn around (90° right or left), take a block (only? in front of the turtle), put a block.
3.) Have a visual editor with blocks that give the syntax like in scratch. It is fantastic that there is already a blockly-like editor for Lua (http://blockly-lua.appspot.com/static/a ... index.html). In this stage the kids should learn the basic possibilities of programming, using if-statements and loops and they can use it to build 3D buildings with their turtle. For more advanced users the possibilities of the turtle should be updated (new texture?) to have sensors and thus more possibilities to use these sensors to build/take blocks depending on the environment.
4.) Next step will be a text-editor. At first the kids can program in the visual-editor and see the code that stands behind that. May be a computer-terminal should be connected to the turtle and an other update of the turtle to have this connection. Cool looking turtles will help to spur the children to improve their programming abilities.
For some programs it would be easier to change little things or copy parts of the code in the text-editor and so hopefully they will move to do more text-coding.
Well ... hopefully nice ideas, but who will do this?
I'm willing to help, but I only have basic knowledge how to build Mods (simple blocks and craftitems). I can draw textures and give some ideas how to improve the appearance of the turtle.
I know some teachers that will create maps to learn programming with the turtle for Minetest because they already did that in Minecraft. And because of the idea of Microsoft only to offer the new Minecraft Education Version for Windows 10 they will switch to Minetest as soon there is an appropriate replacement for ComputerCraft.
Would it be difficult to realize the ideas?
As far as I understand Minetest ...
nr. 1.) should not too difficult to realize. That is like changing the skin of a user and wearing armour. And that is not the most important for the Mod.
nr. 2.) would not be to difficult too, hopefully. Drawing a craftitem and have a formspec (with nice background) for the buttons. The actions would not be too difficult (hopefully) as they are only internal commands to move the block around.
nr. 3.) ... okay ... that will be more difficult ... I don't have any idea how to realize it.
nr. 4.) may be not so difficult as I think that is a bit like programming with digilines. There are already text-editors!
Okay guys ... now give me the punch!!!
Last edited by BirgitLachner on Tue Oct 11, 2016 06:49, edited 1 time in total.
- BirgitLachner
- Member
- Posts: 393
- Joined: Thu May 05, 2016 10:18
- In-game: Bibs
Re: [Mod] ComputerTest
Some videos to show informations about ComputercraftEDU:
Trailer: https://youtu.be/5KwAr2gqgXg?t=18s
Playlist with tutorials:
https://www.youtube.com/watch?v=ptH99K2 ... LWnjBH-SPE
Trailer: https://youtu.be/5KwAr2gqgXg?t=18s
Playlist with tutorials:
https://www.youtube.com/watch?v=ptH99K2 ... LWnjBH-SPE
Re: [Mod] ComputerTest
I am currently in school so I don't have a lot of time for something like this but I think that it is possible but I am interested in trying and helping. :) (Well, some of the bullet points are possible.) Unless things have changed, you cannot get feedback as you type into a formspec. So there has to be a submit button for every time you type input into the program. So that means editing files and running turtles will be a bit different. The turtles may not have a command line interface because of that. But for school kids that is not necessarily a bad thing. There could be a list of files that are in turtle's memory in a menu. There could be a big multiline formspec for the lua code. There could be several buttons like run, stop, and save.
About the gui editor I don't exactly think we could get it running inside of minetest because it is written in javascript and it would be a lot of work or not even possible to create in computercraft. BUT we might be able to make the api compatible with computercraft so the web app will be able to create code that can be used to program the turtles in this mod and just copy and paste the lua code. It would be really cool if the computer that is being the minetest server could also run a http server and could have you save the lua script that the student writes directly onto the turtle and then all they have to do is just click run. (Maybe possible?)
About the gui editor I don't exactly think we could get it running inside of minetest because it is written in javascript and it would be a lot of work or not even possible to create in computercraft. BUT we might be able to make the api compatible with computercraft so the web app will be able to create code that can be used to program the turtles in this mod and just copy and paste the lua code. It would be really cool if the computer that is being the minetest server could also run a http server and could have you save the lua script that the student writes directly onto the turtle and then all they have to do is just click run. (Maybe possible?)
- BirgitLachner
- Member
- Posts: 393
- Joined: Thu May 05, 2016 10:18
- In-game: Bibs
Re: [Mod] ComputerTest
What about starting with a remote control? Is this too difficult?
https://youtu.be/JX_JmVp2Vt8?t=12s
Should we start with a new project? I don't want to start it at github as I'm only in the background :-/
I can create some little textures for a beginner turtle
https://youtu.be/JX_JmVp2Vt8?t=12s
Should we start with a new project? I don't want to start it at github as I'm only in the background :-/
I can create some little textures for a beginner turtle
Re: [Mod] ComputerTest
I think that is possible (but maybe not the turtle vision part that depends on how the minetest core lua game is written.) I will look into it later but right now I have to sleep. It is 2am in my timezone. lol
- BirgitLachner
- Member
- Posts: 393
- Joined: Thu May 05, 2016 10:18
- In-game: Bibs
Re: [Mod] ComputerTest
Okay ... just a try ... as github newbie I maybe had a bad start:
https://github.com/BiLachner/TurtleMiner
Anyone is welcome to participate ... just tell my your github name.
https://github.com/BiLachner/TurtleMiner
Anyone is welcome to participate ... just tell my your github name.
- cd2
- Member
- Posts: 562
- Joined: Mon Jun 01, 2015 06:30
- GitHub: cdqwertz
- In-game: cd cd2
- Location: Linux
- Contact:
Re: [Mod] ComputerTest
I am also working on a computer mod for minetest: https://github.com/cdqwertz/computersBirgitLachner wrote:What about starting with a remote control? Is this too difficult?
https://youtu.be/JX_JmVp2Vt8?t=12s
Should we start with a new project? I don't want to start it at github as I'm only in the background :-/
I can create some little textures for a beginner turtle
I think it would be possible to add a turtle/robot.
Re: [Mod] ComputerTest
Hi Birgit...please add me....infchem :)BirgitLachner wrote:Okay ... just a try ... as github newbie I maybe had a bad start:
https://github.com/BiLachner/TurtleMiner
Anyone is welcome to participate ... just tell my your github name.
- BirgitLachner
- Member
- Posts: 393
- Joined: Thu May 05, 2016 10:18
- In-game: Bibs
Re: [Mod] ComputerTest
Cool ... a first Co-Worker ;-) ... I'll start the project from the scratch as I made some faults ... wait a short moment. And I'll start Thread for the Mod today after starting the project correctly.
Re: [Mod] ComputerTest
The computer from this mod appears to work like a terminal,cd2 wrote:I am also working on a computer mod for minetest: https://github.com/cdqwertz/computers.
with some simple commands, eg. clear screen, list files ...
'My' wiki-pages: Build-a-home - basic-robot - basic_robot_csm - basic-machines - digtron - xdecor -
Map-Database
Map-Database