r/ComputerCraft • u/cursed_yeet • Apr 04 '20
Expected number, got number error
I get this strange error: .temp5: bad arguement #2 (expected number, got number)
here is the code: https://imgur.com/a/eadU48o
I cant see what is causing the issue. any help would be great. There are no numbers involved in the second line, how can it not be happy with a number if it expected one?
2
u/dragon53535 Apr 05 '20
rednet.receive([ [string protocolFilter, ] number timeout])
You're trying to set the protocol filter by number and not the timeout. rednet.receive("",10) would fix your issue
1
1
u/MyNameIsTrez Apr 04 '20
Could you tell me why there are two end statements and a single break statement when you only need one end statement to close the if statement? Is it part of some code off-screen?
2
u/CommendableCalamari Apr 05 '20
There's a while loop starting on line 3. It's not indented, so it's less obvious.
3
u/CommendableCalamari Apr 04 '20
What version of ComputerCraft are you running? If I remember, this is a bug with the 1.12 version of CC - you might be better off switching to CC: Tweaked.