Request how to automate mining turtle with charging station

Echo_Beta

New Member
Jul 29, 2019
9
0
0
Well as the title says I am looking for a command or something where when the turtle returns to the chest to drop off items it also refuels from the charging station next to it to a certain fuel level(Say 1500 or more). I have a set up now where it returns however once it is done dropping off its cargo, then the mining turtle will go off without charging to a high level.. It comes back and repeats until it has such low energy that it stops mining effective..

If there is another post that is like mine that you could link me as well, that would be great. Ive checked most places and still havent found the code i am looking for.

Btw its on SMP and I am not a server admin so i cant paste the code to the folder.
 

a.lie

New Member
Jul 29, 2019
8
0
0
Code:
while turtle.getFuelLevel() < TargetFuel then
  sleep(10)
end

You should know where to put this :)
 

Echo_Beta

New Member
Jul 29, 2019
9
0
0
Well i am a bit of new at this ;)

Could you inform me how to get to where i need to place this? Thanks a ton!
 

Guswut

New Member
Jul 29, 2019
2,152
0
0
Could you inform me how to get to where i need to place this?

Firstly, you are going to either need to replace TargetFuel with the amount of fuel you want, or set the variable TargetFuel earlier in the code to the variable you want to use.

After that, you place that loop right after the cargo-to-chest code.
 

Echo_Beta

New Member
Jul 29, 2019
9
0
0
Well i placed it in, (I think in the right place, again new at this) however when i try to save it i get Acess Denied.. does that mean i need to create another program with the change to refuel automatically off the charging staiton?

Also it would help me if i knew exactly after what line to place it in (as I am not 100% sure i placed it after the right one lol)
 

Echo_Beta

New Member
Jul 29, 2019
9
0
0
Like i go into rom/programs/turtle and edit the excavate command.. however i cant save since its the rom (which i heard you cant edit).. is there anyway i can get a script that i can past that command for refuel into and the past that as a seperate command next to the rom but not in it?

Am i understanding this right now?

Sorry for 2nd post.

And also sorry for my lack of knowledge on these things, first time trying to program something in computercraft. /o\
 

Echo_Beta

New Member
Jul 29, 2019
9
0
0
Okay.. well im feeling noobish again, what command do i give it to execute the command? i do "do excavate" and it says no such program.. so noobish xD
 

Echo_Beta

New Member
Jul 29, 2019
9
0
0
This should be the last and final question, sorry for all of these hogging the forum...

I place the code:
while turtle.getFuelLevel() < 1000 then
sleep (10)
end
after the last end in the unloading items code...

However i get a bios338 error when i try to run the program.. :(

Exact bios is... "bios:338: [string "excavate"]:46: 'do' expected" (i am guessing there is a problem then on line 46 on closer review..

again edit: on closer review its the line where i put the new code.. can anyone shed some light on what i have done wrong?
 

Echo_Beta

New Member
Jul 29, 2019
9
0
0
Yeah once i changed the then to do it has no error.. however i found out that without knowing more programs i have to orient the base of the mining turtle a certain way otherwise it wont deposit items.. lol oh well its a simple thing to work around :) thanks for the help!
 
  • Like
Reactions: Skirty_007