ReBraLaCC

Documentation

Aug 19th, 2016
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. [] = things you enter in yourself
  2.  
  3. This is the documentation for the Scoreboard API
  4. not really just a simple walkthrough of the API
  5.  
  6. -- Making a board
  7. making a board is fairly simple just use [apiname].new("board") this returns a function so doing [apiname].new("board")() will actually make it, you can't really use it at the moment though, because this requires a table of objects, those objects are: a Title and Lines.
  8.  
  9. A Title is a simple object made like this: [apiname].new("title")([name-for-the-scoreboard])
  10.  
  11. Lines are made a bit differently, like this: [apiname].new("line")([name/text],[value/score],[color])
  12.  
  13. so a little bit of an example:
  14. ---------------------------------------
  15. local lines = {}
  16. title = board.new("title")("Scores")
  17. red = board.new("line")("Red",1,"red")
  18. blue = board.new("line")("Blue",4,"blue")
  19. table.insert(lines,title)
  20. table.insert(lines,red)
  21. table.insert(lines,blue)
  22. local sBoard = board.new("board")(lines)
  23. sBoard.generate()
  24. ---------------------------------------
  25.  
  26. -- Colors
  27.  
  28. as you saw i used "red" and "blue" but you can also use a couple of computercraft colors
  29. these are:
  30. colors.lightGray
  31. colors.green
  32. colors.lime
  33. colors.blue
  34. colors.lightBlue
  35. colors.gray
  36. colors.pink
  37. colors.black
  38. colors.purple
  39. colors.red
  40. colors.white
  41.  
  42. -- End
  43.  
  44. This is all you need for now, if you have any ideas, have a question or found any bugs please message me on the CC Forums or post on this forum thread: http://www.computercraft.info/forums2/index.php?/topic/27862-scoreboard-api/
Advertisement
Add Comment
Please, Sign In to add comment