Jump to content




Melee turtle remote reactivation


  • You cannot reply to this topic
4 replies to this topic

#1 draymonite

  • New Members
  • 2 posts

Posted 05 March 2013 - 06:23 PM

Title Melee turtle remote reactivation
AM complete newbie at computercraft been using for two days

have just started Using direwolf20's mod pack. I set up a modded mob grinding xp farm using 8 melee turtles in a square around a 3x3 square drop.

TTBB
BXXXT
TXXXT PC
TXXXJ
BBTT


T = Turtle
B = Block
X = drop area
J = Exp collector
PC = master control PC


the thing is everytime the server shuts down i have to restart each of the 8 turtles manually

each turtle has a wireless modem but when i have tried to use a master computer with modem nearby the turtles just sit there

Main computer program "Wake" is as follows

rednet.open("right")
print("Enter ID of sender: ")
id = read()
print("What would you like to send: ")
msg = read()
rednet.send(id, msg)


at the turtle i have the following program "Wake"


id, msg = rednet.receive()
print(msg)
if msg == "kill" then
shell.run("combat")


Am I missing something?

#2 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 06 March 2013 - 02:13 AM

Split to new topic.

Actually, to run code upon computer startup, simply rename the file you want to run as startup. That, or you can create a new program labeled startup, with one line on it:
shell.run("<programNameHere>")


#3 JokerRH

  • Members
  • 147 posts

Posted 06 March 2013 - 05:17 AM

So as Cranium said you have to write the startup code in the startup file (That will be called if the computer starts)
To your wake-on-rednet programm: How should it be able to run if you already noticed that your other programm won't?
--rednet.receive will wait and return until it receives something, it will not be called when it receives a message.

#4 draymonite

  • New Members
  • 2 posts

Posted 06 March 2013 - 02:07 PM

Thanks for the work around

as to the question jokerrh asked

I saw the combat program working if I typed it in the turtles themselves. What I was trying to do was get a turn ON program to work from a computer terminal nearby so that it would activate the combat / kill program on the turtles in a group.

when i tried using the computer, mobs were not being slain showing that it was not working. that is why I asked the original question

#5 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 06 March 2013 - 03:25 PM

The turtles are already on. The problem is that they're waiting for you to type a command, not running you're program.

If your program is called startup they'll run it as soon as they turn on, instead of waiting for you to type it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users