I have one questions on Lights offset.
from google I found the following
http://forum.simflig...tch-setup-help/
this gave me soem info and explained how the lights work, so this is what I got.
use 0D0C and the corresponding bit value (sorry I dont know if I use right termonology)
0D0C 2 Lights, a switch for each one (bits from lo to hi): 0 Navigation = 1 1 Beacon = 2 2 Landing = 4 3 Taxi = 8 4 Strobes = 16 5 Instruments = 32 6 Recognition = 64 7 Wing = 128 8 Logo = 256 9 Cabin = 512
here is my "lights section" lua
ipc.sleep(100)
ipc.display("Lights Sequence initiated...")
ipc.sleep(2000)
questvar = ipc.ask("Captain, do you want to go set off all lights? (y / n)")
if questvar == "y" then
ipc.display ("Please wait, switching off lights!")
ipc.sleep(400)
-- NAV Lights OFF
NLI = logic.And(ipc.readUW(0x0D0C), 0x1)
if NLI ~= 0 then
ipc.control(66379)
end
ipc.sleep(1000)
-- Beacon Lights OFF
BLI = logic.And(ipc.readUW(0x0D0C), 0x2)
if BLI ~= 0 then
ipc.control(66239)
end
ipc.sleep(1000)
-- Landing Lights OFF
LLI = logic.And(ipc.readUW(0x0D0C), 0x4)
if LLI ~= 0 then
ipc.control(65751)
end
ipc.sleep(1000)
-- Taxi Lights OFF
TLI = logic.And(ipc.readUW(0x0D0C), 0x8)
if TLI ~= 0 then
ipc.control(66240)
end
ipc.sleep(1000)
-- Strobe Lights OFF
SLI = logic.And(ipc.readUW(0x0D0C), 0x16)
if SLI ~= 0 then
ipc.control(65560)
end
ipc.sleep(1000)
-- Panel Lights OFF
PLI = logic.And(ipc.readUW(0x0D0C), 0x32)
if PLI ~= 0 then
ipc.control(65750)
end
ipc.sleep(1000)
-- Recon Lights OFF
RLI = logic.And(ipc.readUW(0x0D0C), 0x64)
if RLI ~= 0 then
ipc.control(66377)
end
ipc.sleep(1000)
-- Wing Lights OFF
WING = logic.And(ipc.readUW(0x0D0C), 0x128)
if WING ~= 0 then
ipc.control(66378)
end
ipc.sleep(1000)
-- LOGO Lights OFF
LOG = logic.And(ipc.readUW(0x0D0C), 0x256)
if LOG ~= 0 then
ipc.control(66376)
end
ipc.sleep(1000)
-- Cabin Lights OFF
CLI = logic.And(ipc.readUW(0x0D0C), 0x512)
if CLI ~= 0 then
ipc.control(66579)
end
ipc.sleep(1000)
ipc.display("All lights switched off!\n Thanks for your patience, Captain!")
ipc.sleep(2500)
ipc.display ("")
elseif questvar ~= "y" then
ipc.display("Ok, was just a question, Sir!\nHave a nice day...")
ipc.sleep(3000)
end
ipc.display("")
my question is that the last 3 lights (wing, logo, cabin) do not work so elegantly. If they ON, and I run the script, then all lights is being switched off except the cabin lights. If I then run the script again then the cabin lights is switched OFF, but logo lights is switched ON again. according to me if a light is OFF, then just nothing must happen.
Can anyone maybe spot my mistake or guide me why the last 3 lights do not work properly. The only thing that is trhe same between them is that the "offsett" is more then 2 characters (124, 256 and 512). Could it maybe have something to do with that, as all thos 1 to 64 all seem to work correctly?













