- Messages
- 35
- Country
Solution: http://www.fsdeveloper.com/forum/threads/lua-0-versus-1.438989/#post-760757
Hi,
I used == in a previous LUA and checking bits worked as expected.
I copied that LUA to make a MasterCaution LUA.
But == 1 does not work in this new LUA.
(original MasterCaution gauge at far left, making a larger one at right)
I have to use ~= 0 to read the bits.
Any idea what I'm assuming wrong?
Robert
Hi,
I used == in a previous LUA and checking bits worked as expected.
Code:
if ipc.readUB(0x9358) ~= nil then
-- No Autoland
if logic.And(ipc.readUB(0x9358),1) == 1 then
MipAnnAutoLandLine2 = 2
end
-- No Land 3
if logic.And(ipc.readUB(0x9358),2) == 1 then
MipAnnAutoLandLine2 = 1
end
-- Land 2
if logic.And(ipc.readUB(0x9358),4) == 1 then
MipAnnAutoLandLine1 = 2
end
-- Land 3
if logic.And(ipc.readUB(0x9358),8) == 1 then
MipAnnAutoLandLine1 = 1
end
end
I copied that LUA to make a MasterCaution LUA.
Code:
if ipc.readUB(0x92e3) ~= nil then
-- Warning
if logic.And(ipc.readUB(0x92e3),1) == 1 then
MipAnnMasterWarning = 1
end
-- Caution
if logic.And(ipc.readUB(0x92e3),2) == 1 then
MipAnnMasterCaution = 1
end
end
But == 1 does not work in this new LUA.
(original MasterCaution gauge at far left, making a larger one at right)
I have to use ~= 0 to read the bits.
Any idea what I'm assuming wrong?
Robert
Last edited: