Guest User

shop

a guest
Feb 14th, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1.  
  2. mon=peripheral.wrap("right")
  3. shopitems={"Cobble","Stone","Glass","Wooden","Coal","Torch"}
  4. shopprice={"1$"}
  5. shopani={"stone","planks"}
  6. shopam={"Piece"}
  7. local tick = 1.3
  8. function sc(x,y)
  9.   mon.setCursorPos(x,y)
  10. end
  11. function mw(string)
  12.   mon.write(string)
  13. end
  14. function center(offset,blockno,shopitem,y,charoffset)
  15.   sc(charoffset+math.ceil((offset*10)+((blockno*10)/2)-(#shopitem/2)),y)
  16.   mw(shopitem)
  17. end
  18. mon.clear()
  19. function blocklayout(offset,blockno,itemno,amount,priceno,charoffset)
  20.   center(offset,blockno,shopitems[itemno],2,charoffset)
  21.   center(offset,blockno.shopam[amount],3,charoffset)
  22.   center(offset,blockno,shopprice[priceno],4,charoffset)
  23. end
  24. mon.clear()
  25. function del() --Delete later ^Testing script
  26. center(0,1,shopitems[1],2,0)
  27. center(0,1,shopprice[1],3,0)
  28. center(1,1,shopitems[2],2,0)
  29. center(2,1,shopitems[3],2,1)
  30. center(3,1,shopitems[4],2,2)
  31. end
  32. blocklayout(0,1,1,1,1,0)
Advertisement
Add Comment
Please, Sign In to add comment