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

api tutorial?

Started by marted, 25 February 2013 - 01:14 AM
marted #1
Posted 25 February 2013 - 02:14 AM
I am told the turtles come with built in shellapi or shell
Istart a Turtle an in my Turtle black window I type
> help shellapi
and get
> shell.exit()
> shell.dir()
I then type
> shell.dir()
No such program
> shell dir()
No such program
> shellapi.dir
No such program
> dir()
No such program

I use Google and find
http://computercraft.info/wiki/Tutorials
I try
http://computercraft.info/wiki/Guess_The_Number_%28tutorial%29
and type in their first command
> term.clear()
No such program

Can anyone tell the very frustrated person what I am failing to do?
I really need *exact* character-by-character instructions.

Thanks
remiX #2
Posted 25 February 2013 - 06:31 AM
You're on the right track, but you're using the LUA commands within the shell. You need to use them within a program
Type 'edit file' in the shell and then use the commands :)/>
Lyqyd #3
Posted 25 February 2013 - 08:46 AM
Moved to Ask a Pro.
tesla1889 #4
Posted 25 February 2013 - 06:34 PM
You're on the right track, but you're using the LUA commands within the shell. You need to use them within a program
Type 'edit file' in the shell and then use the commands :)/>

just to clarify, after you type the Lua script into "file", save it, then type "file" to run it
immibis #5
Posted 26 February 2013 - 01:01 AM
You can also run Lua commands directly from the "lua" program.
Example, where italics are what you typed:

CraftOS 1.5
> lua
(some text goes here that I never bother to read)
lua> term.clear()
screen clears
lua>