47 posts
Posted 07 September 2013 - 03:16 PM
Guys, I got a bug that I can't figure out. Please anyone can find a solution?
Error message:
picturer:77: bad argument #1: value expectedCode:
http://pastebin.com/4r4pPsTYThanks in advance!
504 posts
Location
Seattle, WA
Posted 07 September 2013 - 04:58 PM
You might be converting your hex numbers into decimal numbers incorrectly. Try using tonumber (hexNumber, 16) to convert the hex string into base 10 from base 16.
47 posts
Posted 07 September 2013 - 05:14 PM
You might be converting your hex numbers into decimal numbers incorrectly. Try using tonumber (hexNumber, 16) to convert the hex string into base 10 from base 16.
It did fix the problem, but now there's a weird bracket bug that I can't trace.
Error:
bios:337: [string "picturer"]:56: ')' expectedLink:
http://pastebin.com/7Z6LXupDNote: I am trying to edit a picture
2217 posts
Location
3232235883
Posted 07 September 2013 - 08:17 PM
this line wasnt using parentheses properly
term.setBackgroundColor(2^tonumber(string.sub(bg[pi], pj, pj), 16))
47 posts
Posted 08 September 2013 - 06:32 AM
this line wasnt using parentheses properly
term.setBackgroundColor(2^tonumber(string.sub(bg[pi], pj, pj), 16))
picturer:71: attempt to perform arithmetic __pow on number and nil
7508 posts
Location
Australia
Posted 08 September 2013 - 06:57 AM
if tonumber is returning nil then it means the string being passed to it is not valid hexadecimal. Make sure you're not giving it anything that wouldn't be valid hex.
47 posts
Posted 08 September 2013 - 07:04 AM
if tonumber is returning nil then it means the string being passed to it is not valid hexadecimal. Make sure you're not giving it anything that wouldn't be valid hex.
Might be the problem, but it crashes when I try to change the BG color or text color in the editor. When I edit the numbers manually it shows the colors just fine.
47 posts
Posted 09 September 2013 - 07:46 AM
FIXED. I switched the height with width, so I had '19' instead of '51'. Thanks for contributing everyone!