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

[First program of DubbelINC] Dubbel Functions Helper

Started by DubbelSoftware, 24 April 2016 - 10:41 AM
DubbelSoftware #1
Posted 24 April 2016 - 12:41 PM
Hello computercrafters,

I have worked hard on a Function helper!
Everyone is allowed to use this program in all the programs.

Download: pastebin get VtcBYLB7


Problem: if i wil type a topic then sometimes wil it not write.
Example:
If i use space on my keyboard on the topic then sometimes it works.
And sometimes not. Thats on all the keys i press.
Creator #2
Posted 24 April 2016 - 07:30 PM
Maybe add some more details on what the code does and one/ a few examples.
DubbelSoftware #3
Posted 25 April 2016 - 09:46 AM
If i try to type in a topic, then sometimes i press a key, and then its not works. It dont let it see in the topic.
Dragon53535 #4
Posted 25 April 2016 - 12:55 PM
From what I can see, his api allows for a clear function, that just is term.clear, a reboot function that is os.reboot, a shutdown function that is os.shutdown, a diskeject function that tries to eject in every face by doing each one individually, 16 different set background functions labeled bcolor, 16 different set text functions labeled tcolor. A shell function that all it does it put "CraftOS Shell" on the top line in yellow, a startup function that runs startup, a programs function that runs programs, and a dir function that runs dir.

Not to be too terribly mean, but these functions aren't helpful in any way.



function setBGround(clr)
  if (colors[clr]) then --#If the color passed is a valid color in the colors table
    term.setBackgroundColor(colors[clr]) --#Set the background to it
  end
end
This is one function that easily sets the background color just by passing "black" "blue" or whatever to it.

Most of the time when people clear the screen, they also want to set the cursor, usually to 1,1.


function clearCursor(x,y)
  x = type(x) == "number" and x or 1 --#If x is not a number, x = 1, if it is, then x stays the same
  y = type(y) == "number" and y or 1
  term.clear()
  term.setCursorPos(x,y)
end