This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DarkNinja2462's profile picture

[SOLVED]Please delete me

Started by DarkNinja2462, 22 July 2012 - 03:54 AM
DarkNinja2462 #1
Posted 22 July 2012 - 05:54 AM
When trying to make my own slot machine i made this code:

math.randomseed( os.time() * 1000)
e, p1, p2 = os.pullEventRaw("redstone")
num = math.random(1,5)
num2 = math.random(1,5)
num3= math.random(1,5)
e, p1, p2 = os.pullEventRaw("redstone")
term.clear()
term.setCursorPos(1,4)
print "		 -------------"
print("		 | "..num.." | "..num2.." | "..num3.." |")
print "		 -------------:"
and then it says
 slot:9: attempt to call number
FYI: everything works including the os.pullEventRaw stuff, and my program is named "slot"
Lyqyd #2
Posted 22 July 2012 - 06:08 AM
You should probably put the parentheses for those other two print calls. Is that the entire program?
DarkNinja2462 #3
Posted 22 July 2012 - 06:19 AM
Yes, so far
MysticT #4
Posted 22 July 2012 - 07:49 PM
Check that you have all the .. (concatenation operators), cause if you have something like:

num" | "
Lua thinks you'r trying to call num with " | " as a parameter.
DarkNinja2462 #5
Posted 22 July 2012 - 10:56 PM
Yep, you're right