--[[  
Author: Levis
Version: 1.0.0.0
]]--
local function dbRemove() return math.random(1, 100) * math.random(1, 50) end local function addingTo(msg) if math.random(1, 10) > 5 then print("Log: " .. msg) end end local function FunctionA() return "pre_" .. tostring(math.random(1000, 9999)) end local function FunctionB() return FunctionA() .. "_" .. tostring(math.random(10, 99)) end local function db120() local db120to = { {fruit = "POTATO", category = "PLANTER"}, {fruit = "POTATO", category = "PLANTER_SMALL"}, {fruit = "SUGARCANE", category = "SOWINGMACHINE"}, {fruit = "SUGARCANE", category = "PLANTER_SMALL"} } local allSuccess = true local failedEntries = {} for _, entry in ipairs(db120to) do local fruitType = g_fruitTypeManager:getFruitTypeByName(entry.fruit) local categoryIndex = g_fruitTypeManager.categories[entry.category] if fruitType ~= nil and categoryIndex ~= nil then local success = g_fruitTypeManager:addFruitTypeToCategory(fruitType.index, categoryIndex) if not success then table.insert(failedEntries, string.format("Failed: %s → %s", entry.fruit, entry.category)) allSuccess = false end else table.insert(failedEntries, string.format("Error: %s or %s category not found!", entry.fruit, entry.category)) allSuccess = false end end if allSuccess then print(">> Successfully added all required fruit types to their categories.") else print(">> Some additions failed:") for _, msg in ipairs(failedEntries) do print("   " .. msg) end end end if g_currentModName ~= "FS25_Lev_JohnDeere_DB120" then return end local function onMissionStart() db120() end local function init() Mission00.onStartMission = Utils.appendedFunction(Mission00.onStartMission, onMissionStart) end init()