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

Bitwise And

Started by ZephyrWolf_, 16 October 2015 - 12:38 AM
ZephyrWolf_ #1
Posted 16 October 2015 - 02:38 AM
Ok Im really gonna need help here. So Im trying to use "bit.band(m, n)". but I cant get it to work. based off the crash, "attempt to index ? (a nil value)" itsbecause it doesnt know about bit, which I have confiremed by "print(bit)". I have also tried to use "os.loadAPI("bit")" but that doesn't seem to help. The only information I can find on this is from the computercaft wiki, which only says to write bit.band(n, m). I am running mc 1.7.10, cc 1.74

thankyou for reading, please help if you can
Anavrins #2
Posted 16 October 2015 - 04:09 AM
I think it has been renamed to "bit32" in the latest version.
Bomb Bloke #3
Posted 16 October 2015 - 06:13 AM
Well, sort of; you'd generally have both bit and bit32. There's a config option which disables anything Lua 5.1-related (eg bit), but that's not the default.
ZephyrWolf_ #4
Posted 16 October 2015 - 06:32 AM
Thanks, bit32 works… after checking the config… it looks like my friend (Server Owner) did disable that… that explains it. Thankyou for helping!!!