This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
protexxi's profile picture

Lua Newbie help needed on a few things

Started by protexxi, 11 October 2012 - 12:49 PM
protexxi #1
Posted 11 October 2012 - 02:49 PM
First of i would like to say i have spend a good hour or two looking around for a how to guide that i can understand.

Question 1
[indent=1]Variables [/indent]
SpoilerI already know the basics on how to create and change a variable.
However I would like to know if it is possible to create a file E.G a Store.txt file that stores all the variables.
so that it could be called up on by any computer.
For example if a input was detected by the computer it would do x= x+1 but x would be stored in the .txt file not the program.
so that the same variable could be shown on a different program on a different computer.


Question 2
[indent=1]Wireless control[/indent]
SpoilerHow do i control a turtle from a computer so that it used the functions saved onto the computers program.


Question 3
[indent=1]Gps[/indent]
SpoilerHow do i set up a gps tower so that i could tell a turtle to got x,y,z?
Doyle3694 #2
Posted 11 October 2012 - 02:57 PM
Question 1:
http://www.computercraft.info/forums2/index.php?/topic/3923-basic-file-io-learn-how-to-save-data/ :P/>/>

Question 2:
There is something called 'rednet', I think you can find info about it on the wiki ;)/>/>
http://computercraft.info/wiki/index.php?title=Rednet_%28API%29

Question 3:
http://computercraft.info/wiki/index.php?title=Gps_%28API%29
protexxi #3
Posted 11 October 2012 - 03:01 PM
Gps one doesn't show how to make the host tho
Doyle3694 #4
Posted 11 October 2012 - 03:05 PM
well yes, read the text :P/>/>
protexxi #5
Posted 11 October 2012 - 03:06 PM
saving the file like that wont really work for what i need it for
Ditto8353 #6
Posted 11 October 2012 - 03:16 PM
If simple solutions do not solve your problem, then you are pushing beyond your knowledge and you should do more reading on the Lua language as a whole. The Lua 5.0 Manual will serve you well.
remiX #7
Posted 11 October 2012 - 05:18 PM
Question 1
[indent=1]Variables [/indent]
SpoilerI already know the basics on how to create and change a variable.
However I would like to know if it is possible to create a file E.G a Store.txt file that stores all the variables.
so that it could be called up on by any computer.
For example if a input was detected by the computer it would do x= x+1 but x would be stored in the .txt file not the program.
so that the same variable could be shown on a different program on a different computer.

I actually asked the same question about a week ago about saving text into a file and for all computers to be able to read it. Well I asked it in a different way but still. Yes it is possible but you have to use rednet and it is quite a lot of work (for me atleast because I haven't used or learn about rednet before :P/>/>) So rather just use the basics and what you know for now.

Edit: Fixed quote.
cheekycharlie101 #8
Posted 11 October 2012 - 09:05 PM
im working on a wireless turtle control system. as soon as ive finsihed fixing it up il send u a link