Advertisement
iWasHere

Donkey DIK Kicker for ComputerCraft

Nov 26th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. forePlay = {false,false}
  2. blowLoad=false
  3. kicks=0
  4. slot=1
  5. outSide="none"
  6. term.setBackgroundColor(colors.brown)
  7. term.clear()
  8.  
  9. function donkeyDIK(DIK)
  10. local x,y = term.getSize()
  11. local yy = y/2
  12. local xx = (x-string.len(DIK))/2
  13. term.setCursorPos(xx,yy)
  14. end
  15. function deepThroatDIK(DIK)
  16. local x,y = term.getSize()
  17. local yy = y/2
  18. local xx = (x-string.len(DIK))/2
  19. term.setCursorPos(xx,yy+1)
  20. end
  21.  
  22. local splash="This is DK - Donkey Dik"
  23. donkeyDIK(splash)
  24. textutils.slowWrite(splash,20)
  25. sleep(1)
  26. local splash2="Program by Nick"
  27. deepThroatDIK(splash2)
  28. textutils.slowWrite(splash2,30)
  29. sleep(1)
  30. term.clear()
  31.  
  32. function ImNotMovingThis()
  33. local expandDong="Please spread your legs to begin."
  34. donkeyDIK(expandDong)
  35. textutils.slowWrite(expandDong,25)
  36. end
  37.  
  38. repeat
  39. local askDong = "Want me to face you?"
  40. donkeyDIK(askDong)
  41. textutils.slowWrite(askDong,20)
  42.  
  43. local answerDong = "Y/N"
  44. deepThroatDIK(answerDong)
  45. textutils.slowWrite(answerDong,10)
  46.  
  47. local event, key = os.pullEvent("char")
  48.  
  49. if key == "y" then
  50. local i=0
  51. for i=1,2,1 do
  52. turtle.turnRight()
  53. if i==2 then
  54. forePlay[1]=true
  55. term.clear()
  56. end
  57. end
  58. elseif key == "n" then
  59. forePlay[1]=true
  60. term.clear()
  61. end
  62.  
  63.  
  64.  
  65. until forePlay[1] ==true
  66.  
  67. repeat
  68. local askDong2 = "Output items to top or bottom?"
  69. donkeyDIK(askDong2)
  70. textutils.slowWrite(askDong2,20)
  71.  
  72. local answerDong2 = "T/B/N"
  73. deepThroatDIK(answerDong2)
  74. textutils.slowWrite(answerDong2,10)
  75.  
  76. local event, key = os.pullEvent("char")
  77. if key == "t" then
  78. blowLoad=true
  79. outSide="top"
  80. forePlay[2]=true
  81. term.clear()
  82. elseif key == "b" then
  83. blowLoad=true
  84. outSide="bottom"
  85. forePlay[2]=true
  86. term.clear()
  87. elseif key == "n" then
  88. blowLoad=false
  89. outSide="none"
  90. forePlay[2]=true
  91. term.clear()
  92. end
  93.  
  94. until forePlay[2] == true
  95.  
  96. ImNotMovingThis()
  97.  
  98.  
  99. if forePlay[1] == true and forePlay[2] == true then
  100. while true do
  101.  
  102. if turtle.attack() == true then
  103. kicks=kicks+1
  104. local DIKount = "DIKs kicked: "..tostring(kicks)
  105.  
  106. term.clear()
  107. deepThroatDIK(DIKount)
  108. write(DIKount)
  109.  
  110. if kicks == 69 then
  111. local SixtyNineingChildren="Donkey Dik is Pleased!"
  112. donkeyDIK(SixtyNineingChildren)
  113. textutils.slowWrite(SixtyNineingChildren,25)
  114. end
  115. end
  116.  
  117. if blowLoad==true then
  118.  
  119. local outTxt = "Outputting to "..outSide
  120. local width,height = term.getSize()
  121. local xLoc = (width-string.len(outTxt))/2
  122.  
  123. if outSide=="bottom" then yLoc=height
  124. else yLoc=1
  125. end
  126.  
  127. term.setCursorPos(xLoc,yLoc)
  128. write(outTxt)
  129.  
  130. if outSide=="bottom" then
  131. turtle.dropDown()
  132. elseif outSide=="top" then
  133. turtle.dropUp()
  134. end
  135. if slot == 16 then
  136. slot = 1
  137. else
  138. slot = slot+1
  139. end
  140. turtle.select(slot)
  141. end
  142.  
  143. sleep(1)
  144. end
  145. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement