Guest User

checkers

a guest
Sep 22nd, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. if not os.loadAPI("cutil") then
  2.     error("checkers requires the Checkers util API (cutil) by minecraftwarlock to run")
  3. end
  4.  
  5. sides = {"left","right","front","back","top","bottom"}
  6. modemSide = nil
  7. monSide = nil
  8. modDir = "checkers mods"
  9.  
  10. if not fs.exists(modDir) then
  11.     fs.makeDir(modDir)
  12. end
  13.  
  14. for i=1,6 do
  15.     if peripheral.isPresent(sides[i]) and peripheral.getType(sides[i]) == "modem" then
  16.         modemSide = sides[i]
  17.     end
  18. end
  19.  
  20. rednet.open(modemSide)
  21.  
  22. cutil.mon = peripheral.find("monitor")
  23. button.mon = peripheral.find("monitor")
  24. mon = peripheral.find("monitor")
  25.  
  26. if mon == nil or not mon.isColor then
  27.     error("Checkers requires an advanced monitor to play")
  28. end
  29.  
  30. gamemode = cutil.mainMenu()
  31. print("gamemode: "..gamemode.." selected")
  32.  
  33. mods = cutil.getMods("checkers mods")
  34. for index,mod in ipairs(mods) do
  35.     print(mod)
  36. end
  37.  
  38. if gamemode == "lcl" then
  39.     cutil.board(8,8)
  40.     cutil.nextTurn()
  41. end
Advertisement
Add Comment
Please, Sign In to add comment