Ask a simple question, get a simple answer

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

ratchet freak

Well-Known Member
Nov 11, 2012
1,198
243
79
I've tried this and it doesn't seem to want to keep the variable. Is it possible for it to write the previous variable to a table/function/etc. I am trying to get this code to be able to have a small as possible frame quarry but have it moving in an ever expanding square.

Is it possible to keep track of redstone output/input amounts then add a +1 with steves factory manager? I am infinitely better at SFM than I am with computer craft.
you will need to read and write to a file,

when a frame moves a computer it reboots it so you need to write a file before moving with info about where in the pattern you are and then read it on startup to resume
 

ratchet freak

Well-Known Member
Nov 11, 2012
1,198
243
79
Or floppy disks? I don't know if that would work (I don't use CC)
that is writing to file CC computers have a file system built in

The only reason floppies are useful (with pastebin get and put being so prevalent) is a turtle building GPS towers (or a turtle army) using a startup script in the floppy
 

jordsta95

New Member
Jul 29, 2019
5,056
-4
1
that is writing to file CC computers have a file system built in

The only reason floppies are useful (with pastebin get and put being so prevalent) is a turtle building GPS towers (or a turtle army) using a startup script in the floppy
/me pretends to understand
Yeah, I guess... well then why not edit the startup to be pastebin get code?
Or does it not reboot the computer?
 

PhilHibbs

Forum Addict
Trusted User
Jan 15, 2013
3,174
1,128
183
Birmingham, United Kingdom
/me pretends to understand
Yeah, I guess... well then why not edit the startup to be pastebin get code?
Or does it not reboot the computer?

I think servers can disallow CC from accessing the internet, otherwise you could set up something that DOS'd the server that it was running on. Also some people feel that having something inside of the Minecraft world that reaches out into the real world is cheating. I don't mind doing it myself interactively as a player, but setting up an automated system that needs the real-world internet to work is not elegant.
 

BarbasTheDog

New Member
Jul 29, 2019
128
0
0
I've tried this and it doesn't seem to want to keep the variable. Is it possible for it to write the previous variable to a table/function/etc. I am trying to get this code to be able to have a small as possible frame quarry but have it moving in an ever expanding square.

Yeah, I see three options:
* Use Framez instead of Funky Locomotion (it has very good CC support and the computer doesn't reset when moved)
* Write the number to a file inside the computer, rescue that value and add 1 to it every iteration up until MAX_INTEGER
* Run the program outside of the frames and have it move the quarry via wireless redstone like PhilHibbs mentioned

In any case, I'd recommend writing the value to a file and reading it every time regardless of where the computer might be. That way, if, for whatever reason, the computer restarts, you'll always be able to resume from where you left off.

/me pretends to understand
Yeah, I guess... well then why not edit the startup to be pastebin get code?
Or does it not reboot the computer?

Yeah, with HTTP enabled, hacking other computers is really the only puspose of floppy disks.

I think servers can disallow CC from accessing the internet, otherwise you could set up something that DOS'd the server that it was running on. Also some people feel that having something inside of the Minecraft world that reaches out into the real world is cheating. I don't mind doing it myself interactively as a player, but setting up an automated system that needs the real-world internet to work is not elegant.

Yes, when I played on a PvP server I had computers around the world that would tell me when something loaded their chunks. And since each computer was very far from the others, I was using some custom HTTP code to comunicate with my main base. It would also send me an email of someone non-whitelisted entered sensor range in my base. Good times... :)
 

ratchet freak

Well-Known Member
Nov 11, 2012
1,198
243
79
/me pretends to understand
Yeah, I guess... well then why not edit the startup to be pastebin get code?
Or does it not reboot the computer?
You can:

Code:
shell.run("pastebin", "get", "<pastebin code>", "startup")
shell.run("startup")

But you might as well use a file copy from the floppy disk to startup

But a turtle placing and setting up freshly auto-crafted computers will need to use a disk drive to have the new computer execute the code they need to execute,

otherwise it turns into chicken-egg problem
 

hisagishi

New Member
Jul 29, 2019
484
0
0
Blah, I am just gonna have to put this quarry coding project on hold for a while. I just don't have time to learn lua (even though it is easy to learn). Just in case anyone was eagerly awaiting something similar, don't wait on me to do it.
 

hisagishi

New Member
Jul 29, 2019
484
0
0
So I decided to take another crack at what should be some simple coding in computer craft.

My problem currently is "startup:4: 'for' limit must be a number"

I assume this is caused by iPulses not being defined at the start of the code.

Is there a command in computercraft that is basically "if variable not defined then = 0"

For reference here is what my code looks like now (Note I have no clue what I am doing and have never coded anything in my life)

pGlCFfp.png
 

BarbasTheDog

New Member
Jul 29, 2019
128
0
0
So I decided to take another crack at what should be some simple coding in computer craft.

My problem currently is "startup:4: 'for' limit must be a number"

I assume this is caused by iPulses not being defined at the start of the code.

Is there a command in computercraft that is basically "if variable not defined then = 0"

For reference here is what my code looks like now (Note I have no clue what I am doing and have never coded anything in my life)

pGlCFfp.png

You will need to read the specific line in which the number is stored and then (maybe) cast it to a number type variable (haven't coded Lua in a while).

fs.open(), if I'm not mistken, just opens the file to be read and assigns it to a variable.

I think what yo want is something along the lines of

file = fs.open("<StoredFile'sName>", "r");
iPulses = fs.read(file, <line>);

PS.: I can't check the wiki right now, but you get the basic gist: assign the opened file to a new variable then read the value of iPulses from said variable.
 

Hambeau

Over-Achiever
Jul 24, 2013
2,598
1,531
213
In the early days (8-bit assembly language) we got by this problem by assigning the variable a temporary value like 0 before trying to use it.
 

Beeze23

New Member
Jul 29, 2019
159
0
0
What's the optimal number of speed upgrades to put in EU liquid transfer nodes per port on a Big Reactor?

(I'm not using a turbine, instead I'm sending steam off to TE dynamos via Ender Tank)

{edit to add}

And more questions:

A: why am I getting no power in either the internal buffer or at the power tap? Does having the fluid taps cause it to over-ride this completely?

B: is 950c still the right approximate temperature for best efficiency?

{/edit to add}
 
Last edited: