Jump to content


IndustrialLemon's Content

There have been 17 items by IndustrialLemon (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#278515 [MC1.12+][Fork] CC: Tweaked

Posted by IndustrialLemon on 10 November 2018 - 02:16 AM in Peripherals and Turtle Upgrades

Oh so lua has a way of accomplishing the same thing? I've no problem with that so long as I can pick at words from documents and possibly webpages.

EDIT: Also I'm sure there's a better place to report bugs but while I've got you. I just experienced a bug that was so hard to describe. I have a GPS system that runs off of a disk/startup dir and every time I would edit the disk/startup.lua file and save it would save the file with clips of the programming strewn about at the bottom. Every save it was worse. So, in the beginning, it was just a piece of, 'shell.run("gps host "..x, y, z)'. But a couple saves later and it was more like this.
  shell.run("gps host "..x, y, z)
end
t"..x, y, z)
end
end

t"..x, y, z)
en
end
x, y, z

end


Keep in mind everything after the first 'end' was deleted everytime each save before the next.



#278513 [MC1.12+][Fork] CC: Tweaked

Posted by IndustrialLemon on 10 November 2018 - 01:40 AM in Peripherals and Turtle Upgrades

Hey sir, quick question. Are there any plans to add some or all of the features prevalent in the computeacube fork? I really enjoy the regex api and the fact that pocket computers act like maps, but also like the changes that come along with CC:tweaked.



#278510 Here's a quick error problem.

Posted by IndustrialLemon on 09 November 2018 - 03:09 AM in Ask a Pro

Hmm. I thought the whole purpose of painutils.loadImage() was to load a previously drawn image using the 'paint' program. Paint produces .nfp files.



#278508 Here's a quick error problem.

Posted by IndustrialLemon on 09 November 2018 - 01:54 AM in Ask a Pro

Not sure what's going on here.

local loadScreen = paintutils.loadImage("testImage.nfp")
paintutils.drawImage(loadScreen, 1, 1)

The error this code produces is
paintutils.lua:38: attempt to call nil

I understand what attempt to call nil on its own usually means. What's the problem here? I'm trying to apply the same logic but I'm pretty sure my syntax is fine. (Comparing this code directly to the wiki)



Keep in mind.
testImage.nfp DOES exist. It's very real.



#278507 Serialize not placing in order

Posted by IndustrialLemon on 09 November 2018 - 01:15 AM in Ask a Pro

Ah gotcha. Thank you for the in-depth explanation and example.



#278504 Serialize not placing in order

Posted by IndustrialLemon on 08 November 2018 - 03:28 PM in Ask a Pro

Huh, odd. So you are saying that I'd be able to reference it pre-serialization by doing coords[1], coords[2]... I tried that and it only produced nil. But I'll also try the coords.x, coords.y pre and post serialization.

UPDATE : coords.x appears to be working for me! Still confused why I can't seem to reference the table by integer PRE serialization. If I understand you correctly, the serialization is what changes this regular table into a hashmap.



#278501 Serialize not placing in order

Posted by IndustrialLemon on 08 November 2018 - 06:33 AM in Ask a Pro

Hello, took a small break but I'm back with more ideas and more walls to scale. Right now I'm trying to understand why when I utilize textutils.serialise() it results in the table I serialized to be jumbled. I haven't done a whole lot of research so if this is quite obvious I'm sorry. Reason being I'm going to bed soon and I'd just like to get my question in for tomorrow.

over here I have my code for receiver (turtle),
rednet.open("left")
local id, message = rednet.receive("remote")
print(textutils.serialise(message))

and over here I've got the pocket computer I'm sending from and it's code,
local coords = {
    x = 1,
    y = 5,
    z = 2,
    }
rednet.open("back")
rednet.send(9, coords, "remote")

These are test scripts in order to better understand how to deal with sending these variables over rednet so that they can be used as args for a shell.run("goto", ...) function.
The bigger picture reason for this endeavor is to create a function that receives the coords of the player(he/she's pocket computer) and runs goto for the turtle to return to the player.

Anyone's help is of course always appreciated. Thanks guys!



#278500 Issue involving parallel. Help appreciated.

Posted by IndustrialLemon on 08 November 2018 - 06:21 AM in Ask a Pro

Ah tyty



#278470 Issue involving parallel. Help appreciated.

Posted by IndustrialLemon on 04 November 2018 - 07:00 PM in Ask a Pro

Well specifically I was trying to pull his revised version of my program but it hasn't worked for anything thus far. I can 'pastebin put' files but not 'get'.
Here is the link I was using. https://pastebin.com/kvr3tzaD

And here's the error.
Posted Image



#278469 Weird error?

Posted by IndustrialLemon on 04 November 2018 - 06:53 PM in Ask a Pro

I understand that much but I'm still confused because when I would do 'delete CnS/' manually before updating it would still produce that error. Am I just blind?



#278468 Passing information between programs..?

Posted by IndustrialLemon on 04 November 2018 - 06:51 PM in Ask a Pro

View PostBomb Bloke, on 04 November 2018 - 04:10 PM, said:

View PostIndustrialLemon, on 04 November 2018 - 05:54 AM, said:

os.run({}, "other_program.lua")

Generally you won't want to use os.run(): use shell.run() until you've got a solid understanding of environment tables. If your "other program" wants to make use of the shell table for eg, your current method of launching it will cause a crash.

View PostIndustrialLemon, on 04 November 2018 - 05:54 AM, said:

If you could explain in detail why this isn't working

What does it do? What data are you passing in? What data is it passing out?

View PostIndustrialLemon, on 04 November 2018 - 05:54 AM, said:

I already understand the textutils.serialize just breaks a table up so that you can actually play with the variables but that's all I really gather.

Other way around: it constructs a single string representing the full table content. textutils.unserialise() breaks that string back up into a table.


Could you explain why I should be using shell.run over os.run in greater detail? Is an environment table something I can make use of here?

I'm not sure what it actually does. This program came up as something I could salvage if wanting to take 'data' and make a file to hold it so that I could use the other half of the script to pull that data in another program. Though it doesn't seem to work and I don't understand it enough to mess with it properly.

Basically, I don't care how it's done, but I just want to pass information between two programs. At the moment, only one program is running and when it's finished doing Its job it runs another program that grabs the information from it.

If I end up having to run the two programs at the same time sure I can do that. Just help me do it.
If I have to paste my information into a file and grab it later, I can do that too. Just help me do it.
Aaand, if there's a way to pass the information with a simple friggin command that I'm not aware of by all means shout it to me!
Where are the two programs running?

  • Are they on the same CC computer?
  • If not, are they in the same MC dimention?
  • Are they on the same MC server?
Yes, yes, and yes. Playing singleplayer!

Hope this answered both of your questions so that you guys can help answer mine. Thanks



#278462 Weird error?

Posted by IndustrialLemon on 04 November 2018 - 08:19 AM in Ask a Pro

Hey! Me again. Sorry for the incessant posts but I just can't get enough of lua! Been programming my butt off.

Here's the code.
Spoiler

The error I receive when first running the code on a blank computer is this.
startup.lua:19: auto.lua: File Exists
The idea is to be installing a load of programs from the disk/CnS/ dir onto the turtle that's parked by the disk drive.
Afterward, if I check the list of programs under the CnS/ dir, auto.lua is the only one showing up.
There should be a few more than that.
I believe it's attempting to copy the program twice which is producing the error but I cannot for the life of me figure out where it's doing that? I need an extra pair of eyes if anyone is willing to take a look.

Thank you!

OH and don't get the wrong idea I still need help with my other posts! I've got a bunch of different projects that I'm bouncing between.

EDIT:
I've patched my bug but I'm not sure if this is the roundabout way or the exact way I needed to do it.
In order to fix it I simply put fs.delete("CnS/"..disk_commandList) right before the fs.copy(...) and that seems ot have fixed it.



#278461 Passing information between programs..?

Posted by IndustrialLemon on 04 November 2018 - 05:54 AM in Ask a Pro

I'd like to get a solid understand on how I could pass a variable between two different programs. For example, taking variable x = 5 and sending it to another program by sending it and running the other program. os.run({}, "other_program.lua").

I did some research and came across this but even after copying it word for word it's not working. I try some of my own experimentation too, and once again I come up short.
Spoiler
If you could explain in detail why this isn't working or another solution that works that'd be very helpful. I already understand the textutils.serialize just breaks a table up so that you can actually play with the variables but that's all I really gather.



#278460 Issue involving parallel. Help appreciated.

Posted by IndustrialLemon on 04 November 2018 - 04:10 AM in Ask a Pro

Well I'd love to try this and see for myself but I can't get 'pastebin get' to work for me. AND I'm using a later version then 1.8 ( I saw your other post after a quick google search).



#278458 Issue involving parallel. Help appreciated.

Posted by IndustrialLemon on 04 November 2018 - 01:14 AM in Ask a Pro

I believe that's fixed the issue. I'm not sure what's changed since I tried this last but I'll come back here if anything has gone to hell again! Thanks!



#278457 Issue involving parallel. Help appreciated.

Posted by IndustrialLemon on 04 November 2018 - 01:05 AM in Ask a Pro

I tried to use wairForAll before and it wasn't working either.
EDIT: Well on second thought. Let me give that a look.



#278454 Issue involving parallel. Help appreciated.

Posted by IndustrialLemon on 03 November 2018 - 10:15 PM in Ask a Pro

Hi, so here's the rundown.

Trying to countdown from 5 to 0 but also look for a keypress using os.pullEvent("key"). I've managed to get it so that if there is no keypress that it will successfully count all the way down and if there is a keypress that it will cancel the countdown, clear the screen, and NOT continue to print the countdown. However shortly after it clears the screen and prints the new menu it exits out of the script. Not sure why? Maybe someone here could give me a hand! I've tried all sorts of 'return' uses and 'break' uses. Latest endeavor was using a variable to declare the state of the event() function and have the start() function check it routinely.

function test()
   
end
function event()
    runtime = true
    os.pullEvent("key")
    runtime = false
    term.clear()
    term.setCursorPos(1,1)
    term.setTextColor(1)
    term.write("Enter the distance you'd like this CnS bot to dig.")
    while true do
	    local input = io.read()
	    input = tonumber(distance)
	    if distance then
		    break
	    end
	    print("Please enter an actual number.")
    end
end
function start()
    print("By default this CnS bot will mine a distance of 128 blocks")
    print("Press any button to change this value")
    x, y = term.getCursorPos()
    s = 5
    while s > 0 do
	    if runtime == true then
		    term.setTextColor(8)
		    term.write(s)
		    sleep(1)
		    s = s - 1
		    term.setCursorPos(x, y)
	    else
		    break
	    end
    end
end   
parallel.waitForAny(event, start)
    --turtle.getFuelLevel(

Anyone's help would be appreciated! Thank you!