Posted 22 January 2013 - 03:38 AM
Outdated! (I think so it still work but for now I don't do anything with this)
Spoiler
Hey guys,here is a small API that i writed my self (with help of grabie2).
I will be still updating the API but for now it is what it is :P/>
functions
Spoiler
tGetPos() - term.getCursorPos()tB(color) - term.setBackgroundColor(color)
tT(color) - term.setTextColor(color)
clear() - term.clear()
tSize() - term.getSize()
tPos( [x=1], [y=1] ) - term.setCursorPos(x,y)
clearL( [line=tGetPos()] ) -term.clearLine()
wall( char, line, color ) - on pos 1 of the line and pos 51 of the line it prints char with the color or white
pixWall( line, color ) - on pos 1 of the line and on the pos 51 of the line it's printing pixel with the color
Ln( [x=1] ) - print()
printLine( text, color ) - it's print text with color and scrools 1 line
printLn( text, color ) - printLine(text, color)
printC( text, color ) - print text with color
writeC( text, color ) - write text with color
getInput ( x, y, [replaceChar=nil] ) - reads from the pos and replace it with replaceChar (default not replacing)
TextLine( line, color) - print line from 1 to 51 x pos and color it
drawImage( img, x, y ) - draws image (img - dir)
printCentered( text, line, color ) - print centered text on line with color
require( file ) - if required file not exists then prints: Required file not exists!
wFile( path, text ) - prints to path dir text
download( adress, save ) - downloads file from internet and save it to save dir(tested ONLY with pastebin & dropbox) not working with dropbox, pastebin works correctly only in raw
getDir() - return shell.dir()
cdPath( [dir] ) -if dir isn't nil then shell.run("cd ", dir) else return getDir()
createDir( name ) - shell.run("mkdir ", name)
run( dir ) - shell.run( dir )
code
http://pastebin.com/WVLcpr5H
required
Spoiler
ComputerCraft 1.45 or aboveAdvanced computer
installation
Spoiler
> pastebin get WVLcpr5H startup> reboot
Credits
Spoiler
mibac138 - Creator/Developer.grabie2 - help
Changelog
Spoiler
v1.0.2 Added getDir(), cdPath(), createDir(), run(), RunningProgram() & changed all of variables to local.v1.0.1 Added tSize() - term.getSize() & fixed getInput() return.
v1.0 First public version published.
I'm from Poland sorry for my English :P/>