hey, i am trying to write my first program. and its for the startup of my turtels, it is supposed to say 'hello my name is (get id) and my fuel level is (get fuel level) but i don't know how to make a turtle get its own id, since i set id's on all my turtles, and give them names like Barry, Bernard. dig_bik and such. i was just going to re do the code each time i get the startup pastebin, but thought i should dive deeper than that. here is the code as of current, and what i am aiming for
currently:
http://pastebin.com/MZ5r2S0D
what my aim is:
http://pastebin.com/501YkzpU
thanks in advance.
7 replies to this topic
#1
Posted 24 February 2014 - 02:38 PM
#2
Posted 24 February 2014 - 02:50 PM
os.getComputerLabel() will return the label of the computer if one is set.
#4
Posted 24 February 2014 - 03:51 PM
So to sum it up;
local Id = os.getComputerID() print(Id)
#5
Posted 24 February 2014 - 04:13 PM
print("Hello my name is wilson, i got ", turtle.getFuelLevel() , " Fuel currently. and my ID is: ", os.getComputerID())
That should do i think
#6
#7
Posted 26 February 2014 - 05:49 PM
Lyqyd, on 24 February 2014 - 05:08 PM, said:
was that not correct? im sorry, i didnt realise they were diffrent things, i want to do label set wilson, and in the startup code, it prints its label, instead of me entering it manually every time.
#8
Posted 26 February 2014 - 06:22 PM
right! i got it, thank you very much people
a great help. heres the final product!
http://pastebin.com/GG3UcLax
http://pastebin.com/GG3UcLax
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











