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

delete command

Started by gustavowizard, 07 June 2014 - 07:09 AM
gustavowizard #1
Posted 07 June 2014 - 09:09 AM
after i delete i file using the delete 'filename' on the computer, is there a way to recover it?

i lost a 300 line program cause i broke a label computer on creative mode, and deleted the program on the copy but to my shock i lost it on both computers (they act as same ID so they are the same for the game )

i wish undelete works, the file is not on my trashcan :(/>
Lyqyd #2
Posted 07 June 2014 - 09:23 AM
There is no easy way to recover a file you've deleted in-game.
Bomb Bloke #3
Posted 07 June 2014 - 09:43 AM
If you're using Windows 7, right-clicking folders in Windows Explorer may give you the option to restore previous versions of them (along with their previous contents, more to the point). It's a bit hit-and-miss as to whether there'll be a copy you're interested in available, but worth looking into if you're on that OS.

Otherwise, you might be able to pull the file back with Recuva or similar.
jaffacakesareamazing #4
Posted 07 June 2014 - 12:30 PM
It is annoying losing a program, I lost something with a similar amount of characters, you could look inside your .minecraft/[insert world name here]/computer/ and have a look through to see if you can see the ID of the computer and see if it is there, and also see if the program has not duplicated itself onto other computers :)/> Good luck
gustavowizard #5
Posted 07 June 2014 - 08:29 PM
well the program was not that complex just to many lines (300 so far) but i bet there is a 'smaller' way to do that anyway, i will make another one no biggy, thanks guys
gustavowizard #6
Posted 07 June 2014 - 08:50 PM
im doing the program again, its like a encyclophedia, as you guys can see on the code below, each planet takes a lot of lines, we have like 15 bodies on the solar system and 4-space mod now :D/> i was wandering if there is a 'shorter' way to code this:


monitor = peripheral.wrap("top")
monitor.setTextScale(0.5)
while true do
term.clear()
term.setCursorPos(1,1)
print("REAL LIFE SOLAR PLANET INFO - by Wizard")
print("")
print("Type the celestial body name (no Caps):")
local input = read()
if input == "earth" then
term.redirect(monitor)
monitor.clear()
monitor.setCursorPos(10,20)
monitor.write("EARHT")
monitor.setCursorPos(4,21)
monitor.write("(Terrestrial Planet)")
monitor.setTextColor(colors.cyan)
monitor.setCursorPos(30,3)
monitor.write("ORBITAL CHARACTERISTICS")
monitor.setCursorPos(30,9)
monitor.write("PHYSICAL CHARACTERISTICS")
monitor.setCursorPos(30,15)
monitor.write("ATMOSPHERE")
monitor.setTextColor(colors.white)
monitor.setCursorPos(30,4)
monitor.write("Aphelion: 152.098.232 Km")
monitor.setCursorPos(30,5)
monitor.write("Perihelion: 147.098.290 Km")
monitor.setCursorPos(30,6)
monitor.write("Orbital Period: 365 days")
monitor.setCursorPos(30,7)
monitor.write("Satellite: YES (1)")
monitor.setCursorPos(30,10)
monitor.write("Mean Radius: 6.371 Km")
monitor.setCursorPos(30,11)
monitor.write("Surface Gravity: 1g (100%)")
monitor.setCursorPos(30,12)
monitor.write("Rotation Period: 24h")
monitor.setCursorPos(30,13)
monitor.write("Mean Temperature: 15 C")
monitor.setCursorPos(30,16)
monitor.write("Nitrogen 78%, Oxygen 21%")
monitor.setCursorPos(30,17)
monitor.write("Water Vapor 1%")
monitor.setCursorPos(30,18)
monitor.write("Traces of Argon and CO2")
image = paintutils.loadImage("earth.nfp")
paintutils.drawImage(image,2,5)
term.redirect(term.native())
else
end
end

http://pastebin.com/mL7ugEt5
Lyqyd #7
Posted 07 June 2014 - 08:51 PM
You'd be better off storing the data in a table and writing a function that parses and displays the data in the table.
Lignum #8
Posted 07 June 2014 - 09:03 PM
You should also consider making your variables local since there could be conflicts with other programs.
Link149 #9
Posted 08 June 2014 - 04:50 AM
I recommend you back-up your files next time. :)/>
gustavowizard #10
Posted 08 June 2014 - 05:08 AM
You should also consider making your variables local since there could be conflicts with other programs.


other programs? of the same or other computers? cause this computer will only run this program

You'd be better off storing the data in a table and writing a function that parses and displays the data in the table.

still too noob lol dont know how to set tables yet

There is no easy way to recover a file you've deleted in-game.

hey man im trying to make a program to use your ccsensor of entity to make a radar, like it show the entity like a colored pixel on the monitor, moving around, just like your sensorview but instead of showing the coordinates just show 1 pixel
any idea how to do it or you know a tutorial for that?
thank you again man
Lyqyd #11
Posted 08 June 2014 - 05:54 AM
The easiest way would be to simply use the x and z relative coordinates to set the cursor position and draw a space character.
Lignum #12
Posted 08 June 2014 - 10:08 AM
other programs? of the same or other computers? cause this computer will only run this program
On the same computer. It's still good practice to make them local, however.