Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bonus={2,20,200}
- function printTop(p)
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- write('Bet -')
- for i=1,5 do
- if i==p then term.setTextColor(colors.white)
- else term.setTextColor(colors.yellow) end
- write(string.format('%5d',i))
- end
- print()
- for i=1,3 do
- term.setTextColor(colors.red)
- write(7)
- term.setTextColor(colors.yellow)
- write('x'..i..' -')
- for j=1,5 do
- if j==p then term.setTextColor(colors.white)
- else term.setTextColor(colors.yellow) end
- write(string.format('%5d',bonus[i]*j))
- end
- print()
- end
- term.setTextColor(colors.white)
- end
- banner={'\\ /',' \\/ ',' '}
- pb=1
- function printRight()
- for i=1,12 do
- term.setCursorPos(34,i)
- if pb>3 then pb=pb-3 end
- write(banner[pb])
- pb=pb+1
- end
- pb=pb-1
- end
- term.clear()
- A=wheel:new(8,5,7)
- B=wheel:new(16,5,7)
- C=wheel:new(24,5,7)
- function button()
- if rs.getInput('left') then return true end
- sleep(0.5)
- if rs.getInput('left') then return true end
- return false
- end
- function check()
- while button() do sleep(0.5) end
- wheels_stop=true
- end
- while true do
- StartItems=CountItems()
- bet=-1
- repeat
- Items=CountItems()-StartItems
- if Items~=bet then
- bet=Items
- if bet>5 then GiveItems(bet-5) bet=5 end
- printTop(bet)
- end
- if bet<5 then printRight() end
- sleep(0.2)
- until button() and bet~=0
- term.setCursorPos(1,12)
- term.clearLine()
- parallel.waitForAll(A:rotation(0.12),B:rotation(0.1),C:rotation(0.04),check)
- prize=0
- if A.pos==7 then prize=prize+1 end
- if B.pos==7 then prize=prize+1 end
- if C.pos==7 then prize=prize+1 end
- if prize>0 then
- prize=bonus[prize]*bet
- term.setCursorPos(1,12)
- write('Win '..prize)
- GiveItems(prize)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment