This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Robd's profile picture

Automatic Mining [With server and status display]

Started by Robd, 03 April 2012 - 02:41 AM
Robd #1
Posted 03 April 2012 - 04:41 AM
**Update** Program works as is… could probably use some cleaning up, I'm likely done with development, however.

Pictures:
Spoiler






*thanks to library addict for showing me a better picture upload site


General Information/Future Plans:
SpoilerThis is my first public program. I'm really not sure if I did the best work on this but it functions quite well. The only major draw back I've had is turtles running themselves out of range (which is clearly going to be a problem with any kind of wireless networking.) I do plan to have a "timedout" status when turtles fail to answer several checks on their progress (These occur about once a second.)

The Networking supports up to 12 turtles (although in my experience running more than 5 is going to slow down your computer like you wouldn't believe (another reason I believe this needs work.) The program also does not support turtles returning to their starting position or any kind of manual control although I think those will be quite easy to work in in the not so distant future.

The startup file with the display also supports .monitors by default (just place the computer next to one, reboot and it should display the text.) I don't take any credit for the portion of the script that runs the monitor as I completely snipped that from a reply on here.

I'm fairly new to Lua but I'm definitly experienced in C++. I've been learning by trial and error so feedback is appreciated. I have some pictures I want to add but for now I'll just be showing the scripts. Pictures Added

Installation:

Display & Mainframe:
SpoilerStick the code in the "display" and "mainframe" folders, respectively into a disk and place it somewhere near the system you want to be the display and the system you want to be the mainframe

Turtles:
SpoilerInstall directly onto the turtles system


IMPORTANT:
-There are variables in these scripts for mainframe IDs and display IDs, be sure to change these to the proper IDs that you are using.

All systems should have wireless modems on their back side

Turn on the mainframe and display before turning on any turtles (otherwise they will not connect right on startup)

When adding a new turtle to the network (turning it on) be sure to update your connections in the mainframe or you won't be able to give it commands.

Notes:

This is meant to be a simple, user friendly mining system. I realize that there are many other systems with more functions. This will be a work in progress, and as I've said, I'm fairly new to Lua coding.

I am open to suggestions and tweaks of any kind
libraryaddict #2
Posted 04 April 2012 - 10:26 AM
You can use imgur.com to post pictures.
Robd #3
Posted 04 April 2012 - 04:22 PM
Thank you very much :)/>/> *editted main post*
Wolvan #4
Posted 05 April 2012 - 01:54 AM
Wow! If you want a remote manual control you can use my remote controlled turtle program. You can modify it if you need to. You don't have to give credit me only if you want
Bandus #5
Posted 07 April 2012 - 03:43 AM
I attempted to use this program and encountered some issues. I really would like to use this program though and I was hoping you'd be willing to assist.

Basically, I placed the proper programs from display/mainframe on disks in floppy drives attached to two computers and a monitor. I started up the display, and then the mainframe and it appeared to display everything properly. I then went to 3 turtles and started them, one after another, and checked connection on the mainframe. The display indicated the three turtles were "connected." This is when the trouble started.

I choose the option "Mining" however once I pressed enter on that the "select arrow" went to the right column of the menu but no options were present (i.e. the "select arrow" seemed to be pointing at blank space). I pressed enter again and received a message "You have selected 0 to mine with." I then was presented size choices of 25x25 or 50x50. Selecting one of those caused the turtles to do nothing, though I was able to cancel to go back.

Basically, it seems like despite the turtles reporting they are connected, the mining option isn't showing them as valid choices. Have I done something wrong perhaps?

Edit: I also noticed after playing with it a bit that when I hit "check connections" eventually the mainframe states: "Timed out… Last known connections: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0." This happens despite the display indicating the turtle(s) are connected.
Noodle #6
Posted 07 April 2012 - 03:56 AM
Ima gonna steels your codes.

JK but can I reuse some of it?
Robd #7
Posted 21 April 2012 - 04:23 AM
I attempted to use this program and encountered some issues. I really would like to use this program though and I was hoping you'd be willing to assist.

Basically, I placed the proper programs from display/mainframe on disks in floppy drives attached to two computers and a monitor. I started up the display, and then the mainframe and it appeared to display everything properly. I then went to 3 turtles and started them, one after another, and checked connection on the mainframe. The display indicated the three turtles were "connected." This is when the trouble started.

I choose the option "Mining" however once I pressed enter on that the "select arrow" went to the right column of the menu but no options were present (i.e. the "select arrow" seemed to be pointing at blank space). I pressed enter again and received a message "You have selected 0 to mine with." I then was presented size choices of 25x25 or 50x50. Selecting one of those caused the turtles to do nothing, though I was able to cancel to go back.

Basically, it seems like despite the turtles reporting they are connected, the mining option isn't showing them as valid choices. Have I done something wrong perhaps?

Edit: I also noticed after playing with it a bit that when I hit "check connections" eventually the mainframe states: "Timed out… Last known connections: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0." This happens despite the display indicating the turtle(s) are connected.
That message in your edit means that the display cannot connect to the mainframe. Asuming the turtles are connecting to the display, the connection issue is on the part of the console. For troubleshooting I would say make sure the rednet is open on it (modems will have a red glow somewhat when they are open) and make sure that in the startup file ur modem is on the same side stated. All the bugs you're experiencing seem to fit the diagnosis of a connection problem, let me know how everything works out for you.

Ima gonna steels your codes.

JK but can I reuse some of it?
Go for it, just give me a shiny name tag in your program, i wantz to be famous (that's "please give me some credit" for you non-Gibberish speaking folks)
AndreyKl #8
Posted 22 April 2012 - 12:29 PM
Awesome.
I wonder if anyone created a re-translator program to extend wireless range.
Robd #9
Posted 22 April 2012 - 04:25 PM
Awesome.
I wonder if anyone created a re-translator program to extend wireless range.
You can change the range of modems in your configuration file (take a look at the new computercraft mod page on the forums)
And also, I have actually set up something like that before this happened that I have deleted, if you're a purist and would like that code I can try to make something up for you
libraryaddict #10
Posted 23 April 2012 - 06:35 AM
Its libraryaddict and you don't actually need to post my name in there ^^

One suggestion is this, Finds the modem on the side of the computer. No more "You need modem on back of computer" ;D

function openRednet()
  for _,side in ipairs(rs.getSides()) do
	if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
	  rednet.open(side)
	  return side
	end
  end
  error("No modem attached")
end

Also to extend wireless range, You could have turtles re-broadcasting the messages it hears.
As well as storage the messages in a table for about 3 seconds to compare to new messages, then it deletes the messages.
Else you could have them screaming the same message back and forwards!
Robd #11
Posted 23 April 2012 - 09:18 PM
Its libraryaddict and you don't actually need to post my name in there ^^

One suggestion is this, Finds the modem on the side of the computer. No more "You need modem on back of computer" ;D

function openRednet()
  for _,side in ipairs(rs.getSides()) do
	if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
	  rednet.open(side)
	  return side
	end
  end
  error("No modem attached")
end

Also to extend wireless range, You could have turtles re-broadcasting the messages it hears.
As well as storage the messages in a table for about 3 seconds to compare to new messages, then it deletes the messages.
Else you could have them screaming the same message back and forwards!
Its libraryaddict and you don't actually need to post my name in there ^^

One suggestion is this, Finds the modem on the side of the computer. No more "You need modem on back of computer" ;D

function openRednet()
  for _,side in ipairs(rs.getSides()) do
	if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then
	  rednet.open(side)
	  return side
	end
  end
  error("No modem attached")
end

Also to extend wireless range, You could have turtles re-broadcasting the messages it hears.
As well as storage the messages in a table for about 3 seconds to compare to new messages, then it deletes the messages.
Else you could have them screaming the same message back and forwards!
I've seen codes like that before, honestly never felt like including, but if it's necesarry i supposed i can start

And also, for the wireless ranges, I used a system of relay messages where the relay systems would broadcast the intended ID as part of the message, the receiver would then have to parse the message.
samip #12
Posted 26 April 2012 - 05:23 PM
I got java error when trying to open display so what version of ComputerCraft?
gaiaalpha #13
Posted 30 April 2012 - 02:37 AM
how do you make the larger screens?
Robd #14
Posted 19 May 2012 - 07:30 PM
how do you make the larger screens?


sss
sgs
sss

s = stone
g = glass pane
GhostRecon #15
Posted 25 May 2012 - 09:48 PM
I attempted to use this program and encountered some issues. I really would like to use this program though and I was hoping you'd be willing to assist.

Basically, I placed the proper programs from display/mainframe on disks in floppy drives attached to two computers and a monitor. I started up the display, and then the mainframe and it appeared to display everything properly. I then went to 3 turtles and started them, one after another, and checked connection on the mainframe. The display indicated the three turtles were "connected." This is when the trouble started.

I choose the option "Mining" however once I pressed enter on that the "select arrow" went to the right column of the menu but no options were present (i.e. the "select arrow" seemed to be pointing at blank space). I pressed enter again and received a message "You have selected 0 to mine with." I then was presented size choices of 25x25 or 50x50. Selecting one of those caused the turtles to do nothing, though I was able to cancel to go back.

Basically, it seems like despite the turtles reporting they are connected, the mining option isn't showing them as valid choices. Have I done something wrong perhaps?

Edit: I also noticed after playing with it a bit that when I hit "check connections" eventually the mainframe states: "Timed out… Last known connections: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0." This happens despite the display indicating the turtle(s) are connected.
That message in your edit means that the display cannot connect to the mainframe. Asuming the turtles are connecting to the display, the connection issue is on the part of the console. For troubleshooting I would say make sure the rednet is open on it (modems will have a red glow somewhat when they are open) and make sure that in the startup file ur modem is on the same side stated. All the bugs you're experiencing seem to fit the diagnosis of a connection problem, let me know how everything works out for you.


I'm having this same issue - despite the modems being on back, the Turtle less than 10 blocks away, and the modems with red borders indicating that they're on, I still get the "Timed out… Last known connections:…" error. The Display program and the monitors display that they've connected fine; however, the mainframe can't pick up any of the connections. Can anyone help me? Could it be a block ID problem?
NeonJ #16
Posted 31 May 2012 - 07:06 PM
I attempted to use this program and encountered some issues. I really would like to use this program though and I was hoping you'd be willing to assist.

Basically, I placed the proper programs from display/mainframe on disks in floppy drives attached to two computers and a monitor. I started up the display, and then the mainframe and it appeared to display everything properly. I then went to 3 turtles and started them, one after another, and checked connection on the mainframe. The display indicated the three turtles were "connected." This is when the trouble started.

I choose the option "Mining" however once I pressed enter on that the "select arrow" went to the right column of the menu but no options were present (i.e. the "select arrow" seemed to be pointing at blank space). I pressed enter again and received a message "You have selected 0 to mine with." I then was presented size choices of 25x25 or 50x50. Selecting one of those caused the turtles to do nothing, though I was able to cancel to go back.

Basically, it seems like despite the turtles reporting they are connected, the mining option isn't showing them as valid choices. Have I done something wrong perhaps?

Edit: I also noticed after playing with it a bit that when I hit "check connections" eventually the mainframe states: "Timed out… Last known connections: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0." This happens despite the display indicating the turtle(s) are connected.
That message in your edit means that the display cannot connect to the mainframe. Asuming the turtles are connecting to the display, the connection issue is on the part of the console. For troubleshooting I would say make sure the rednet is open on it (modems will have a red glow somewhat when they are open) and make sure that in the startup file ur modem is on the same side stated. All the bugs you're experiencing seem to fit the diagnosis of a connection problem, let me know how everything works out for you.


I'm having this same issue - despite the modems being on back, the Turtle less than 10 blocks away, and the modems with red borders indicating that they're on, I still get the "Timed out… Last known connections:…" error. The Display program and the monitors display that they've connected fine; however, the mainframe can't pick up any of the connections. Can anyone help me? Could it be a block ID problem?

I get this too. I'm using Tekkit 3 if that helps. I've done the right modem sides and everything, and the modems turn on.

I am confuse!
Robd #17
Posted 01 June 2012 - 09:53 PM
For your issues, there is a variable in the display's script calld "display" change that to the computer ID of the monitor.
eperdeme #18
Posted 03 June 2012 - 09:50 AM
Hello,

The problems seem to be a copy and paste issue in the script.

In the 'fleet' file for the display the top line says 'nframe = 1' this is supposed to say mainframe = X where X is the mainframe number.

it has a similar variable in the file 'startup' on the mainframe, "Display = 1" which needs to be the ID of the display system.
Werzieq #19
Posted 01 September 2012 - 03:00 PM
Does this still work?
MrFrostmaul #20
Posted 15 September 2012 - 01:24 PM
How do you install it, the instructions are not clear for me?
MrFrostmaul #21
Posted 24 September 2012 - 04:09 PM
anyone?
MrHohenheim #22
Posted 09 January 2013 - 08:37 AM
hmm can i download for pastebin get or need to copy CC folder this?
sjkeegs #23
Posted 09 January 2013 - 10:25 AM
hmm can i download for pastebin get or need to copy CC folder this?

The only link provided is the zip file in the OP.