d = 0
df = 0
w = 0
wp = 0
t = 0
tl = 0
h = 0
hz = 0
br = 0
local cm = 0
canRxAdd(418381601)
canRxAdd(351211806)
setTickRate(20)
function onCanRx(bus, id, dlc, data)
if id == 418381601 then
bn = data [4]
bs = data [5]
if bn == 3 and bs == 1 then
t = (t + 1)
if (t % 2 == 0) then
tl = 0
else
tl = 127
end
end
if bn == 2 and bs == 1 then
w = (w + 1)
if (w % 2 == 0) then
wp = 0
else
wp = 127
end
end
if bn == 1 and bs == 1 then
d = (d + 1)
if (d % 2 == 0) then
df = 0
else
df = 127
end
end
if bn == 5 and bs == 1 then
h = (h + 1)
if (h % 2 == 0) then
hz = 0
else
hz = 127
end
end
end
if id == 351211806 then
bks = data [1]
bk = data [4]
if bks == 128 and bk == 16 then
br = 127
else
if bks == 128 and bk == 0 then
br = 0
end
end
end
end
function pdmSetup()
txCan(1, 351215121, 1, { 0, 1, 255, 0, 255, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 2, 255, 0, 254, 255, 4, 255 })
txCan(1, 351215121, 1, { 0, 3, 255, 0, 255, 255, 6, 45 })
txCan(1, 351215121, 1, { 0, 4, 255, 0, 254, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 5, 75, 1, 252, 255, 5, 255 })
txCan(1, 351215121, 1, { 0, 6, 75, 1, 252, 255, 5, 255 })
txCan(1, 351215121, 1, { 0, 7, 255, 1, 252, 255, 4, 255 })
txCan(1, 351215121, 1, { 0, 8, 255, 0, 254, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 9, 255, 0, 254, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 10, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215121, 1, { 0, 11, 255, 0, 255, 255, 6, 173 })
txCan(1, 351215121, 1, { 0, 12, 255, 0, 252, 255, 4, 255 })
txCan(1, 351215121, 1, { 6, 110, 110, 110, 46, 109, 109, 255 })
txCan(1, 351215121, 1, { 7, 110, 110, 110, 28, 44, 110, 255 })
txCan(1, 351215889, 1, { 0, 1, 255, 0, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 2, 255, 0, 255, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 3, 255, 0, 255, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 4, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 5, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 6, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 7, 255, 0, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 8, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 9, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 10, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 11, 255, 1, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 12, 255, 1, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 6, 110, 110, 110, 44, 44, 44, 255 })
txCan(1, 351215889, 1, { 7, 46, 44, 44, 44, 110, 110, 255 })
end
function radFan()
local fan = getOutput("isFanOn")
if fan == 1 then
rf = 127
else
rf = 0
end
end
function fuelPump()
local fuel = getOutput("isFuelPumpOn")
if fuel == 1 then
fs = 127
else
fs = 0
end
end
function onTick()
if cm == 0 then
pdmSetup()
cm = 1
end
fuelPump()
radFan()
txCan(1, 351215121, 1, { 4, rf, 127, 0, 127, wp, 0, 255 })
txCan(1, 351215121, 1, { 5, df, 127, 127, 0, 0, 127, 63 })
txCan(1, 351215889, 1, { 4, br, tl, hz, 0, 0, 0, 63 })
txCan(1, 351215889, 1, { 5, fs, 0, 0, 0, fs, fs, 63 })
end
d = 0
df = 0
w = 0
wp = 0
t = 0
tl = 0
h = 0
hz = 0
br = 0
local cm = 0
canRxAdd(418381601)
canRxAdd(351211806)
setTickRate(20)
function onCanRx(bus, id, dlc, data)
if id == 418381601 then
bn = data [4]
bs = data [5]
if bn == 3 and bs == 1 then
t = (t + 1)
if (t % 2 == 0) then
tl = 0
else
tl = 127
end
end
if bn == 2 and bs == 1 then
w = (w + 1)
if (w % 2 == 0) then
wp = 0
else
wp = 127
end
end
if bn == 1 and bs == 1 then
d = (d + 1)
if (d % 2 == 0) then
df = 0
else
df = 127
end
end
if bn == 5 and bs == 1 then
h = (h + 1)
if (h % 2 == 0) then
hz = 0
else
hz = 127
end
end
end
if id == 351211806 then
bks = data [1]
bk = data [4]
if bks == 128 and bk == 16 then
br = 127
else
if bks == 128 and bk == 0 then
br = 0
end
end
end
end
function pdmSetup()
txCan(1, 351215121, 1, { 0, 1, 255, 0, 255, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 2, 255, 0, 254, 255, 4, 255 })
txCan(1, 351215121, 1, { 0, 3, 255, 0, 255, 255, 6, 45 })
txCan(1, 351215121, 1, { 0, 4, 255, 0, 254, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 5, 75, 1, 252, 255, 5, 255 })
txCan(1, 351215121, 1, { 0, 6, 75, 1, 252, 255, 5, 255 })
txCan(1, 351215121, 1, { 0, 7, 255, 1, 252, 255, 4, 255 })
txCan(1, 351215121, 1, { 0, 8, 255, 0, 254, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 9, 255, 0, 254, 255, 0, 255 })
txCan(1, 351215121, 1, { 0, 10, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215121, 1, { 0, 11, 255, 0, 255, 255, 6, 173 })
txCan(1, 351215121, 1, { 0, 12, 255, 0, 252, 255, 4, 255 })
txCan(1, 351215121, 1, { 6, 110, 110, 110, 46, 109, 109, 255 })
txCan(1, 351215121, 1, { 7, 110, 110, 110, 28, 44, 110, 255 })
txCan(1, 351215889, 1, { 0, 1, 255, 0, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 2, 255, 0, 255, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 3, 255, 0, 255, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 4, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 5, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 6, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 7, 255, 0, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 8, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 9, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 10, 255, 0, 255, 255, 6, 255 })
txCan(1, 351215889, 1, { 0, 11, 255, 1, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 0, 12, 255, 1, 252, 255, 4, 255 })
txCan(1, 351215889, 1, { 6, 110, 110, 110, 44, 44, 44, 255 })
txCan(1, 351215889, 1, { 7, 46, 44, 44, 44, 110, 110, 255 })
end
function radFan()
local fan = getOutput("isFanOn")
if fan == 1 then
rf = 127
else
rf = 0
end
end
function fuelPump()
local fuel = getOutput("isFuelPumpOn")
if fuel == 1 then
fs = 127
else
fs = 0
end
end
function onTick()
if cm == 0 then
pdmSetup()
cm = 1
end
fuelPump()
radFan()
txCan(1, 351215121, 1, { 4, rf, 127, 0, 127, wp, 0, 255 })
txCan(1, 351215121, 1, { 5, df, 127, 127, 0, 0, 127, 63 })
txCan(1, 351215889, 1, { 4, br, tl, hz, 0, 0, 0, 63 })
txCan(1, 351215889, 1, { 5, fs, 0, 0, 0, fs, fs, 63 })
end