Posted 03 September 2012 - 03:40 PM
I make a roulette.
Program is almost ready, but does not send the signal in the second half of the code.
Help me find a the error.
Advance thanks
Program is almost ready, but does not send the signal in the second half of the code.
Help me find a the error.
--------------------------------------------------------------------------
tNum={
[0]=colors.red,
[1]=colors.green,
[2]=colors.purple,
[3]=colors.brown,
[4]=colors.cyan,
[5]=colors.blue,
[6]=colors.lightGray,
[7]=colors.gray,
[8]=colors.yellow,
[9]=colors.pink,
[10]=colors.lightBlue,
[11]=colors.lime,
[12]=colors.magenta}
--------------------------------------------------------------------------
tEvenOdd={
[1]="odd", [2]="even",
[3]="odd", [4]="even",
[5]="odd", [6]="even",
[7]="odd", [8]="even",
[9]="odd", [10]="even",
[11]="odd", [12]="even"}
--------------------------------------------------------------------------
tBlackRed={
[1]="black", [2]="red",
[3]="red", [4]="black",
[5]="black", [6]="red",
[7]="black", [8]="red",
[9]="red", [10]="black",
[11]="black", [12]="red"}
--------------------------------------------------------------------------
rednet.open("top")
term.clear() term.setCursorPos(1,1)
print("Enter the amount of your bet")
local amo = read()
shell.run("redpulse", "left", amo, "0.5")
--------------------------------------------------------------------------
term.clear() term.setCursorPos(1,1)
print("You will be put on the number? [yes/no]")
local sel = read()
--------------------------------------------------------------------------
if sel == "yes" then term.clear() term.setCursorPos(1,1)
print("Enter the number to which you want to bet [0-12]")
local iNumb = read()
end
if sel == "no" then term.clear() term.setCursorPos(1,1)
print("Enter the number to which you want to bet [odd/even, black/red]")
local sArr = read()
end
term.clear() term.setCursorPos(1,1)
--------------------------------------------------------------------------
local w = math.random(0,12)
term.clear() term.setCursorPos(1,1) print("["..w.."]")
rs.setBundledOutput("back", tNum[w]) sleep(5)
rs.setBundledOutput("back", 0)
--------------------------------------------error somewhere below
if sArr == tEvenOdd[w] then
if sArr == "odd" then amo = amo*2
shell.run("redpulse", "bottom", amo, "0.5")
elseif sArr == "even" then amo = amo*2
shell.run("redpulse", "bottom", amo, "0.5")
end
--------------------------------------------------------------------------
elseif sArr == tBlackRed[w] then
if sArr == "black" then amo = amo*2
shell.run("redpulse", "bottom", amo, "0.5")
elseif sArr == "red" then amo = amo*2
shell.run("redpulse", "bottom", amo, "0.5")
end
end
--------------------------------------------------------------------------
if iNumb == w then amo = amo*100
shell.run("redpulse", "bottom", amo, "0.5")
end
--------------------------------------------------------------------------
Advance thanks