Odd turtle issue...

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

SlipperyJim

New Member
Jul 29, 2019
25
0
0
Hey all!

We are using the Mindcrack pack with added Modular Powersuits, Bibliocraft and Advanced Energistics.

We've been trying to recreate Direwolf's recent frame miner using Mining Wells and Mining Turtles but have hit a snag. For some reason, even though we are using exactly the same code as DW, only one turtle will fire at a time.

I have checked each individual turtle works if it is the only one sent the command. However, using the for loop only fires a single turtle. (And yes I ensured the turtle ID's were changed).

If I do a rednet.send list to each individual turtle # I can only get 2 to fire at once.

This seems to also happen even if we use rednet.broadcast.

Any ideas?

I can provide the code etc if required - just wondering if anyone had encountered this themselves.

Also - does the red border on the wireless modem indicate anything? About 1 in 4 turtles out of 16 seem to have it?

The Jimbat
Codingly Confused
 

slay_mithos

New Member
Jul 29, 2019
1,288
0
0
Then, by all mean, please do provide a pastebin link to the various programs.

The red border indicates that the computer/turtle is connected to rednet.
 

SlipperyJim

New Member
Jul 29, 2019
25
0
0
OK,

The turtles are primed and use this to receive the command:

Code:
rednet.open("right")
while true do
senderID, message, distance = rednet.receive()
print(message)
shell.run(message)
end

which then executes this:

Code:
function deploy()
turtle.select(1)
turtle.place()
end
 
function clearInv()
for i = 1,10 do
turtle.select(i)
turtle.dropDown()
end
turtle.select(1)
end
 
function getMiner()
turtle.select(1)
while turtle.getItemCount(1) > 0 do
clearInv()
sleep(5)
end
turtle.dig()
end
 
deploy()
for i = 1,3 do
sleep(5)
clearInv()
end
getMiner()

This deploys the mining well waits then picks it back up.
Finally the computer is using this:
Code:
rednet.open("right")
for i = 40, 55 do
rednet.send(i, "cycle")
end

which should send the message to each turtle in turn.

As I mentioned it will work for each individual turtle if sent alone but not for the whole group - only the first turtle fires. This is an exact copy of DW's code aside from the turtle numbers so it seems odd that it shouldn't work.

If I try rednet.send(40, "cycle") 40 will run. If I try:
Code:
rednet.send(40, "cycle")
rednet.send(41, "cycle")
rednet.send(42, "cycle")

etc only the first 2 will run.

I have removed and replaced all the turtles and the code at least once.

The Jimbat
Pasted
 

slay_mithos

New Member
Jul 29, 2019
1,288
0
0
You mentioned that some turtles didn't have the red part on their wireless module, so something is obviously off.
Stupid question, but are all the wireless modules on the Right?

I also assume that the first piece of code is set as "startup"?

I do not watch DW20 videos at the moment, so I have no clue what that code is supposed to be doing, but the rednet code at least seems to be correct.
You might want to double check the ID of your turtles, and make sure they are all labelled, as that might be a problem too.
 

SlipperyJim

New Member
Jul 29, 2019
25
0
0
Thanks for the quick response :)

Yes there's a startup which fires the awaitCommand. All the modems are indeed on the right.

I'm not sure what the deal is with the red panel - some have it some don't but they all work if called individually.

I double checked the id's but am not sure about the labels - I shall check that.

The Jimbat
Turtle-y Confused (haha!)[DOUBLEPOST=1365009762][/DOUBLEPOST]The FtB wiki lists Computercraft 1.5 for Mindcrack but '1.481 for 1.4.6' for the DW pack so there could be an issue there I suppose.

Investigations continue :)

The Jimbat
Continual
 

voidreality

New Member
Jul 29, 2019
117
0
0
Try sleep(.1) between rednet messages. Maybe server lag? Also, a good habit to get into, especially when using startup is to shell.run("id") in the beginning of the startup file. This way the turtle will print to its terminal and identify itself.
 

SlipperyJim

New Member
Jul 29, 2019
25
0
0
The shell.run("id") is an excellent suggestion :)

I tried adding a sleep command - no change :p

The Jimbat
Sleepy
 

SlipperyJim

New Member
Jul 29, 2019
25
0
0
OK :)

I a surreal twist by replacing all the turtles completely (Id's 64-80) the blooming thing now works.

No idea why but thanks for all the help everyone!

The Jimbat
Wonders what the problem was...
 
  • Like
Reactions: Skirty_007