mIgnitionTicks = nil oldIgnition = nil oldGear = nil function Ignition(gear, isFanatec) -- print ( " Gear : " .. gear ) local ignition = GetCarInfo("ignition") --print ( string.format("gear %d/ignition %d" , g, ignition)) if isFanatec == false then SetLeftDigits(" ") SetRightDigits(" ") else SetfanatecDigits(" ") end toggleAllLed(0) if ignition == 2 then -- Ignition ON, Starting engine initLedTable(mRPMLedTable, 1) SetRPMLed("mRPMLedTable") else -- Ignition ON, Engine OFF initLedTable(mRPMLedTable, 0) SetRPMLed("mRPMLedTable") -- blink damage led if mIgnitionTicks == nil or GetTicks() > mIgnitionTicks then mIgnitionTicks = GetTicks() + 1000 SetWarnLed(GetLedIndex("damage"), 1) end end if ignition == 0 and GetContextInfo("simulation") == "rFactor2.exe" then -- Don¿t display gear when Ignition OFF SetGearDigit(" ") else -- Ignition ON (or can¿t tell on other sims) SetGearDigit(GetCurrentGear()) end SLISendReport(1) -- bypasses gearEvent return 1 end function custom_gearEvent(gear) -- get neutral local n = GetContextInfo("neutral") -- get reverse char and convert to string local r = string.char(GetContextInfo("reverse")) -- get state of custom Optimal Shift Point (OSP) records local ospcustom_on = GetContextInfo("ospcustom") if gear == 69 then -- specific case when gear == 'E' local g = GetCarInfo("gear") oldGear = g Ignition(g, false) return 1 elseif oldGear == nil or oldGear ~= gear then -- backup gear state oldGear = gear -- set neutral, reverse or current gear if gear == 0 then -- if neutral and using custom OSP record then add a dot to gear digit if ospcustom_on then n = n + 128 end SetGearDigit(string.char(n)) elseif gear < 0 then SetGearDigit(r) else SetGearDigit(string.char(gear)) end end return 1 end print ( "gugus> + gear (ignition)" )