Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modVersion = "1.30.03"
- -----------------------------------------------------------------------
- ----- START OF USER CONFIGURABLE OPTIONS --------------------------
- ----- These are saved in Settings/settings.ini ------------------------
- -----------------------------------------------------------------------
- ini = {}
- ini.consumable = {}
- ini.autoHealthInhaler ={}
- ini.Main = {}
- ini.Junk = {}
- ini.SimplifyGrenades = {}
- ini.SimplifyClothesMod = {}
- ini.SimplifyWeaponMod = {}
- ini.SimplifyWeapon = {}
- ini.SimplifyFeet = {}
- ini.SimplifyHeadArmor = {}
- ini.SimplifyChestArmor = {}
- ini.SimplifyInnerChestArmor = {}
- ini.SimplifyFaceArmor = {}
- ini.SimplifyLegArmor = {}
- ini.SimplifyHealthItems = {}
- ini.SimplifyShards = {}
- -----------------------------------------------------------------------
- ----- END OF USER CONFIGURABLE OPTIONS --------------------------
- -----------------------------------------------------------------------
- ini.Main.UseMod = true
- ini.Main.followCETOverlay = true
- ini.SimplifyShards.SimplifyShards = false
- i = 0
- timeAllowedToUseAny = os.time() + 5
- nextAvailableTime = timeAllowedToUseAny
- prevItemQuantity = 0
- nextConsumeTime_FoodBeverages = timeAllowedToUseAny
- nextConsumeTime_Booster = timeAllowedToUseAny
- nextInhalerTime = timeAllowedToUseAny
- pauseDetected = false
- pauseDetectionCheck2 = false
- lastActionDescription = {}
- lastActionValue = {}
- lastActionTime = {}
- maxMessages = 15
- for i = 0, maxMessages do
- lastActionDescription[i] = ""
- lastActionValue[i] = ""
- lastActionTime[i] = ""
- end
- currentActionPass = 0
- lastTime = os.time() + 5
- initNotDone = true
- timeAccumulation = 0
- scriptInverval = 0
- slowDown = 0
- startupDelayTime = os.time() + 5 --globalDelayinSeconds
- hasSystemsBeenRetrieved = false
- globalDelayinSeconds = 3
- currentLevel = 0
- playerhealthpercent = 0
- previousPlayerHealth = 0
- --systems
- ts = nil
- ssc = nil
- timeSystem = nil
- equipmentSystem = nil
- statsPoolSystem = nil
- player = nil
- ss = nil
- imgr = nil
- espd = nil
- equippedArrayItemID = {}
- equippedArrayILevel = {}
- equippedArraySlot = {}
- equippedArrayType = {}
- for i=0,20 do
- equippedArrayItemID[i] = 0
- equippedArrayILevel[i] = -1
- equippedArraySlot[i] = ""
- equippedArrayType[i] = ""
- end
- currentRetrievalPass = 0
- highestEffectiveDPSWeapon = 0
- onlyDoOnceAfterIni = true
- itemTypeArray = {}
- manualModeTriggered = false
- itemSelected = false
- --session stats
- session_Food = 0
- session_Drinks = 0
- session_Alcohol = 0
- session_ItemsSold = 0
- session_ItemsDisassembled = 0
- session_MoneyGained = 0
- highestArmorLevel = {}
- equippedArmorLevel = {}
- highestArmorLevelOverall = {}
- foundArmorThatsBetter = false
- ------------------------------------------------------------------------
- MyMod = { description = "Simplified Inventory" }
- function MyMod:new()
- o = {}
- setmetatable(o, self)
- self.__index = self
- self.description = "Simplified Inventory"
- --print(modDirectory2("init.lua"))
- --consumableListModule = require(modDirectory2("init.lua") .. "consumableList")
- return o
- end
- ---------------------------------------------------------------------------
- local boosterItems = {
- "Items.StaminaBooster",
- "Items.HealthBooster",
- "Items.MemoryBooster",
- "Items.CarryCapacityBooster"
- }
- --sorted by best to worst
- local inhalerItems = {
- "Items.FirstAidWhiffV2",
- "Items.FirstAidWhiffV1",
- "Items.FirstAidWhiffV2",
- "Items.FirstAidWhiffV1",
- "Items.FirstAidWhiffV0",
- "Items.BonesMcCoy70V2",
- "Items.BonesMcCoy70V1",
- "Items.BonesMcCoy70V0"
- }
- local alcoholItems = {
- "Items.GoodQualityAlcohol1",
- "Items.GoodQualityAlcohol2",
- "Items.GoodQualityAlcohol3",
- "Items.GoodQualityAlcohol4",
- "Items.GoodQualityAlcohol5",
- "Items.GoodQualityAlcohol6",
- "Items.LowQualityAlcohol1",
- "Items.LowQualityAlcohol2",
- "Items.LowQualityAlcohol3",
- "Items.LowQualityAlcohol4",
- "Items.LowQualityAlcohol5",
- "Items.LowQualityAlcohol6",
- "Items.LowQualityAlcohol7",
- "Items.LowQualityAlcohol8",
- "Items.LowQualityAlcohol9",
- "Items.MediumQualityAlcohol1",
- "Items.MediumQualityAlcohol2",
- "Items.MediumQualityAlcohol3",
- "Items.MediumQualityAlcohol4",
- "Items.MediumQualityAlcohol5",
- "Items.MediumQualityAlcohol6",
- "Items.MediumQualityAlcohol7",
- "Items.NomadsAlcohol1",
- "Items.NomadsAlcohol2",
- "Items.TopQualityAlcohol1",
- "Items.TopQualityAlcohol2",
- "Items.TopQualityAlcohol3",
- "Items.TopQualityAlcohol4",
- "Items.TopQualityAlcohol5",
- "Items.TopQualityAlcohol6",
- "Items.TopQualityAlcohol7"
- }
- local drinkItems = {
- "Items.GoodQualityDrink1",
- "Items.GoodQualityDrink11",
- "Items.GoodQualityDrink2",
- "Items.GoodQualityDrink3",
- "Items.GoodQualityDrink4",
- "Items.GoodQualityDrink5",
- "Items.GoodQualityDrink6",
- "Items.GoodQualityDrink7",
- "Items.GoodQualityDrink8",
- "Items.GoodQualityDrink9",
- "Items.GoodQualityDrink10",
- "Items.LowQualityDrink1",
- "Items.LowQualityDrink10",
- "Items.LowQualityDrink11",
- "Items.LowQualityDrink12",
- "Items.LowQualityDrink13",
- "Items.LowQualityDrink2",
- "Items.LowQualityDrink3",
- "Items.LowQualityDrink4",
- "Items.LowQualityDrink5",
- "Items.LowQualityDrink6",
- "Items.LowQualityDrink7",
- "Items.LowQualityDrink8",
- "Items.LowQualityDrink9",
- "Items.MediumQualityDrink1",
- "Items.MediumQualityDrink10",
- "Items.MediumQualityDrink11",
- "Items.MediumQualityDrink12",
- "Items.MediumQualityDrink13",
- "Items.MediumQualityDrink14",
- "Items.MediumQualityDrink2",
- "Items.MediumQualityDrink3",
- "Items.MediumQualityDrink4",
- "Items.MediumQualityDrink5",
- "Items.MediumQualityDrink6",
- "Items.MediumQualityDrink7",
- "Items.MediumQualityDrink8",
- "Items.MediumQualityDrink9",
- "Items.NomadsDrink1",
- "Items.NomadsDrink2"
- }
- local foodItems = {
- "Items.GoodQualityFood1",
- "Items.GoodQualityFood10",
- "Items.GoodQualityFood11",
- "Items.GoodQualityFood12",
- "Items.GoodQualityFood13",
- "Items.GoodQualityFood2",
- "Items.GoodQualityFood3",
- "Items.GoodQualityFood4",
- "Items.GoodQualityFood5",
- "Items.GoodQualityFood6",
- "Items.GoodQualityFood7",
- "Items.GoodQualityFood8",
- "Items.GoodQualityFood9",
- "Items.LowQualityFood1",
- "Items.LowQualityFood10",
- "Items.LowQualityFood11",
- "Items.LowQualityFood12",
- "Items.LowQualityFood13",
- "Items.LowQualityFood14",
- "Items.LowQualityFood15",
- "Items.LowQualityFood16",
- "Items.LowQualityFood17",
- "Items.LowQualityFood18",
- "Items.LowQualityFood19",
- "Items.LowQualityFood20",
- "Items.LowQualityFood21",
- "Items.LowQualityFood22",
- "Items.LowQualityFood23",
- "Items.LowQualityFood24",
- "Items.LowQualityFood25",
- "Items.LowQualityFood26",
- "Items.LowQualityFood27",
- "Items.LowQualityFood28",
- "Items.LowQualityFood3",
- "Items.LowQualityFood5",
- "Items.LowQualityFood6",
- "Items.LowQualityFood7",
- "Items.LowQualityFood8",
- "Items.LowQualityFood9",
- "Items.MediumQualityFood1",
- "Items.MediumQualityFood10",
- "Items.MediumQualityFood11",
- "Items.MediumQualityFood12",
- "Items.MediumQualityFood13",
- "Items.MediumQualityFood14",
- "Items.MediumQualityFood15",
- "Items.MediumQualityFood16",
- "Items.MediumQualityFood17",
- "Items.MediumQualityFood18",
- "Items.MediumQualityFood19",
- "Items.MediumQualityFood2",
- "Items.MediumQualityFood20",
- "Items.MediumQualityFood3",
- "Items.MediumQualityFood4",
- "Items.MediumQualityFood5",
- "Items.MediumQualityFood6",
- "Items.MediumQualityFood7",
- "Items.MediumQualityFood8",
- "Items.MediumQualityFood9",
- "Items.NomadsFood1",
- "Items.NomadsFood2"
- }
- local slots = {
- "FeetClothing",
- "HeadArmor",
- "ChestArmor",
- "InnerChest",
- "InnerChestArmor",
- "FaceArmor",
- "LegArmor",
- "Weapon"
- }
- local slotsFriendlyName = {
- "Feet",
- "Head",
- "Outer",
- "InnerChest---",
- "Inner",
- "Face",
- "Leg",
- "Weapon"
- }
- local equipAreaList = {
- "Head",
- "Face",
- "OuterChest",
- "InnerChest",
- "Feet",
- "Legs",
- "Outfit",
- "Weapon"
- }
- local weaponTagList = {
- "Rifle Assault",
- "Knuckles",
- "Two Hand Hammer",
- "Handgun",
- "HeavyWeapon",
- "Katana",
- "Knife",
- "LMG",
- "One Hand Blade",
- "One Hand Club",
- "Rifle Precision",
- "Revolver",
- "Shotgun",
- "Shotgun Dual",
- "Rifle Sniper",
- "SMG",
- "Two Hand Club",
- "Unique"
- }
- registerForEvent("onInit", function()
- print("plugins\\cyber_engine_tweaks\\mods\\food\\init.lua loaded")
- print("Simplified Inventory | Ver: ", modVersion)
- startupDelayTime = os.time() + globalDelayinSeconds
- initNotDone = false
- MyMod:INI_Check_Nills()
- end)
- registerForEvent("onShutdown", function()
- --save settings to ini file
- MyMod:INI_File_Save()
- end)
- registerForEvent("onOverlayOpen", function()
- if(ini.Main.followCETOverlay) then
- onOpenDebug = true
- end
- end)
- registerForEvent("onOverlayClose", function()
- if(ini.Main.followCETOverlay) then
- onOpenDebug = false
- end
- end)
- ------------------------------------------------------------------------------------------------------------
- registerHotkey("tryEatConsumable", "Keybind to consume both Food and Beverage", function()
- MyMod:tryEatConsumable()
- end)
- registerHotkey("tryUseBooster", "Keybind to use any available Booster", function()
- MyMod:tryUseBooster()
- end)
- registerHotkey("tryDebugMenu", "Keybind to Show Menu", function()
- onOpenDebug = not onOpenDebug
- end)
- registerHotkey("tryFlipModUsage", "Keybind to Toggle Mod ON/OFF", function()
- ini.Main.UseMod = not ini.Main.UseMod
- end)
- registerHotkey("tryProcessMainFunctionOnce", "Keybind for Manual Mode", function()
- MyMod:TryToProcessOnce()
- end)
- registerHotkey("toggleEquipmentWindow", "Keybind for Equipment Notification window", function()
- MyMod:ToggleEquipmentWindow()
- end)
- ------------------------------------------------------------------------------------------------------------
- TimeLoading = 0
- function MyMod:TryToProcessOnce()
- if(initNotDone) then
- do return end
- end
- if(onlyDoOnceAfterIni) then
- do return end
- end
- MyMod:LogAction("Manual mode triggered")
- manualModeTriggered = true
- end
- function MyMod:ToggleEquipmentWindow()
- ini.Main.UseEquipmentNotification = not ini.Main.UseEquipmentNotification
- end
- registerForEvent("onUpdate", function(deltaTime)
- if(initNotDone) then
- do return end
- end
- --wait 5s after being loaded
- if(startupDelayTime > os.time()) then
- do return end
- end
- if(onlyDoOnceAfterIni) then
- startupDelayTime = os.time() + 1
- MyMod:INI_File_Load()
- MyMod:INI_File_Save()
- onlyDoOnceAfterIni = false
- print("loaded ini")
- end
- if(ini.Main.UseMod == false) then
- do return end
- end
- if(MyMod:CheckSystems() == false) then
- startupDelayTime = os.time() + 3
- do return end
- end
- ------------------------------------------------------------------------
- --Check if we're paused
- timeAccumulation = timeAccumulation + deltaTime
- pauseDetected = false
- if(timeAccumulation > 10) then
- timeAccumulation = 10
- end
- --------------------------------------------------------------------
- --we come in this script every 0.2s
- scriptInverval = scriptInverval + deltaTime
- if(scriptInverval < 0.5) then
- do return end
- else
- scriptInverval = 0
- end
- if(MyMod:IsMainMenu() == true and (ini.Main.IgnorePauseDetection == false or ini.Main.UseManualMode == false)) then
- pauseDetected = true
- pauseDetectionCheck2 = true
- do return end
- end
- if(IsPlayerInAnyMenu() and (ini.Main.IgnorePauseDetection == false or ini.Main.UseManualMode == false)) then
- pauseDetected = true
- pauseDetectionCheck2 = true
- do return end
- end
- --it has come to this
- MyMod:GetSystems()
- if(espd == nil) then
- do return end ;
- end
- if(imgr == nil) then
- return;
- end
- tempLevel = ss:GetStatValue(player:GetEntityID(), 'PowerLevel')
- currentLevel = tempLevel
- --Script is finally going to do stuff, let's make sure there are no nils hanging around
- playerHealthPercent = statsPoolSystem:GetStatPoolValue(player:GetEntityID(), 'Health', true)
- if(playerHealthPercent > 0 and previousPlayerHealth == 0 and ini.Main.UseManualMode == false) then
- --clear the debug menu
- MyMod:ClearDebugMenu()
- end
- if(playerHealthPercent == 0 or currentLevel <= 1.0 ) then
- pauseDetected = true
- pauseDetectionCheck2 = true
- do return end
- end
- previousPlayerHealth = playerHealthPercent
- currentItemQuantity = ts:GetTotalItemQuantity(player)
- if(currentItemQuantity == 389) then
- pauseDetectionCheck2 = true
- pauseDetected = true
- do return end
- end
- ----------------------------------
- pauseDetected = false
- pauseDetectionCheck2 = false
- if(ini.Main.UseManualMode == false or manualModeTriggered == true) then
- manualModeTriggered = false
- MyMod:ProcessMainFunctionOnce()
- end
- end)
- -- called on each frame when it is time to draw (after onUpdate), draw things here!
- registerForEvent("onDraw", function()
- if(onOpenDebug) then
- ImGui.SetNextWindowPos(80, 170, ImGuiCond.FirstUseEver)
- ImGui.SetNextWindowSize(400, 225, ImGuiCond.FirstUseEver)
- if (ImGui.Begin("Simplified Inventory")) then
- --ImGui.PushStyleColor(ImGuiCol.WindowBg, 0.9, 0.9, 0.9, 0.9);
- if (ImGui.BeginTabBar("TABS")) then
- -----DEBUG VIEW TAB
- if (ImGui.BeginTabItem("Debug View")) then
- ImGui.Spacing()
- if (ImGui.Button("Manual Mode: Process Once")) then
- MyMod:TryToProcessOnce()
- end
- ImGui.Spacing()
- ImGui.Spacing();
- ImGui.Separator()
- if(ini.Main.IgnorePauseDetection == false and ini.Main.UseManualMode == false) then
- if(currentLevel <= 1.0) then
- ImGui.Text("**DISABLED due to low level: " .. tostring(currentLevel))
- else
- ImGui.Text("pauseDetected: " .. tostring(pauseDetectionCheck2))
- end
- else
- if(ini.Main.UseManualMode == true) then
- ImGui.Text("MANUAL MODE ACTIVATED")
- else
- ImGui.Text("pauseDetected: IGNORED")
- end
- end
- if ImGui.CollapsingHeader("Player Info: ") then
- ImGui.Text("playerHealthPercent: " .. tostring(playerHealthPercent))
- ImGui.Text("currentItemQuantity: " .. tostring(currentItemQuantity))
- --Debug show stats
- ImGui.Text("highestEffectiveDPSWeapon: " .. tostring(highestEffectiveDPSWeapon))
- for jj=0, 9 do
- if(equippedArrayILevel[jj] > 0) then
- ImGui.Text(tostring(equippedArraySlot[jj]) .. ": " .. tostring(equippedArrayILevel[jj]))
- end
- end
- end
- ImGui.Spacing()
- ImGui.Separator()
- if ImGui.CollapsingHeader("Messages: ") then
- local arrowString = ""
- for j=0, maxMessages do
- arrowString = ""
- if(j == currentActionPass) then
- arrowString = " -> "
- end
- ImGui.Text(tostring(arrowString) .. tostring(lastActionDescription[j]) .. tostring(lastActionValue[j])) --.. " @: " .. tostring(lastActionTime[j]))
- end
- end
- ImGui.Spacing()
- ImGui.Separator()
- if ImGui.CollapsingHeader("Session Stats: ") then
- ImGui.Text("Food converted: " .. session_Food)
- ImGui.Text("Drinks converted: " .. session_Drinks)
- ImGui.Text("Alcohol converted: " .. session_Alcohol)
- ImGui.Spacing()
- ImGui.Text("Items Sold: " .. session_ItemsSold)
- ImGui.Text("Items Disassembled: " .. session_ItemsDisassembled)
- ImGui.Spacing()
- ImGui.Text("Money gained: " .. session_MoneyGained)
- end
- ImGui.EndTabItem();
- end
- -----SETTINGS TAB
- if (ImGui.BeginTabItem("Settings")) then
- if (ImGui.Button("Force Save to settings.ini")) then
- MyMod:INI_File_Save()
- end
- if (ImGui.Button("Process Once")) then
- MyMod:TryToProcessOnce()
- end
- ini.Main.UseMod = ImGui.Checkbox("Use Mod", ini.Main.UseMod)
- ini.Main.followCETOverlay = ImGui.Checkbox("Close and Open with CET Overlay", ini.Main.followCETOverlay)
- ini.Main.UseManualMode = ImGui.Checkbox("Use Manual Mode (Does not process items automatically)", ini.Main.UseManualMode)
- ini.Main.IgnorePauseDetection = ImGui.Checkbox("Ignore Pause Detection", ini.Main.IgnorePauseDetection)
- ini.Main.UseEquipmentNotification = ImGui.Checkbox("Use Equipment Notification", ini.Main.UseEquipmentNotification)
- ImGui.Spacing()
- ImGui.Separator()
- ImGui.PushItemWidth(250);
- ini.Main.simplifiedInterval = ImGui.SliderInt("Timer Interval", ini.Main.simplifiedInterval, 0, 10, "%d");
- ini.Main.processItemsOfLesserItemLevel_Only = ImGui.Checkbox("Process items Of lesser item levels ONLY", ini.Main.processItemsOfLesserItemLevel_Only)
- ini.Main.ignoreIconicItems = ImGui.Checkbox("Do NOT process Iconic Items", ini.Main.ignoreIconicItems)
- ImGui.Spacing()
- ImGui.Spacing()
- optionTextforSlider = {}
- optionTextforSlider[0] = "Nothing"
- optionTextforSlider[1] = "AutoSell"
- optionTextforSlider[2] = "AutoDismantle"
- tempText = ""
- tempValue = ""
- if ImGui.CollapsingHeader("Consumables:") then
- ImGui.PushItemWidth(250);
- ini.consumable.ProcessAlcohol = ImGui.Checkbox("Process Alcohol", ini.consumable.ProcessAlcohol)
- ini.consumable.ProcessFoods = ImGui.Checkbox("Process Foods", ini.consumable.ProcessFoods)
- ini.consumable.ProcessDrinks = ImGui.Checkbox("Process Drinks", ini.consumable.ProcessDrinks)
- ImGui.Spacing()
- ImGui.Separator()
- ini.consumable.foodToKeep, inputConfirmed = ImGui.InputText("foodToKeep", tostring(ini.consumable.foodToKeep), 100, ImGuiInputTextFlags.EnterReturnsTrue)
- ini.consumable.beverageToKeep, inputConfirmed = ImGui.InputText("beverageToKeep", tostring(ini.consumable.beverageToKeep), 100, ImGuiInputTextFlags.EnterReturnsTrue)
- ini.consumable.useAlcoholCraft = ImGui.Checkbox("Auto Convert Alcohol to Moonshine (or whatever you chose below)", ini.consumable.useAlcoholCraft)
- ini.consumable.alcoholToKeep, inputConfirmed = ImGui.InputText("alcoholToKeep", tostring(ini.consumable.alcoholToKeep), 100, ImGuiInputTextFlags.EnterReturnsTrue)
- ini.consumable.useHotkey_FoodBeverages = ImGui.Checkbox("useHotkey_FoodBeverages", ini.consumable.useHotkey_FoodBeverages)
- ini.consumable.useHotkey_Booster = ImGui.Checkbox("Use Hotkey for Booster", ini.consumable.useHotkey_Booster)
- end
- if ImGui.CollapsingHeader("Health Items:") then
- ImGui.PushItemWidth(250);
- tempValue = optionTextforSlider[ini.SimplifyHealthItems.MaxDoc_MK1]
- ini.SimplifyHealthItems.MaxDoc_MK1 = ImGui.SliderInt("MaxDoc_MK1", ini.SimplifyHealthItems.MaxDoc_MK1, 0, 2, tempValue);
- tempValue = optionTextforSlider[ini.SimplifyHealthItems.MaxDoc_MK2]
- ini.SimplifyHealthItems.MaxDoc_MK2 = ImGui.SliderInt("MaxDoc_MK2", ini.SimplifyHealthItems.MaxDoc_MK2, 0, 2, tempValue);
- tempValue = optionTextforSlider[ini.SimplifyHealthItems.MaxDoc_MK3]
- ini.SimplifyHealthItems.MaxDoc_MK3 = ImGui.SliderInt("MaxDoc_MK3", ini.SimplifyHealthItems.MaxDoc_MK3, 0, 2, tempValue);
- tempValue = optionTextforSlider[ini.SimplifyHealthItems.Bounce_Back_MK1]
- ini.SimplifyHealthItems.Bounce_Back_MK1 = ImGui.SliderInt("Bounce_Back_MK1", ini.SimplifyHealthItems.Bounce_Back_MK1, 0, 2, tempValue);
- tempValue = optionTextforSlider[ini.SimplifyHealthItems.Bounce_Back_MK2]
- ini.SimplifyHealthItems.Bounce_Back_MK2 = ImGui.SliderInt("Bounce_Back_MK2", ini.SimplifyHealthItems.Bounce_Back_MK2, 0, 2, tempValue);
- tempValue = optionTextforSlider[ini.SimplifyHealthItems.Bounce_Back_MK3]
- ini.SimplifyHealthItems.Bounce_Back_MK3 = ImGui.SliderInt("Bounce_Back_MK3", ini.SimplifyHealthItems.Bounce_Back_MK3, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Auto Health:") then
- ImGui.PushItemWidth(250);
- ini.autoHealthInhaler.autoHealthInhaler = ImGui.Checkbox("Auto Use Health Inhaler", ini.autoHealthInhaler.autoHealthInhaler)
- ini.autoHealthInhaler.autoHealthInhalerThreshold = ImGui.SliderInt("autoHealthInhalerThreshold", ini.autoHealthInhaler.autoHealthInhalerThreshold, 0, 99, "%d");
- ini.autoHealthInhaler.autoHealthInhalerCoolDown = ImGui.SliderInt("autoHealthInhalerCoolDown (seconds)", ini.autoHealthInhaler.autoHealthInhalerCoolDown, 0, 60, "%d");
- end
- if ImGui.CollapsingHeader("Junk Items:") then
- ImGui.PushItemWidth(250);
- ini.Junk.autoCleanJunk = ImGui.Checkbox("Auto Clean Junk", ini.Junk.autoCleanJunk)
- ImGui.Spacing()
- ImGui.Separator()
- ini.Junk.sellAllJunk = ImGui.Checkbox("Sell All Junk", ini.Junk.sellAllJunk)
- ini.Junk.sellExpensiveJunk = ImGui.Checkbox("Sell Expensive Junk", ini.Junk.sellExpensiveJunk)
- ini.Junk.disassembleAllJunk = ImGui.Checkbox("Disassemble All Junk", ini.Junk.disassembleAllJunk)
- ini.Junk.disassembleCheapJunk = ImGui.Checkbox("Disassemble Cheap Junk", ini.Junk.disassembleCheapJunk)
- end
- if ImGui.CollapsingHeader("Grenades:") then
- ImGui.Text("Select the Grenade types to process:")
- ImGui.Spacing()
- ini.SimplifyGrenades.Biohazard = ImGui.Checkbox("Biohazard ", ini.SimplifyGrenades.Biohazard);ImGui.SameLine();
- ini.SimplifyGrenades.Cutting = ImGui.Checkbox("Cutting ", ini.SimplifyGrenades.Cutting);ImGui.SameLine();
- ini.SimplifyGrenades.Emp = ImGui.Checkbox("Emp ", ini.SimplifyGrenades.Emp);ImGui.SameLine();
- ini.SimplifyGrenades.Flash = ImGui.Checkbox("Flash", ini.SimplifyGrenades.Flash)
- ini.SimplifyGrenades.Frag = ImGui.Checkbox("Frag ", ini.SimplifyGrenades.Frag);ImGui.SameLine();
- ini.SimplifyGrenades.Incendiary = ImGui.Checkbox("Incendiary", ini.SimplifyGrenades.Incendiary);ImGui.SameLine();
- ini.SimplifyGrenades.Recon = ImGui.Checkbox("Recon", ini.SimplifyGrenades.Recon)
- ImGui.Spacing();ImGui.Spacing()
- tempText = "Common - Grenades"
- tempValue = optionTextforSlider[ini.SimplifyGrenades.SimplifyGrenades_Common]
- ini.SimplifyGrenades.SimplifyGrenades_Common = ImGui.SliderInt(tempText, ini.SimplifyGrenades.SimplifyGrenades_Common, 0, 2, tempValue);
- tempText = "Uncommon - Grenades"
- tempValue = optionTextforSlider[ini.SimplifyGrenades.SimplifyGrenades_Uncommon]
- ini.SimplifyGrenades.SimplifyGrenades_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyGrenades.SimplifyGrenades_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Grenades"
- tempValue = optionTextforSlider[ini.SimplifyGrenades.SimplifyGrenades_Rare]
- ini.SimplifyGrenades.SimplifyGrenades_Rare = ImGui.SliderInt(tempText, ini.SimplifyGrenades.SimplifyGrenades_Rare, 0, 2, tempValue);
- tempText = "Epic - Grenades"
- tempValue = optionTextforSlider[ini.SimplifyGrenades.SimplifyGrenades_Epic]
- ini.SimplifyGrenades.SimplifyGrenades_Epic = ImGui.SliderInt(tempText, ini.SimplifyGrenades.SimplifyGrenades_Epic, 0, 2, tempValue);
- tempText = "Legendary - Grenades"
- tempValue = optionTextforSlider[ini.SimplifyGrenades.SimplifyGrenades_Legendary]
- ini.SimplifyGrenades.SimplifyGrenades_Legendary = ImGui.SliderInt(tempText, ini.SimplifyGrenades.SimplifyGrenades_Legendary, 0, 2, tempValue);
- end
- ImGui.Spacing()
- ImGui.Separator()
- ImGui.Text("MODS")
- if ImGui.CollapsingHeader("Clothing Mods:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Clothing Mods"
- tempValue = optionTextforSlider[ini.SimplifyClothesMod.SimplifyClothesMod_Common]
- ini.SimplifyClothesMod.SimplifyClothesMod_Common = ImGui.SliderInt(tempText, ini.SimplifyClothesMod.SimplifyClothesMod_Common, 0, 2, tempValue);
- tempText = "Uncommon - Clothing Mods"
- tempValue = optionTextforSlider[ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon]
- ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Clothing Mods"
- tempValue = optionTextforSlider[ini.SimplifyClothesMod.SimplifyClothesMod_Rare]
- ini.SimplifyClothesMod.SimplifyClothesMod_Rare = ImGui.SliderInt(tempText, ini.SimplifyClothesMod.SimplifyClothesMod_Rare, 0, 2, tempValue);
- tempText = "Epic - Clothing Mods"
- tempValue = optionTextforSlider[ini.SimplifyClothesMod.SimplifyClothesMod_Epic]
- ini.SimplifyClothesMod.SimplifyClothesMod_Epic = ImGui.SliderInt(tempText, ini.SimplifyClothesMod.SimplifyClothesMod_Epic, 0, 2, tempValue);
- tempText = "Legendary - Clothing Mods"
- tempValue = optionTextforSlider[ini.SimplifyClothesMod.SimplifyClothesMod_Legendary]
- ini.SimplifyClothesMod.SimplifyClothesMod_Legendary = ImGui.SliderInt(tempText, ini.SimplifyClothesMod.SimplifyClothesMod_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Weapon Mods:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Weapon Mod"
- tempValue = optionTextforSlider[ini.SimplifyWeaponMod.SimplifyWeaponMod_Common]
- ini.SimplifyWeaponMod.SimplifyWeaponMod_Common = ImGui.SliderInt(tempText, ini.SimplifyWeaponMod.SimplifyWeaponMod_Common, 0, 2, tempValue);
- tempText = "Uncommon - Weapon Mod"
- tempValue = optionTextforSlider[ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon]
- ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Weapon Mod"
- tempValue = optionTextforSlider[ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare]
- ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare = ImGui.SliderInt(tempText, ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare, 0, 2, tempValue);
- tempText = "Epic - Weapon Mod"
- tempValue = optionTextforSlider[ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic]
- ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic = ImGui.SliderInt(tempText, ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic, 0, 2, tempValue);
- tempText = "Legendary - Weapon Mod"
- tempValue = optionTextforSlider[ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary]
- ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary = ImGui.SliderInt(tempText, ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Quickhack Mods:") then
- ImGui.Spacing()
- ImGui.PushItemWidth(250);
- ini.SimplifyShards.SimplifyShards = ImGui.Checkbox("Autosell Duplicate Quickhack Mods", ini.SimplifyShards.SimplifyShards)
- end
- ----------------------------------------------------------------------------------------------------------------------------------------
- ImGui.Spacing()
- ImGui.Separator()
- ImGui.Text("EQUIPMENT")
- if ImGui.CollapsingHeader("Weapons:") then
- ImGui.PushItemWidth(250);
- ini.SimplifyWeapon.KeepOneOfEachType = ImGui.Checkbox("Keep one of each weapon type", ini.SimplifyWeapon.KeepOneOfEachType)
- if(ini.SimplifyWeapon.KeepOneOfEachType) then
- ImGui.Indent();
- ImGui.TextWrapped("Select the weapon types you want to keep one of:");ImGui.Spacing()
- if ImGui.BeginListBox("", 350.0, 150.0) then
- ImGui.Spacing()
- ImGui.Selectable("Rifle Assault", ini.SimplifyWeapon.RifleAssault)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.RifleAssault = not ini.SimplifyWeapon.RifleAssault
- end
- ImGui.Selectable("Knuckles", ini.SimplifyWeapon.Knuckles)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Knuckles = not ini.SimplifyWeapon.Knuckles
- end
- ImGui.Selectable("Two Hand Hammer", ini.SimplifyWeapon.TwoHandHammer)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.TwoHandHammer = not ini.SimplifyWeapon.TwoHandHammer
- end
- ImGui.Selectable("Handgun", ini.SimplifyWeapon.Handgun)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Handgun = not ini.SimplifyWeapon.Handgun
- end
- ImGui.Selectable("Heavy Weapon", ini.SimplifyWeapon.HeavyWeapon)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.HeavyWeapon = not ini.SimplifyWeapon.HeavyWeapon
- end
- ImGui.Selectable("Katana", ini.SimplifyWeapon.Katana)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Katana = not ini.SimplifyWeapon.Katana
- end
- ImGui.Selectable("Knife", ini.SimplifyWeapon.Knife)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Knife = not ini.SimplifyWeapon.Knife
- end
- ImGui.Selectable("Light Machine Gun (LMG)", ini.SimplifyWeapon.LMG)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.LMG = not ini.SimplifyWeapon.LMG
- end
- ImGui.Selectable("One Hand Blade", ini.SimplifyWeapon.OneHandBlade)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.OneHandBlade = not ini.SimplifyWeapon.OneHandBlade
- end
- ImGui.Selectable("One Hand Club", ini.SimplifyWeapon.OneHandClub)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.OneHandClub = not ini.SimplifyWeapon.OneHandClub
- end
- ImGui.Selectable("Rifle Precision", ini.SimplifyWeapon.RiflePrecision)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.RiflePrecision = not ini.SimplifyWeapon.RiflePrecision
- end
- ImGui.Selectable("Revolver", ini.SimplifyWeapon.Revolver)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Revolver = not ini.SimplifyWeapon.Revolver
- end
- ImGui.Selectable("Shotgun", ini.SimplifyWeapon.Shotgun)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Shotgun = not ini.SimplifyWeapon.Shotgun
- end
- ImGui.Selectable("Shotgun Dual (Double-Barrel Shotgun)", ini.SimplifyWeapon.ShotgunDual)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.ShotgunDual = not ini.SimplifyWeapon.ShotgunDual
- end
- ImGui.Selectable("Rifle Sniper", ini.SimplifyWeapon.RifleSniper)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.RifleSniper = not ini.SimplifyWeapon.RifleSniper
- end
- ImGui.Selectable("Sub Machine Gun (SMG)", ini.SimplifyWeapon.SMG)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.SMG = not ini.SimplifyWeapon.SMG
- end
- ImGui.Selectable("Two Hand Club", ini.SimplifyWeapon.TwoHandClub)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.TwoHandClub = not ini.SimplifyWeapon.TwoHandClub
- end
- ImGui.Selectable("Unique", ini.SimplifyWeapon.Unique)
- if(ImGui.IsItemClicked()) then
- ini.SimplifyWeapon.Unique = not ini.SimplifyWeapon.Unique
- end
- ImGui.EndListBox();
- end
- ImGui.Unindent();
- ImGui.Spacing()
- ImGui.Separator()
- end
- ----------------------------------
- tempText = "Common - Weapons"
- tempValue = optionTextforSlider[ini.SimplifyWeapon.SimplifyWeapon_Common]
- ini.SimplifyWeapon.SimplifyWeapon_Common = ImGui.SliderInt(tempText, ini.SimplifyWeapon.SimplifyWeapon_Common, 0, 2, tempValue);
- tempText = "Uncommon - Weapons"
- tempValue = optionTextforSlider[ini.SimplifyWeapon.SimplifyWeapon_Uncommon]
- ini.SimplifyWeapon.SimplifyWeapon_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyWeapon.SimplifyWeapon_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Weapons"
- tempValue = optionTextforSlider[ini.SimplifyWeapon.SimplifyWeapon_Rare]
- ini.SimplifyWeapon.SimplifyWeapon_Rare = ImGui.SliderInt(tempText, ini.SimplifyWeapon.SimplifyWeapon_Rare, 0, 2, tempValue);
- tempText = "Epic - Weapons"
- tempValue = optionTextforSlider[ini.SimplifyWeapon.SimplifyWeapon_Epic]
- ini.SimplifyWeapon.SimplifyWeapon_Epic = ImGui.SliderInt(tempText, ini.SimplifyWeapon.SimplifyWeapon_Epic, 0, 2, tempValue);
- tempText = "Legendary - Weapons"
- tempValue = optionTextforSlider[ini.SimplifyWeapon.SimplifyWeapon_Legendary]
- ini.SimplifyWeapon.SimplifyWeapon_Legendary = ImGui.SliderInt(tempText, ini.SimplifyWeapon.SimplifyWeapon_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Feet Armor:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Feet"
- tempValue = optionTextforSlider[ini.SimplifyFeet.SimplifyFeet_Common]
- ini.SimplifyFeet.SimplifyFeet_Common = ImGui.SliderInt(tempText, ini.SimplifyFeet.SimplifyFeet_Common, 0, 2, tempValue);
- tempText = "Uncommon - Feet"
- tempValue = optionTextforSlider[ini.SimplifyFeet.SimplifyFeet_Uncommon]
- ini.SimplifyFeet.SimplifyFeet_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyFeet.SimplifyFeet_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Feet"
- tempValue = optionTextforSlider[ini.SimplifyFeet.SimplifyFeet_Rare]
- ini.SimplifyFeet.SimplifyFeet_Rare = ImGui.SliderInt(tempText, ini.SimplifyFeet.SimplifyFeet_Rare, 0, 2, tempValue);
- tempText = "Epic - Feet"
- tempValue = optionTextforSlider[ini.SimplifyFeet.SimplifyFeet_Epic]
- ini.SimplifyFeet.SimplifyFeet_Epic = ImGui.SliderInt(tempText, ini.SimplifyFeet.SimplifyFeet_Epic, 0, 2, tempValue);
- tempText = "Legendary - Feet"
- tempValue = optionTextforSlider[ini.SimplifyFeet.SimplifyFeet_Legendary]
- ini.SimplifyFeet.SimplifyFeet_Legendary = ImGui.SliderInt(tempText, ini.SimplifyFeet.SimplifyFeet_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Head Armor:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Head Armor"
- tempValue = optionTextforSlider[ini.SimplifyHeadArmor.SimplifyHeadArmor_Common]
- ini.SimplifyHeadArmor.SimplifyHeadArmor_Common = ImGui.SliderInt(tempText, ini.SimplifyHeadArmor.SimplifyHeadArmor_Common, 0, 2, tempValue);
- tempText = "Uncommon - Head Armor"
- tempValue = optionTextforSlider[ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon]
- ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Head Armor"
- tempValue = optionTextforSlider[ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare]
- ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare = ImGui.SliderInt(tempText, ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare, 0, 2, tempValue);
- tempText = "Epic - Head Armor"
- tempValue = optionTextforSlider[ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic]
- ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic = ImGui.SliderInt(tempText, ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic, 0, 2, tempValue);
- tempText = "Legendary - Head Armor"
- tempValue = optionTextforSlider[ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary]
- ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary = ImGui.SliderInt(tempText, ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Outer Chest Armor:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Outer Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyChestArmor.SimplifyChestArmor_Common]
- ini.SimplifyChestArmor.SimplifyChestArmor_Common = ImGui.SliderInt(tempText, ini.SimplifyChestArmor.SimplifyChestArmor_Common, 0, 2, tempValue);
- tempText = "Uncommon - Outer Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon]
- ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Outer Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyChestArmor.SimplifyChestArmor_Rare]
- ini.SimplifyChestArmor.SimplifyChestArmor_Rare = ImGui.SliderInt(tempText, ini.SimplifyChestArmor.SimplifyChestArmor_Rare, 0, 2, tempValue);
- tempText = "Epic - Outer Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyChestArmor.SimplifyChestArmor_Epic]
- ini.SimplifyChestArmor.SimplifyChestArmor_Epic = ImGui.SliderInt(tempText, ini.SimplifyChestArmor.SimplifyChestArmor_Epic, 0, 2, tempValue);
- tempText = "Legendary - Outer Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyChestArmor.SimplifyChestArmor_Legendary]
- ini.SimplifyChestArmor.SimplifyChestArmor_Legendary = ImGui.SliderInt(tempText, ini.SimplifyChestArmor.SimplifyChestArmor_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Inner Chest Armor:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Inner Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common]
- ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common = ImGui.SliderInt(tempText, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common, 0, 2, tempValue);
- tempText = "Uncommon - Inner Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon]
- ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Inner Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare]
- ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare = ImGui.SliderInt(tempText, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare, 0, 2, tempValue);
- tempText = "Epic - Inner Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic]
- ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic = ImGui.SliderInt(tempText, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic, 0, 2, tempValue);
- tempText = "Legendary - Inner Chest Armor"
- tempValue = optionTextforSlider[ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary]
- ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary = ImGui.SliderInt(tempText, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Face Armor:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Face Armor"
- tempValue = optionTextforSlider[ini.SimplifyFaceArmor.SimplifyFaceArmor_Common]
- ini.SimplifyFaceArmor.SimplifyFaceArmor_Common = ImGui.SliderInt(tempText, ini.SimplifyFaceArmor.SimplifyFaceArmor_Common, 0, 2, tempValue);
- tempText = "Uncommon - Face Armor"
- tempValue = optionTextforSlider[ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon]
- ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Face Armor"
- tempValue = optionTextforSlider[ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare]
- ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare = ImGui.SliderInt(tempText, ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare, 0, 2, tempValue);
- tempText = "Epic - Face Armor"
- tempValue = optionTextforSlider[ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic]
- ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic = ImGui.SliderInt(tempText, ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic, 0, 2, tempValue);
- tempText = "Legendary - Face Armor"
- tempValue = optionTextforSlider[ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary]
- ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary = ImGui.SliderInt(tempText, ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary, 0, 2, tempValue);
- end
- if ImGui.CollapsingHeader("Leg Armor:") then
- ImGui.PushItemWidth(250);
- tempText = "Common - Leg Armor"
- tempValue = optionTextforSlider[ini.SimplifyLegArmor.SimplifyLegArmor_Common]
- ini.SimplifyLegArmor.SimplifyLegArmor_Common = ImGui.SliderInt(tempText, ini.SimplifyLegArmor.SimplifyLegArmor_Common, 0, 2, tempValue);
- tempText = "Uncommon - Leg Armor"
- tempValue = optionTextforSlider[ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon]
- ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon = ImGui.SliderInt(tempText, ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon, 0, 2, tempValue);
- tempText = "Rare - Leg Armor"
- tempValue = optionTextforSlider[ini.SimplifyLegArmor.SimplifyLegArmor_Rare]
- ini.SimplifyLegArmor.SimplifyLegArmor_Rare = ImGui.SliderInt(tempText, ini.SimplifyLegArmor.SimplifyLegArmor_Rare, 0, 2, tempValue);
- tempText = "Epic - Leg Armor"
- tempValue = optionTextforSlider[ini.SimplifyLegArmor.SimplifyLegArmor_Epic]
- ini.SimplifyLegArmor.SimplifyLegArmor_Epic = ImGui.SliderInt(tempText, ini.SimplifyLegArmor.SimplifyLegArmor_Epic, 0, 2, tempValue);
- tempText = "Legendary - Leg Armor"
- tempValue = optionTextforSlider[ini.SimplifyLegArmor.SimplifyLegArmor_Legendary]
- ini.SimplifyLegArmor.SimplifyLegArmor_Legendary = ImGui.SliderInt(tempText, ini.SimplifyLegArmor.SimplifyLegArmor_Legendary, 0, 2, tempValue);
- end
- ImGui.PopItemWidth()
- ImGui.EndTabItem();
- end
- ImGui.EndTabBar();
- end
- end
- ImGui.End()
- end
- ImGui.SetNextWindowPos(80, 170, ImGuiCond.FirstUseEver)
- ImGui.SetNextWindowSize(400, 225, ImGuiCond.FirstUseEver)
- if (ini.Main.UseEquipmentNotification and foundArmorThatsBetter) then
- --set this window's transparency
- ImGui.PushStyleColor(ImGuiCol.WindowBg, 0.1, 0.1, 0.1, 0.5);
- if (ImGui.Begin("Equipment: ")) then
- ImGui.PopStyleColor(1);
- for i,v in ipairs(slots) do
- --we dont want weapons
- if(v ~= "Weapon") then
- if (highestArmorLevel[v] > 0) then
- itemLevelDiff = highestArmorLevel[v] - equippedArmorLevel[v]
- --check to see if higher level than equipped
- if (itemLevelDiff > 0) then
- ImGui.Text(slotsFriendlyName[i]..":"); ImGui.SameLine(); ImGui.PushStyleColor(ImGuiCol.Text, 0, 1, 0, 1);ImGui.Text("+"..itemLevelDiff)
- ImGui.PopStyleColor(1);
- end
- --slotsFriendlyName
- end
- end
- end
- end
- end
- ImGui.End()
- end)
- function MyMod:ProcessMainFunctionOnce()
- if(ini.Main.UseMod == false) then
- do return end
- end
- --player = Game.GetPlayerSystem():GetLocalPlayerMainGameObject()
- --convert food and beverages
- if(nextAvailableTime < os.time() or ini.Main.UseManualMode == true) then
- nextAvailableTime = os.time() + ini.Main.simplifiedInterval
- if(player ~= nil) then
- --Quantites have changed
- if(prevItemQuantity ~= currentItemQuantity ) then
- MyMod:ProcessConsumable()
- end
- --Auto sell junk
- if(ini.Junk.autoCleanJunk == true) then
- if(ts:GetItemQuantityByTag(player, "Junk") > 0) then
- MyMod:sellJunk()
- end
- end
- --IMGUI Menu screen
- --do return end
- MyMod:getItemLevels()
- --Auto sell grenades
- if(ts:GetItemQuantityByTag(player, "Grenade") > 0) then
- MyMod:ProcessMiscItems("Grenade", false, ini.SimplifyGrenades.SimplifyGrenades_Common, ini.SimplifyGrenades.SimplifyGrenades_Uncommon, ini.SimplifyGrenades.SimplifyGrenades_Rare, ini.SimplifyGrenades.SimplifyGrenades_Epic, ini.SimplifyGrenades.SimplifyGrenades_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "SimpleEnhancer") > 0) then
- MyMod:ProcessMiscItems("SimpleEnhancer", false, ini.SimplifyClothesMod.SimplifyClothesMod_Common, ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon, ini.SimplifyClothesMod.SimplifyClothesMod_Rare, ini.SimplifyClothesMod.SimplifyClothesMod_Epic, ini.SimplifyClothesMod.SimplifyClothesMod_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "FabricEnhancer") > 0) then
- MyMod:ProcessMiscItems("FabricEnhancer", false, ini.SimplifyClothesMod.SimplifyClothesMod_Common, ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon, ini.SimplifyClothesMod.SimplifyClothesMod_Rare, ini.SimplifyClothesMod.SimplifyClothesMod_Epic, ini.SimplifyClothesMod.SimplifyClothesMod_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "WeaponMod") > 0) then
- MyMod:ProcessMiscItems("WeaponMod", false, ini.SimplifyWeaponMod.SimplifyWeaponMod_Common, ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon, ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare, ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic, ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary)
- end
- if(ini.SimplifyWeapon.KeepOneOfEachType) then
- for iteration,v in ipairs(weaponTagList) do
- if(ts:GetItemQuantityByTag(player, weaponTagList[iteration]) > 0) then
- processWeaponType = false
- --check to see if it's something a weapon type that the user wants
- if(weaponTagList[iteration] == "Rifle Assault") then
- if ini.SimplifyWeapon.RifleAssault then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Rifle Assault") then
- if ini.SimplifyWeapon.RifleAssault then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Knuckles") then
- if ini.SimplifyWeapon.Knuckles then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Two Hand Hammer") then
- if ini.SimplifyWeapon.TwoHandHammer then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Handgun") then
- if ini.SimplifyWeapon.Handgun then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "HeavyWeapon") then
- if ini.SimplifyWeapon.HeavyWeapon then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Katana") then
- if ini.SimplifyWeapon.Katana then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Knife") then
- if ini.SimplifyWeapon.Knife then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "LMG") then
- if ini.SimplifyWeapon.LMG then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "One Hand Blade") then
- if ini.SimplifyWeapon.OneHandBlade then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "One Hand Club") then
- if ini.SimplifyWeapon.OneHandClub then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Rifle Precision") then
- if ini.SimplifyWeapon.RiflePrecision then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Revolver") then
- if ini.SimplifyWeapon.Revolver then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Shotgun") then
- if ini.SimplifyWeapon.Shotgun then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Shotgun Dual") then
- if ini.SimplifyWeapon.ShotgunDual then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Rifle Sniper") then
- if ini.SimplifyWeapon.RifleSniper then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "SMG") then
- if ini.SimplifyWeapon.SMG then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Two Hand Club") then
- if ini.SimplifyWeapon.TwoHandClub then
- processWeaponType = true
- end
- end
- if(weaponTagList[iteration] == "Unique") then
- if ini.SimplifyWeapon.Unique then
- processWeaponType = true
- end
- end
- if(processWeaponType) then
- --if(ts:GetItemQuantityByTag(player, weaponTagList[iteration]) > 1) then
- MyMod:GetHighestEffectiveDPSWeapon(weaponTagList[iteration], false)
- --end
- else
- MyMod:GetHighestEffectiveDPSWeapon("Weapon", true)
- end
- MyMod:ProcessMiscItems(weaponTagList[iteration], true, ini.SimplifyWeapon.SimplifyWeapon_Common, ini.SimplifyWeapon.SimplifyWeapon_Uncommon, ini.SimplifyWeapon.SimplifyWeapon_Rare, ini.SimplifyWeapon.SimplifyWeapon_Epic, ini.SimplifyWeapon.SimplifyWeapon_Legendary)
- end
- end
- else
- MyMod:GetHighestEffectiveDPSWeapon("Weapon", true)
- if(ts:GetItemQuantityByTag(player, "Weapon") > 0) then
- MyMod:ProcessMiscItems("Weapon", false, ini.SimplifyWeapon.SimplifyWeapon_Common, ini.SimplifyWeapon.SimplifyWeapon_Uncommon, ini.SimplifyWeapon.SimplifyWeapon_Rare, ini.SimplifyWeapon.SimplifyWeapon_Epic, ini.SimplifyWeapon.SimplifyWeapon_Legendary)
- end
- end
- if(ts:GetItemQuantityByTag(player, "FeetClothing") > 0) then
- MyMod:ProcessMiscItems("FeetClothing", false, ini.SimplifyFeet.SimplifyFeet_Common, ini.SimplifyFeet.SimplifyFeet_Uncommon, ini.SimplifyFeet.SimplifyFeet_Rare, ini.SimplifyFeet.SimplifyFeet_Epic, ini.SimplifyFeet.SimplifyFeet_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "HeadArmor") > 0) then
- MyMod:ProcessMiscItems("HeadArmor", false, ini.SimplifyHeadArmor.SimplifyHeadArmor_Common, ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon, ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare, ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic, ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "ChestArmor") > 0) then
- MyMod:ProcessMiscItems("ChestArmor", false, ini.SimplifyChestArmor.SimplifyChestArmor_Common, ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon, ini.SimplifyChestArmor.SimplifyChestArmor_Rare, ini.SimplifyChestArmor.SimplifyChestArmor_Epic, ini.SimplifyChestArmor.SimplifyChestArmor_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "InnerChestArmor") > 0) then
- MyMod:ProcessMiscItems("InnerChestArmor", false, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic, ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "FaceArmor") > 0) then
- MyMod:ProcessMiscItems("FaceArmor", false, ini.SimplifyFaceArmor.SimplifyFaceArmor_Common, ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon, ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare, ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic, ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "LegArmor") > 0) then
- MyMod:ProcessMiscItems("LegArmor", false, ini.SimplifyLegArmor.SimplifyLegArmor_Common, ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon, ini.SimplifyLegArmor.SimplifyLegArmor_Rare, ini.SimplifyLegArmor.SimplifyLegArmor_Epic, ini.SimplifyLegArmor.SimplifyLegArmor_Legendary)
- end
- if(ts:GetItemQuantityByTag(player, "Drug") > 0) then
- MyMod:processByTag("Drug")
- end
- --shards
- if(ini.SimplifyShards.SimplifyShards) then
- MyMod:ProcessShards();
- end
- --check to see if there is any better equipment
- totalSlotsFoundBetter = 0
- for i,v in pairs(slots) do
- if(v ~= "Weapon") then
- totalSlotsFoundBetter = totalSlotsFoundBetter + MyMod:GetHighestArmorByTag(v)
- end
- end
- --this determines if the Equipment Notification window pops up
- if(totalSlotsFoundBetter == 0) then
- foundArmorThatsBetter = false
- else
- foundArmorThatsBetter = true
- end
- end
- end
- --use autoHealthInhaler
- if(ini.autoHealthInhaler.autoHealthInhaler) then
- if (nextInhalerTime < os.time()) then
- nextInhalerTime = os.time() + ini.autoHealthInhaler.autoHealthInhalerCoolDown
- if(playerHealthPercent < ini.autoHealthInhaler.autoHealthInhalerThreshold and playerHealthPercent > 1 ) then
- MyMod:ProccessInhaler()
- end
- end
- end
- end
- function MyMod:suicidePlayer()
- ---DEBUG SUICIDE
- Game.ApplyEffectOnPlayer("WorkspotStatus.Death")
- end
- function MyMod:tryEatConsumable()
- --use consumables
- if(ini.consumable.useHotkey_FoodBeverages) then
- if(pauseDetected == false) then
- --10 second interval between eatings to prevent overeating :D
- if(nextConsumeTime_FoodBeverages < os.time()) then
- nextConsumeTime_FoodBeverages = os.time() + globalDelayinSeconds
- MyMod:EatConsumable()
- end
- end
- end
- end
- function MyMod:tryUseBooster()
- --Use booster
- if(ini.consumable.useHotkey_Booster) then
- if(pauseDetected == false) then
- --10 second interval between eatings to prevent overeating :D
- if(nextConsumeTime_Booster < os.time()) then
- nextConsumeTime_Booster = os.time() + globalDelayinSeconds
- MyMod:UseBooster()
- end
- end
- end
- end
- function MyMod:ProcessConsumable()
- ------------------------------------------------------------------------------------------------------
- --
- --Count how many drinks the player has not counting GoodQualityDrink1
- --GoodQualityDrink10 = Water
- --Count how much food the player has not counting MediumQualityFood16 (those are Tacos, choombas like Tacos)
- --MediumQualityFood16 = Taco
- totalDrinks = 0
- totalTacos = 0
- totalAlcohol = 0
- if(ini.consumable.ProcessAlcohol) then
- for i,v in ipairs(alcoholItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentDrinkCount = ts:GetItemQuantity(player, itemid)
- if currentDrinkCount > 0 then
- if ini.consumable.useAlcoholCraft then
- if v ~= ini.consumable.alcoholToKeep then
- ts:RemoveItem(player, itemid, currentDrinkCount)
- totalAlcohol = totalAlcohol + currentDrinkCount
- end
- else
- --alcohol price = $30
- moneyToAdd = MyMod:GetItemSellPrice(itemid) * currentDrinkCount
- --for debugging
- MyMod:LogAction("Gained Eurodollars: ", moneyToAdd)
- Game.AddToInventory("Items.money",moneyToAdd)
- ts:RemoveItem(player, itemid, currentDrinkCount)
- session_MoneyGained = session_MoneyGained + moneyToAdd
- end
- end
- end
- end
- if(ini.consumable.ProcessDrinks) then
- for i,v in ipairs(drinkItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentDrinkCount = ts:GetItemQuantity(player, itemid)
- if currentDrinkCount > 0 and v ~= ini.consumable.beverageToKeep then
- ts:RemoveItem(player, itemid, currentDrinkCount)
- totalDrinks = totalDrinks + currentDrinkCount
- end
- end
- end
- if(ini.consumable.ProcessFoods) then
- for i,v in ipairs(foodItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentFoodCount = ts:GetItemQuantity(player, itemid)
- if currentFoodCount > 0 then
- if(v ~= ini.consumable.foodToKeep) then
- ts:RemoveItem(player, itemid, currentFoodCount)
- totalTacos = totalTacos + currentFoodCount
- end
- end
- end
- end
- if(totalDrinks > 0) then
- MyMod:LogAction("Water Added: ", totalDrinks)
- Game.AddToInventory(ini.consumable.beverageToKeep, totalDrinks)
- end
- if(totalTacos > 0) then
- MyMod:LogAction("Food Added: ", totalTacos)
- Game.AddToInventory(ini.consumable.foodToKeep, totalTacos)
- end
- if(totalAlcohol > 0) then
- MyMod:LogAction("Alcohol Added: ", totalAlcohol)
- Game.AddToInventory(ini.consumable.alcoholToKeep, totalAlcohol)
- end
- --update previuos total quantity value
- prevItemQuantity = ts:GetTotalItemQuantity(player)
- session_Food = session_Food + totalTacos
- session_Drinks = session_Drinks + totalDrinks
- session_Alcohol = session_Alcohol + totalAlcohol
- end
- function MyMod:EatConsumable()
- for i,v in ipairs(drinkItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentDrinkCount = ts:GetItemQuantity(player, itemid)
- if currentDrinkCount > 0 and v == ini.consumable.beverageToKeep then
- --for debugging
- MyMod:LogAction("Drank: ", v)
- Game['ItemActionsHelper::DrinkItem;GameObjectItemIDBool'](player, itemid, true)
- end
- end
- for i,v in ipairs(foodItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentFoodCount = ts:GetItemQuantity(player, itemid)
- if currentFoodCount > 0 and v == ini.consumable.foodToKeep then
- --for debugging
- MyMod:LogAction("Ate: ", v)
- Game['ItemActionsHelper::EatItem;GameObjectItemIDBool'](player, itemid, true)
- end
- end
- end
- function MyMod:ProccessInhaler()
- for i,v in ipairs(inhalerItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentInhalerCount = ts:GetItemQuantity(player, itemid)
- if currentInhalerCount > 0 then
- --for debugging
- MyMod:LogAction("Used inhaler: ", v)
- Game['ItemActionsHelper::ConsumeItem;GameObjectItemIDBool'](player, itemid, true)
- break
- end
- end
- end
- function MyMod:UseBooster()
- for i,v in ipairs(boosterItems) do
- tid = TweakDBID.new(v)
- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- currentBoosterCount = ts:GetItemQuantity(player, itemid)
- if currentBoosterCount > 0 then
- --for debugging
- MyMod:LogAction("Used booster: ", v)
- Game['ItemActionsHelper::ConsumeItem;GameObjectItemIDBool'](player, itemid, true)
- end
- end
- end
- function MyMod:LogAction(actionDescription, actionValue)
- currentActionPass = currentActionPass + 1
- if(currentActionPass > maxMessages) then
- currentActionPass = 0
- end
- if(actionDescription == nil) then
- actionDescription = " "
- end
- if(actionValue == nil) then
- actionValue = " "
- end
- lastActionDescription[currentActionPass] = actionDescription
- lastActionValue[currentActionPass] = actionValue
- lastActionTime[currentActionPass] = os.time()
- end
- function MyMod:GetItemSellPrice(itemid)
- imgr = espd:GetInventoryManager()
- return imgr:GetSellPrice(player, itemid)
- end
- function MyMod:sellJunk()
- imgr = espd:GetInventoryManager()
- local ok, itemList = ts:GetItemListByTag(player, "Junk")
- itemCount = 0
- moneyToAdd = 0
- amountDisassembled = 0
- earlyExit = false
- diffTime = 0
- enteredTime = os.clock()
- local vItemID
- local v
- for _,v in ipairs(itemList) do
- diffTime = os.clock() - enteredTime
- if(diffTime > 0.03) then
- MyMod:LogAction("Exited Processing of : Junk | Amount of Items Processed: " .. _)
- earlyExit = true
- break
- end
- vItemID = v:GetID()
- itemCount = itemCount + 1
- sellPrice = imgr:GetSellPrice(player, vItemID)
- itemQuantity = ts:GetItemQuantity(player, vItemID)
- canBeDisassembled = Game["gameRPGManager::CanItemBeDisassembled;GameInstanceItemID"](vItemID)
- --sell junk
- if((sellPrice > 3 and ini.Junk.sellExpensiveJunk) or ini.Junk.sellAllJunk) then
- --make sure to only sell if user is not disassembling ALL junk
- if(ini.Junk.disassembleAllJunk == false) then
- moneyToAdd = moneyToAdd + (sellPrice * itemQuantity)
- ts:RemoveItem(player, vItemID, itemQuantity)
- end
- end
- --disassemble junk
- if((canBeDisassembled and ini.Junk.disassembleCheapJunk and sellPrice <= 3 and sellPrice > 0) or (canBeDisassembled and ini.Junk.disassembleAllJunk and sellPrice > 0)) then
- --Some quest items are marked as Junk but their sellPrice = 0
- --if sellPrice = 0 we're just going to asssume that it shouldnt be sold
- --make sure to only disassmble if user is not selling ALL junk
- if(ini.Junk.sellAllJunk == false) then
- Game['ItemActionsHelper::DisassembleItem;GameObjectItemIDInt32'](player, vItemID, itemQuantity)
- amountDisassembled = amountDisassembled + itemQuantity
- end
- end
- end
- --print("itemCount: " , itemCount)
- if(moneyToAdd > 0) then
- MyMod:LogAction("Junk items sold: ", itemCount)
- MyMod:LogAction("Money Gained: ", moneyToAdd)
- Game.AddToInventory("Items.money",moneyToAdd)
- session_ItemsSold = session_ItemsSold + itemCount
- session_MoneyGained = session_MoneyGained + moneyToAdd
- end
- if(amountDisassembled > 0) then
- MyMod:LogAction("Disassembled Junk Items: ", amountDisassembled)
- session_ItemsDisassembled = session_ItemsDisassembled + amountDisassembled
- end
- end
- function MyMod:GetLocalizedName(itemID)
- -- Get the TweakDBID of the item
- local itemTweakDBID = itemID.id;
- -- Get the TweakDBID of the "displayName" property of the TweakDB record
- local displayNameTweakDBID = TweakDBID.new(itemTweakDBID, '.displayName');
- -- Get the localization key (LocKey) of the "displayName" property
- local displayNameLocKey = Game['TDB::GetLocKey;TweakDBID'](displayNameTweakDBID);
- -- Get localized text by LocKey
- if(Game.GetLocalizedTextByKey(displayNameLocKey) == nil) then
- return "nothing";
- else
- return Game.GetLocalizedTextByKey(displayNameLocKey);
- end
- end
- function MyMod:GetLocalizedQuality(itemID)
- -- Get the TweakDBID of the item
- local itemTweakDBID = itemID.id;
- -- Get the TweakDBID of the "displayName" property of the TweakDB record
- local displayNameTweakDBID = TweakDBID.new(itemTweakDBID, '.quality');
- print (displayNameTweakDBID)
- print (displayNameTweakDBID.quality)
- -- Get the localization key (LocKey) of the "displayName" property
- local displayNameLocKey = Game['TDB::GetLocKey;TweakDBID'](displayNameTweakDBID);
- -- Get localized text by LocKey
- if(Game.GetLocalizedTextByKey(displayNameLocKey) == nil) then
- return "nothing";
- else
- return Game.GetLocalizedTextByKey(displayNameLocKey);
- end
- end
- function MyMod:ProcessShards()
- local ok, itemList = ts:GetItemListByTag(player, "SoftwareShard")
- local vItemID
- local v
- local sellPrice
- local itemQuantity
- local canBeDisassembled
- local itemCount = 0
- local moneyToAdd = 0
- local amountDisassembled = 0
- local itemIdentifier
- local moneyToAdd = 0
- local itemRecord
- local itemIconPath
- local currentQuality
- local statObj
- local shardAmount = {}
- local shardInfo = {}
- local shardvItemID = {}
- local shardQuality = {}
- local combinedShardText
- local totalShardCount = 0
- local i
- local isShardEquipped
- local canDeleteShard = {}
- local isShardTypeEquipped = {}
- local forceShardSell = {}
- local has_Tier1Shard
- local has_Tier2Shard
- local has_Tier3Shard
- local has_Tier4Shard
- local bestShardTierSoFar = {}
- local shardIdentifier = {}
- local shardRawQuality = {}
- local shardAmountLeft = {}
- local shardIdentifierCombined = {}
- ---------------------
- local cyberdeckId;
- local equippedHackItemID = {};
- local equippedHackLocalizedName = {};
- local equippedHackQuality = {};
- ts = Game.GetTransactionSystem();
- ssc = Game.GetScriptableSystemsContainer();
- ss = Game.GetStatsSystem();
- equipmentSystem = ssc:Get("EquipmentSystem");
- player = Game.GetPlayerSystem():GetLocalPlayerMainGameObject();
- espd = equipmentSystem:GetPlayerData(player);
- imgr = espd:GetInventoryManager();
- cyberdeckId = imgr:GetEquippedItemIdInArea(35, 0); -- gamedataEquipmentArea.SystemReplacementCW
- deckData2 = ts:GetItemData(player, cyberdeckId);
- --partData2 = deckData2:GetItemParts(partData2);
- ------------ FIX from Nexus comments section ------------------------
- -- SOURCE: https://forums.nexusmods.com/index.php?/topic/9466953-decluttered-beverages-and-food/page-28#entry97888278
- partData2 = deckData2:GetItemParts();
- ---------------------------------------------------------------------
- if(partData2[2] ~= nil) then
- equippedHackItemID[0] = partData2[2]:GetItemID(partData2[2]); -- these are the quickhacks
- equippedHackLocalizedName[0] = MyMod:GetLocalizedName(equippedHackItemID[0]);
- equippedHackQuality[0] = partData2[2]:GetStatValueByType(partData2[2], 664); --gamedataStatType.Quality = 664
- else
- equippedHackItemID[0] = 0;
- equippedHackLocalizedName[0] = "";
- equippedHackQuality[0] = -1;
- end
- if(partData2[3] ~= nil) then
- equippedHackItemID[1] = partData2[3]:GetItemID(partData2[3]); -- these are the quickhacks
- equippedHackLocalizedName[1] = MyMod:GetLocalizedName(equippedHackItemID[1]);
- equippedHackQuality[1] = partData2[3]:GetStatValueByType(partData2[3], 664); --gamedataStatType.Quality = 664
- else
- equippedHackItemID[1] = 0;
- equippedHackLocalizedName[1] = "";
- equippedHackQuality[1] = -1;
- end
- if(partData2[4] ~= nil) then
- equippedHackItemID[2] = partData2[4]:GetItemID(partData2[4]); -- these are the quickhacks
- equippedHackLocalizedName[2] = MyMod:GetLocalizedName(equippedHackItemID[2]);
- equippedHackQuality[2] = partData2[4]:GetStatValueByType(partData2[4], 664); --gamedataStatType.Quality = 664
- else
- equippedHackItemID[2] = 0;
- equippedHackLocalizedName[2] = "";
- equippedHackQuality[2] = -1;
- end
- ----------------------------------------
- for _,v in ipairs(itemList) do
- vItemID = v:GetID()
- if(ts:HasTag(player, "Tier1Shard", vItemID)) then
- has_Tier1Shard = 1
- else
- has_Tier1Shard = 0
- end
- if(ts:HasTag(player, "Tier2Shard", vItemID)) then
- has_Tier2Shard = 1
- else
- has_Tier2Shard = 0
- end
- if(ts:HasTag(player, "Tier3Shard", vItemID)) then
- has_Tier3Shard = 1
- else
- has_Tier3Shard = 0
- end
- if(ts:HasTag(player, "Tier4Shard", vItemID)) then
- has_Tier4Shard = 1
- else
- has_Tier4Shard = 0
- end
- if(has_Tier1Shard or has_Tier2Shard or has_Tier3Shard or has_Tier4Shard) then
- itemRecord = Game['gameRPGManager::GetItemRecord;ItemID'](vItemID)
- itemIdentifier = itemRecord:IconPath() --grenade_recon_normal
- statObj = v:GetStatsObjectID()
- currentQuality = ss:GetStatValue(statObj, 'Quality')
- combinedShardText = currentQuality .. ":" .. itemIdentifier
- if(shardAmount[itemIdentifier] == nil) then
- shardAmount[itemIdentifier] = 0
- bestShardTierSoFar[itemIdentifier] = 0
- end
- if(isShardTypeEquipped[itemIdentifier] == nil) then
- isShardTypeEquipped[itemIdentifier] = 0
- end
- if(forceShardSell[itemIdentifier] == nil) then
- forceShardSell[itemIdentifier] = 0
- end
- totalShardCount = totalShardCount + 1
- isShardEquipped = false
- tempLocalizedName = MyMod:GetLocalizedName(vItemID)
- equippedQuality = -1;
- if(tempLocalizedName == equippedHackLocalizedName[0]) then
- equippedQuality = equippedHackQuality[0];
- end
- if(tempLocalizedName == equippedHackLocalizedName[1]) then
- equippedQuality = equippedHackQuality[1];
- end
- if(tempLocalizedName == equippedHackLocalizedName[2]) then
- equippedQuality = equippedHackQuality[2];
- end
- if(isShardEquipped) then
- canDeleteShard[totalShardCount] = 0
- isShardTypeEquipped[itemIdentifier] = 1
- --print("this is equipped: " .. itemIdentifier)
- else
- --print("this is NOT equipped: " .. itemIdentifier)
- canDeleteShard[totalShardCount] = 1
- end
- if(currentQuality == 0.0) then
- shardQuality[totalShardCount] = "Common"
- end
- if(currentQuality == 1.0) then
- shardQuality[totalShardCount] = "Uncommon"
- end
- if(currentQuality == 2.0) then
- shardQuality[totalShardCount] = "Rare"
- end
- if(currentQuality == 3.0) then
- shardQuality[totalShardCount] = "Epic"
- end
- if(currentQuality == 4.0) then
- shardQuality[totalShardCount] = "Legendary"
- end
- if (bestShardTierSoFar[itemIdentifier] == nil) then
- bestShardTierSoFar[itemIdentifier] = currentQuality
- end
- if(bestShardTierSoFar[itemIdentifier] < currentQuality) then
- bestShardTierSoFar[itemIdentifier] = currentQuality
- end
- if(shardAmountLeft[combinedShardText] == nil) then
- shardAmountLeft[combinedShardText] = 0;
- end
- --equipped shards
- if(equippedQuality > -1) then
- if(equippedQuality > currentQuality) then
- forceShardSell[itemIdentifier] = 1
- shardAmount[itemIdentifier] = shardAmount[itemIdentifier] + 1
- end
- shardAmountLeft[combinedShardText] = shardAmountLeft[combinedShardText] + 1
- end
- shardRawQuality[totalShardCount] = currentQuality
- shardAmount[itemIdentifier] = shardAmount[itemIdentifier] + 1
- shardAmountLeft[combinedShardText] = shardAmountLeft[combinedShardText] + 1
- shardInfo[totalShardCount] = itemIdentifier
- shardIdentifier[totalShardCount] = itemIdentifier
- shardIdentifierCombined[totalShardCount] = combinedShardText
- shardvItemID[totalShardCount] = vItemID
- end
- end
- if(totalShardCount < 1) then
- return;
- end
- --Remove duplicate shards
- for i = 1, totalShardCount do
- --print("")
- --print("Start of loop")
- --print("i=" .. i)
- --print("shardInfo = " .. shardInfo[i])
- --print("shardAmount = "..shardAmount[shardInfo[i]])
- --print("shardIdentifierCombined = " .. shardIdentifierCombined[i])
- --print("shardAmountLeft = " .. shardAmountLeft[shardIdentifierCombined[i]])
- --print("shardRawQuality = " .. shardRawQuality[i])
- --print("End of loop")
- vItemID = shardvItemID[i]
- --delete lesser shard tiers (only keep highest tier)
- markForDeletion = false
- if(shardRawQuality[i] < bestShardTierSoFar[shardIdentifier[i]]) then
- --print("shardRawQuality[i]=" .. shardRawQuality[i] .. " < " .. "bestShardTierSoFar[shardIdentifier[i]=" .. bestShardTierSoFar[shardIdentifier[i]])
- --dont mark for deletion if it's equipped
- if(isShardTypeEquipped[shardInfo[i]] == 0) then
- --print("Marking for deletion: " .. shardRawQuality[i].. " " .. shardInfo[i])
- markForDeletion = true
- end
- else
- --delete duplicates of same quality as long as there is more than 1
- if(shardRawQuality[i] == bestShardTierSoFar[shardIdentifier[i]] and shardAmountLeft[shardIdentifierCombined[i]] > 1) then
- markForDeletion = true
- --print("Deleting duplicate of: " .. shardRawQuality[i].. " " .. shardInfo[i] .. "Qty Remaining: " .. shardAmountLeft[shardIdentifierCombined[i]]);
- else
- canDeleteShard[i] = 0
- end
- end
- if((shardAmount[shardInfo[i]] > 1 and canDeleteShard[i] == 1) or markForDeletion == true) then
- sellPrice = imgr:GetSellPrice(player, vItemID)
- -- Get the TweakDBID of the item
- local vItemIDTweakDBID = vItemID.id
- local displayNameTweakDBID = TweakDBID.new(vItemIDTweakDBID, '.displayName')
- local displayNameLocKey = Game['TDB::GetLocKey;TweakDBID'](displayNameTweakDBID)
- itemIdentifier = Game.GetLocalizedTextByKey(displayNameLocKey)
- if(ts:HasTag(player, "Tier1Shard", vItemID) or ts:HasTag(player, "Tier2Shard", vItemID) or ts:HasTag(player, "Tier3Shard", vItemID) or ts:HasTag(player, "Tier4Shard", vItemID)) then
- --Sell
- if(ini.SimplifyShards.SimplifyShards) then
- MyMod:LogAction("Sold: " .. tostring(shardQuality[i]) .. " " .. tostring(itemIdentifier) .. " Qty: " .. 1 .. " @ " .. sellPrice .. "ea.")
- moneyToAdd = moneyToAdd + (sellPrice)
- ts:RemoveItem(player, vItemID, 1)
- session_ItemsSold = session_ItemsSold + 1
- shardAmountLeft[shardIdentifierCombined[i]] = shardAmountLeft[shardIdentifierCombined[i]] - 1
- end
- end
- end
- end
- if(moneyToAdd > 0) then
- MyMod:LogAction("Total Money Gained: ", moneyToAdd)
- Game.AddToInventory("Items.money",moneyToAdd)
- session_MoneyGained = session_MoneyGained + moneyToAdd
- end
- end
- function MyMod:ProcessMiscItems(currentTag, isWeapon, item_Common, item_Uncommon, item_Rare, item_Epic, item_Legendary)
- espd = equipmentSystem:GetPlayerData(player)
- if(espd == nil) then
- return;
- end
- imgr = espd:GetInventoryManager()
- if(imgr == nil) then
- return;
- end
- local ok, itemList = ts:GetItemListByTag(player, currentTag)
- --no need to be here, user has it disabled
- if(item_Common == 0 and item_Uncommon == 0 and item_Rare == 0 and item_Epic == 0 and item_Legendary == 0) then
- do return end
- end
- local isItemEqupped_OG
- local sellPrice
- local itemQuantity
- local canBeDisassembled
- local itemRecord
- local v
- local vItemID
- local statObj
- local currentQuality
- local isQuestItem
- local shouldWeSellItem
- local equippedIsBetter
- local forbidSell
- local bestWeaponDPS_SoFar
- local itemCount = 0
- local moneyToAdd = 0
- local amountDisassembled = 0
- local ignoreisItemInHotkey = true
- local isArmor = false
- local tempHighest
- local diffTime
- if(isWeapon == true or currentTag == "FeetClothing" or currentTag == "HeadArmor" or currentTag == "ChestArmor" or currentTag == "InnerChestArmor" or currentTag == "FaceArmor" or currentTag == "LegArmor") then
- MyMod:getItemEquippedWithTag(currentTag, itemList)
- end
- if(currentTag == "Grenade" or currentTag == "Drug") then
- ignoreisItemInHotkey = false
- end
- enteredTime = os.clock()
- diffTime = 0
- earlyExit = false
- for _,v in ipairs(itemList) do
- diffTime = os.clock() - enteredTime
- if(diffTime > 0.05) then
- MyMod:LogAction("Exited Processing of : " .. tostring(currentTag) .. " Amount of Items Processed: " .. _)
- earlyExit = true
- break
- end
- vItemID = v:GetID()
- isItemEqupped_OG = false
- isItemEqupped_OG = espd:IsEquipped(vItemID)
- sellPrice = imgr:GetSellPrice(player, vItemID)
- itemQuantity = ts:GetItemQuantity(player, vItemID)
- canBeDisassembled = Game["gameRPGManager::CanItemBeDisassembled;GameInstanceItemID"](vItemID)
- --Don't break down starter gear
- itemRecord = Game['gameRPGManager::GetItemRecord;ItemID'](vItemID)
- itemAppearanceName = itemRecord:AppearanceName().value
- itemIconPath = itemRecord:IconPath() --grenade_recon_normal
- itemIdentifier = v:GetNameAsString()
- if(itemIdentifier == nil or itemIdentifier == "None") then
- itemIdentifier = itemIconPath
- end
- --print("itemAppearanceName: ", itemAppearanceName)
- --print("v:GetNameAsString(): ", v:GetNameAsString()) --recon
- --print("itemIconPath: ", itemIconPath) --recon
- --print("itemRecord: ", itemRecord)
- --print("1: ", itemRecord:EquipArea())
- --print("2: ", itemRecord:EquipArea():Type())
- --print("3: ", itemRecord:EquipArea():Type().value)
- if(itemRecord:EquipArea() ~= nil) then
- equippedArea = itemRecord:EquipArea():Type().value
- end
- if string.find(itemAppearanceName, "_q000_") then
- isStarterItem = true
- else
- isStarterItem = false
- end
- --ignore Quest items, equipped items, starter gear items
- --do return end
- isHotkey = false
- if(ignoreisItemInHotkey == false) then
- isHotkey = equipmentSystem:IsItemInHotkey(player, vItemID)
- --dont process hotkeyed items
- if(isHotkey) then
- isItemEqupped_OG = true
- end
- end
- isQuestItem = ts:HasTag(player, "Quest", vItemID)
- statObj = v:GetStatsObjectID()
- currentQuality = ss:GetStatValue(statObj, 'Quality')
- --print("currentQuality: ", currentQuality) --recon
- currentItemLevel_PMI = ss:GetStatValue(statObj, 'ItemLevel')
- itemdata = ts:GetItemData(player, vItemID)
- IsItemIconic = itemdata:GetStatValueByType('IsItemIconic')
- -----------------------------------------------
- shouldWeSellItem = true --we'll always default to selling an item
- equippedIsBetter = false
- forbidSell = false
- bestWeaponDPS_SoFar = 0
- --comparison check is only for weapons and armor
- doComparisonCheck = false
- --we'll compare the slotted equipped item level versus the current Item level
- if(isWeapon == true) then
- statObj = v:GetStatsObjectID()
- currentItemLevel_PMI = ss:GetStatValue(statObj, 'EffectiveDPS')
- currentQuality = ss:GetStatValue(statObj, 'Quality')
- --bestWeaponDPS_SoFar = tonumber(string.format("%.2f", highestEffectiveDPSWeapon))
- currentItemLevel_PMI = tonumber(string.format("%.2f", currentItemLevel_PMI))
- doComparisonCheck = true
- shouldWeSellItem = false --dont sell just yet, requires further checks
- --checking to see if it's something that can actually be sold
- if(isItemInEquippedArea(equippedArea, 1) == false) then
- forbidSell = true
- end
- end
- if(currentTag == "FeetClothing" or currentTag == "HeadArmor" or currentTag == "ChestArmor" or currentTag == "InnerChestArmor" or currentTag == "FaceArmor" or currentTag == "LegArmor") then
- isArmor = true
- --retrieve highestArmorLevel
- MyMod:GetHighestArmorByTag(currentTag)
- statObj = v:GetStatsObjectID()
- currentQuality = ss:GetStatValue(statObj, 'Quality')
- currentItemLevel_PMI = ss:GetStatValue(statObj, 'Armor')
- currentItemLevel_PMI = tonumber(string.format("%.3f", currentItemLevel_PMI))
- doComparisonCheck = true
- --checking to see if it's something that can actually be sold
- if(isItemInEquippedArea(equippedArea, 1) == false) then
- forbidSell = true
- end
- shouldWeSellItem = false --dont sell just yet, requires further checks
- end
- --we'll compare the slotted equipped item level versus the current Item level
- if(isArmor and currentTag == "ChestArmor") then
- -- tempHighest = highestArmorLevel[currentTag]
- -- print("currentTag: ", currentTag)
- -- print("_:",_)
- -- print("itemAppearanceName: ", itemAppearanceName)
- -- print("tempHighest:", tempHighest)
- -- print("currentItemLevel:", currentItemLevel_PMI)
- -- print("isItemEqupped_OG :", isItemEqupped_OG)
- -- print("canBeDisassembled :",canBeDisassembled )
- -- print("isQuestItem :", isQuestItem)
- -- print("isStarterItem :", isStarterItem)
- -- print("equippedIsBetter :", equippedIsBetter)
- -- print("shouldWeSellItem :", shouldWeSellItem)
- -- print("equippedILevel :", equippedILevel)
- -- print("forbidSell :", forbidSell)
- -- print("currentQuality: ", currentQuality)
- --
- -- print("Original equipped function: ", isItemEqupped)
- -- print("isItemEqupped_OG: ", isItemEqupped_OG)
- --
- -- if(isItemEqupped_OG == false and canBeDisassembled and isQuestItem == false and isStarterItem == false and equippedIsBetter == false and shouldWeSellItem and forbidSell == false) then
- -- print("umm this crap should definetely be sold!!!")
- -- end
- --
- -- print(" ")
- end
- if(equippedILevel ~= currentItemLevel_PMI and isItemEqupped_OG == false and doComparisonCheck == true) then
- if(ini.Main.processItemsOfLesserItemLevel_Only) then
- tempHighest = highestEffectiveDPSWeapon
- if(isArmor) then
- tempHighest = highestArmorLevel[currentTag]
- end
- if(tempHighest > currentItemLevel_PMI) then
- --only sell worse items than what's equipped
- --print("We should sell this item")
- equippedIsBetter = false
- shouldWeSellItem = true
- else
- equippedIsBetter = true
- shouldWeSellItem = false
- end
- else
- --we can sell any item regardless if it's better or worse
- --print("We should sell this item")
- equippedIsBetter = false
- shouldWeSellItem = true
- end
- end
- --Iconic check
- if(IsItemIconic > 0 and ini.Main.ignoreIconicItems == true) then
- forbidSell = true
- end
- --Grenade type check
- if(currentTag == "Grenade") then
- itemFriendlyName = itemRecord:FriendlyName()
- shouldWeSellItem = false
- if(itemFriendlyName == "biohazard") then
- if(ini.SimplifyGrenades.Biohazard) then
- shouldWeSellItem = true
- end
- end
- if(itemFriendlyName == "cutting") then
- if(ini.SimplifyGrenades.Cutting) then
- shouldWeSellItem = true
- end
- end
- if(itemFriendlyName == "emp") then
- if(ini.SimplifyGrenades.Emp) then
- shouldWeSellItem = true
- end
- end
- if(itemFriendlyName == "flash") then
- if(ini.SimplifyGrenades.Flash) then
- shouldWeSellItem = true
- end
- end
- if(itemFriendlyName == "frag") then
- if(ini.SimplifyGrenades.Frag) then
- shouldWeSellItem = true
- end
- end
- if(itemFriendlyName == "incendiary_grenade") then
- if(ini.SimplifyGrenades.Incendiary) then
- shouldWeSellItem = true
- end
- end
- if(itemFriendlyName == "recon") then
- if(ini.SimplifyGrenades.Recon) then
- shouldWeSellItem = true
- end
- end
- end
- --Sell or Dismantle Item
- if(isItemEqupped_OG == false and canBeDisassembled and isQuestItem == false and isStarterItem == false and equippedIsBetter == false and shouldWeSellItem and forbidSell == false) then
- --print("something should sell!")
- --print("item_Common: ", item_Common)
- --print("currentQuality: ", currentQuality)
- itemCount = itemCount + 1
- --SELL ITEMS------------------------------------------------------------
- sellitemsThisPass = 0
- if(item_Common == 1 and currentQuality == 0.0) then
- sellitemsThisPass = 1
- end
- if(item_Uncommon == 1 and currentQuality == 1.0) then
- sellitemsThisPass = 1
- end
- if(item_Rare == 1 and currentQuality == 2.0) then
- sellitemsThisPass = 1
- end
- if(item_Epic == 1 and currentQuality == 3.0) then
- sellitemsThisPass = 1
- end
- if(item_Legendary == 1 and currentQuality == 4.0) then
- sellitemsThisPass = 1
- end
- if(sellitemsThisPass == 1) then
- MyMod:LogAction("Sold: " .. tostring(currentTag) .. " (" .. itemIdentifier .. ")" .. " Qty: " .. itemQuantity .. " @ " .. sellPrice .. "ea.")
- moneyToAdd = moneyToAdd + (sellPrice * itemQuantity)
- vItemID = v:GetID()
- ts:RemoveItem(player, vItemID, itemQuantity)
- session_ItemsSold = session_ItemsSold + itemQuantity
- end
- --DISMANTLE ITEMS------------------------------------------------------------
- dismantleItemsThisPass = 0
- if(item_Common == 2 and currentQuality == 0.0) then
- dismantleItemsThisPass = 1
- end
- if(item_Uncommon == 2 and currentQuality == 1.0) then
- dismantleItemsThisPass = 1
- end
- if(item_Rare == 2 and currentQuality == 2.0) then
- dismantleItemsThisPass = 1
- end
- if(item_Epic == 2 and currentQuality == 3.0) then
- dismantleItemsThisPass = 1
- end
- if(item_Legendary == 2 and currentQuality == 4.0) then
- dismantleItemsThisPass = 1
- end
- if(dismantleItemsThisPass == 1) then
- MyMod:LogAction("Disassembled: " .. tostring(currentTag) .. " (" .. itemIdentifier .. ")" .. " Qty: " .. itemQuantity)
- vItemID = v:GetID()
- Game['ItemActionsHelper::DisassembleItem;GameObjectItemIDInt32'](player, vItemID, itemQuantity)
- amountDisassembled = amountDisassembled + itemQuantity
- end
- end
- end
- if(moneyToAdd > 0) then
- MyMod:LogAction("Total Money Gained: ", moneyToAdd)
- Game.AddToInventory("Items.money",moneyToAdd)
- session_MoneyGained = session_MoneyGained + moneyToAdd
- end
- if(amountDisassembled > 0) then
- MyMod:LogAction("Total " .. currentTag .. " Dissassembled: " .. tostring(amountDisassembled))
- session_ItemsDisassembled = session_ItemsDisassembled + amountDisassembled
- end
- if(earlyExit == true) then
- MyMod:LogAction("You still have more items to be processed! Try again!! ", currentTag)
- end
- end
- function MyMod:processByTag(currentTag)
- local ok, itemList = ts:GetItemListByTag(player, currentTag)
- itemCount = 0
- moneyToAdd = 0
- amountDisassembled = 0
- for _,v in ipairs(itemList) do
- vItemID = v:GetID()
- sellPrice = imgr:GetSellPrice(player, vItemID)
- itemQuantity = ts:GetItemQuantity(player, vItemID)
- canBeDisassembled = Game["gameRPGManager::CanItemBeDisassembled;GameInstanceItemID"](vItemID)
- itemRecord = Game['gameRPGManager::GetItemRecord;ItemID'](vItemID)
- displayName = itemRecord:DisplayName()
- itemdata = ts:GetItemData(player, vItemID)
- displayName = itemRecord:DisplayName()
- locDisplayName = Game['LocKeyToString'](displayName)
- isHotkey = equipmentSystem:IsItemInHotkey(player, vItemID)
- processAction = 0
- localizedName = ""
- --;0=Nothing, 1=AutoSell, 2=AutoDismantle
- --FirstAidWhiffV0
- if(locDisplayName == "LocKey#35384") then
- processAction = ini.SimplifyHealthItems.MaxDoc_MK1
- localizedName = "MaxDoc MK1"
- end
- --FirstAidWhiffV1
- if(locDisplayName == "LocKey#2679") then
- processAction = ini.SimplifyHealthItems.MaxDoc_MK2
- localizedName = "MaxDoc MK2"
- end
- --FirstAidWhiffV2
- if(locDisplayName == "LocKey#35387") then
- processAction = ini.SimplifyHealthItems.MaxDoc_MK3
- localizedName = "MaxDoc MK3"
- end
- --BonesMcCoy70V0
- if(locDisplayName == "LocKey#35418") then
- processAction = ini.SimplifyHealthItems.Bounce_Back_MK1
- localizedName = "Bounce Back MK1"
- end
- --BonesMcCoy70V1
- if(locDisplayName == "LocKey#34157") then
- processAction = ini.SimplifyHealthItems.Bounce_Back_MK2
- localizedName = "Bounce Back MK2"
- end
- --BonesMcCoy70V2
- if(locDisplayName == "LocKey35420") then
- processAction = ini.SimplifyHealthItems.Bounce_Back_MK3
- localizedName = "Bounce Back MK3"
- end
- --sell item
- if(processAction == 1 and isHotkey == false) then
- MyMod:LogAction("Sold: " .. tostring(localizedName) .. " Qty: " .. itemQuantity .. " @ " .. sellPrice .. "ea.")
- moneyToAdd = moneyToAdd + (sellPrice * itemQuantity)
- ts:RemoveItem(player, vItemID, itemQuantity)
- itemCount = itemCount + itemQuantity
- end
- --disassemble item
- if(processAction == 2 and isHotkey == false) then
- MyMod:LogAction("Disassembled " .. tostring(localizedName) .. " Qty: " .. amountDisassembled)
- Game['ItemActionsHelper::DisassembleItem;GameObjectItemIDInt32'](player, vItemID, itemQuantity)
- amountDisassembled = amountDisassembled + itemQuantity
- end
- end
- if(moneyToAdd > 0) then
- MyMod:LogAction("Total " .. tostring(currentTag) .."s sold: ", itemCount)
- MyMod:LogAction("Money Gained: ", moneyToAdd)
- Game.AddToInventory("Items.money",moneyToAdd)
- session_ItemsSold = session_ItemsSold + itemCount
- session_MoneyGained = session_MoneyGained + moneyToAdd
- end
- if(amountDisassembled > 0) then
- MyMod:LogAction("Total Disassembled " .. tostring(currentTag) .."s: ", amountDisassembled)
- session_ItemsDisassembled = session_ItemsDisassembled + amountDisassembled
- end
- end
- function MyMod:IsMainMenu() --Use "q000_started" to check if in mainmenu
- if (Game.GetQuestsSystem():GetFactStr("q000_started") == 0) then
- -- print("q000_started")
- hasSystemsBeenRetrieved = false
- startupDelayTime = os.time() + globalDelayinSeconds
- MyMod:ClearDebugMenu()
- return true
- end
- return false
- end
- function MyMod:getItemEquippedWithTag(currentTag, itemList)
- equippedItemID = 0
- equippedILevel = 0
- --print(currentTag)
- --print(itemList)
- for _,v in ipairs(itemList) do
- vItemID = v:GetID()
- --this is what we're looking for
- isItemEqupped = espd:IsEquipped(vItemID)
- statObj = v:GetStatsObjectID()
- --we'll compare the slotted equipped item level versus the current Item level
- if(currentTag == "Weapon") then
- currentItemLevel = highestEffectiveDPSWeapon --ss:GetStatValue(statObj, 'EffectiveDPS')
- else
- currentItemLevel = ss:GetStatValue(statObj, 'Armor')
- end
- if(isItemEqupped) then
- --print("found equipped item")
- equippedItemID = v
- equippedILevel = currentItemLevel
- equippedILevel = tonumber(string.format("%.3f", equippedILevel))
- end
- end
- --print("Retrieved: ", equippedItemID)
- --print("Retrieved: ", equippedILevel)
- --print("EXIT MyMod:getItemEquippedWithTag")
- end
- function MyMod:ClearDebugMenu()
- --clear the debug menu
- lastActionDescription = {}
- lastActionValue = {}
- lastActionTime = {}
- currentActionPass = 0
- equippedILevel = -1
- for ii = 0, maxMessages do
- lastActionDescription[ii] = ""
- lastActionValue[ii] = ""
- lastActionTime[ii] = ""
- end
- end
- function MyMod:GetSystems()
- statsPoolSystem = Game.GetStatPoolsSystem()
- ts = Game.GetTransactionSystem()
- ssc = Game.GetScriptableSystemsContainer()
- ss = Game.GetStatsSystem()
- equipmentSystem = ssc:Get("EquipmentSystem")
- player = Game.GetPlayerSystem():GetLocalPlayerMainGameObject()
- espd = equipmentSystem:GetPlayerData(player)
- if(espd == nil) then
- return;
- end
- imgr = espd:GetInventoryManager()
- end
- function MyMod:getItemLevels()
- --this is just for debug purposes
- ssc = Game.GetScriptableSystemsContainer()
- equipmentSystem = ssc:Get("EquipmentSystem")
- ps = Game.GetPlayerSystem()
- player = ps:GetLocalPlayerMainGameObject()
- espd = equipmentSystem:GetPlayerData(player)
- ss = Game.GetStatsSystem()
- ts = Game.GetTransactionSystem()
- imgr = espd:GetInventoryManager()
- currentSlot = 0
- --local ok, itemList = ts:GetItemListByTags(player, slots, itemList)
- ------------ FIX from Nexus comments section ------------------------
- ----https://forums.nexusmods.com/index.php?/topic/9466953-decluttered-beverages-and-food/page-28#entry95947388
- local ok, itemList = ts:GetItemListByTags(player, slots)
- ---------------------------------------------------------------------
- for i=0,20 do
- equippedArrayItemID[i] = ""
- equippedArrayILevel[i] = -1
- equippedArraySlot[i] = ""
- equippedArrayType[i] = ""
- end
- for i,v in ipairs(itemList) do
- vItemID = v:GetID()
- isItemEqupped = espd:IsEquipped(vItemID)
- if(isItemEqupped == true) then
- itemRecord = Game['gameRPGManager::GetItemRecord;ItemID'](vItemID)
- equippedArea = itemRecord:EquipArea():Type().value
- equippedArraySlot[currentSlot] = equippedArea
- equippedArrayItemID[currentSlot] = v:GetID()
- --print("equippedArea: ", equippedArea)
- --print("v:GetNameAsString(): ", v:GetNameAsString())
- --we're only looking for items that the player can slot.
- --we dont want weird equipedAreas like BaseFists or VDefaultHandgun
- if(isItemInEquippedArea(equippedArea, 1)) then
- statObj = v:GetStatsObjectID()
- if(isItemInEquippedArea(equippedArea, 0)) then
- currentItemLevel = ss:GetStatValue(statObj, 'Armor')
- --print("Armor Rating: ", currentItemLevel)
- end
- if(ts:HasTag(player, "Weapon", vItemID)) then
- currentItemLevel = ss:GetStatValue(statObj, 'EffectiveDPS')
- --print("Weapon EffectiveDPS: ",currentItemLevel)
- equippedArrayType[currentSlot] = itemRecord:ItemType():Type().value
- end
- equippedArrayILevel[currentSlot] = tonumber(string.format("%.2f", currentItemLevel))
- end
- currentSlot = currentSlot + 1
- end
- end
- end
- function isItemInEquippedArea(lookEquippedArea, includeWeapon)
- for i,v in ipairs(equipAreaList) do
- if(v == lookEquippedArea) then
- return true
- end
- if(includeWeapon == 0 and i == 7) then
- return false
- end
- end
- return false
- end
- function MyMod:CheckSystems()
- --returns true if systems are ok
- if(ini.Main.IgnorePauseDetection == false and ini.Main.UseManualMode == false) then
- inkMenuScenario = GetSingleton('inkMenuScenario'):GetSystemRequestsHandler()
- if(inkMenuScenario:IsGamePaused() or inkMenuScenario:IsPreGame()) then
- pauseDetected = true
- pauseDetectionCheck2 = true
- return false
- end
- end
- if(Game.GetPlayerSystem() == nil) then
- return false
- end
- if(Game.GetPlayerSystem():GetLocalPlayerMainGameObject() == nil) then
- return false
- end
- if(Game.GetPlayer() == nil) then
- return false
- end
- return true
- end
- function MyMod:GetHighestEffectiveDPSWeapon(lookedUpTag, checkEquipped)
- highestEffectiveDPSWeapon = 0
- local ok, itemList = ts:GetItemListByTag(player, lookedUpTag)
- for i,v in ipairs(itemList) do
- vItemID = v:GetID()
- if(checkEquipped == true) then
- isItemEqupped = espd:IsEquipped(vItemID)
- if(isItemEqupped == true) then
- itemRecord = Game['gameRPGManager::GetItemRecord;ItemID'](vItemID)
- equippedArea = itemRecord:EquipArea():Type().value
- if(isItemInEquippedArea(equippedArea, 1)) then
- statObj = v:GetStatsObjectID()
- currentItemLevel = ss:GetStatValue(statObj, 'EffectiveDPS')
- currentItemLevel = tonumber(string.format("%.2f", currentItemLevel))
- if(currentItemLevel > highestEffectiveDPSWeapon) then
- highestEffectiveDPSWeapon = currentItemLevel
- end
- end
- end
- else
- statObj = v:GetStatsObjectID()
- currentItemLevel = ss:GetStatValue(statObj, 'EffectiveDPS')
- currentItemLevel = tonumber(string.format("%.2f", currentItemLevel))
- if(currentItemLevel > highestEffectiveDPSWeapon) then
- highestEffectiveDPSWeapon = currentItemLevel
- end
- end
- end
- --print("Highest weapon itemlevel tempItemLevel[0]= ", highestEffectiveDPSWeapon)
- end
- function MyMod:GetHighestArmorByTag(lookedUpTag)
- equipmentSystem = ssc:Get("EquipmentSystem")
- espd = equipmentSystem:GetPlayerData(player)
- highestArmorLevel[lookedUpTag] = 0 --highest armor level by tag that player has
- equippedArmorLevel[lookedUpTag] = 0
- local ok, itemList = ts:GetItemListByTag(player, lookedUpTag)
- local v
- local vItemID
- local isItemEqupped
- local currentItemLevel
- local itemLevelDiff
- for i,v in ipairs(itemList) do
- vItemID = v:GetID()
- statObj = v:GetStatsObjectID()
- currentItemLevel = ss:GetStatValue(statObj, 'Armor')
- currentItemLevel = tonumber(string.format("%.3f", currentItemLevel))
- isItemEqupped = espd:IsEquipped(vItemID)
- if(isItemEqupped == true) then
- equippedArmorLevel[lookedUpTag] = currentItemLevel
- end
- if(currentItemLevel > highestArmorLevel[lookedUpTag]) then
- highestArmorLevel[lookedUpTag] = currentItemLevel
- end
- --print("currentItemLevel for:".. lookedUpTag .. " is:".. currentItemLevel) --
- end
- --print("highestArmorLevel ".. lookedUpTag .. " :" .. highestArmorLevel[lookedUpTag])
- itemLevelDiff = highestArmorLevel[lookedUpTag] - equippedArmorLevel[lookedUpTag]
- if(itemLevelDiff > 0) then
- return 1
- else
- return 0
- end
- --print("highestArmorLevel ".. lookedUpTag .. " :" .. highestArmorLevel[lookedUpTag])
- end
- function MyMod:IsItemInIgnoreList(itemIDToCheck)
- --working on this (01/23/2021)
- --public class UIItemsHelper {
- --public string GetItemName(InventoryItemData itemData) {
- --GetItemName(ToHandle(itemRecord), itemData);
- --itemdata = ts:GetItemData(player, itemIDToCheck)
- --IsItemIconic = itemdata:GetStatValueByType('IsItemIconic')
- --Game['UIItemsHelper::GetItemName;itemData'](itemdata)
- --for i,v in ipairs(ignoreTheseItems) do
- -- tid = TweakDBID.new(v)
- -- itemid = GetSingleton("gameItemID"):FromTDBID(tid)
- -- currentBoosterCount = ts:GetItemQuantity(player, itemid)
- --
- -- if currentBoosterCount > 0 then
- -- --for debugging
- -- MyMod:LogAction("Used booster: ", v)
- --
- -- Game['ItemActionsHelper::ConsumeItem;GameObjectItemIDBool'](player, itemid, true)
- -- end
- --end
- end
- function MyMod:INI_File_Load()
- ini = MyMod:LIP_Load('settings.ini')
- MyMod:INI_Check_Nills()
- end
- function MyMod:INI_Check_Nills()
- if(ini.Main == nil) then ini.Main = {} end
- if(ini.Main.UseMod == nil) then ini.Main.UseMod = true end
- if(ini.Main.followCETOverlay == nil) then ini.Main.followCETOverlay = true end
- if(ini.Main.UseManualMode == nil) then ini.Main.UseManualMode = false end
- if(ini.Main.IgnorePauseDetection == nil) then ini.Main.IgnorePauseDetection = false end
- if(ini.Main.UseEquipmentNotification == nil) then ini.Main.UseEquipmentNotification = false end
- if(ini.Main.simplifiedInterval == nil) then ini.Main.simplifiedInterval = 1 end
- if(ini.Main.processItemsOfLesserItemLevel_Only == nil) then ini.Main.processItemsOfLesserItemLevel_Only = true end
- if(ini.Main.ignoreIconicItems == nil) then ini.Main.ignoreIconicItems = true end
- if(ini.consumable == nil) then ini.consumable = {} end
- if(ini.consumable.ProcessAlcohol == nil) then ini.consumable.ProcessAlcohol = true end
- if(ini.consumable.ProcessFoods == nil) then ini.consumable.ProcessFoods = true end
- if(ini.consumable.ProcessDrinks == nil) then ini.consumable.ProcessDrinks = true end
- if(ini.consumable.foodToKeep == nil) then ini.consumable.foodToKeep = "Items.LowQualityFood11" end
- if(ini.consumable.beverageToKeep == nil) then ini.consumable.beverageToKeep = "Items.GoodQualityDrink10" end
- if(ini.consumable.useAlcoholCraft == nil) then ini.consumable.useAlcoholCraft = false end
- if(ini.consumable.alcoholToKeep == nil) then ini.consumable.alcoholToKeep = "Items.NomadsAlcohol1" end
- if(ini.consumable.useHotkey_FoodBeverages == nil) then ini.consumable.useHotkey_FoodBeverages = true end
- if(ini.consumable.useHotkey_Booster == nil) then ini.consumable.useHotkey_Booster = true end
- if(ini.autoHealthInhaler == nil) then ini.autoHealthInhaler = {} end
- if(ini.autoHealthInhaler.autoHealthInhaler == nil) then ini.autoHealthInhaler.autoHealthInhaler = false end
- if(ini.autoHealthInhaler.autoHealthInhalerThreshold == nil) then ini.autoHealthInhaler.autoHealthInhalerThreshold = 50 end
- if(ini.autoHealthInhaler.autoHealthInhalerCoolDown == nil) then ini.autoHealthInhaler.autoHealthInhalerCoolDown = 5 end
- if(ini.Junk == nil) then ini.Junk = {} end
- if(ini.Junk.autoCleanJunk == nil) then ini.Junk.autoCleanJunk = false end
- if(ini.Junk.sellAllJunk == nil) then ini.Junk.sellAllJunk = false end
- if(ini.Junk.sellExpensiveJunk == nil) then ini.Junk.sellExpensiveJunk = true end
- if(ini.Junk.disassembleAllJunk == nil) then ini.Junk.disassembleAllJunk = false end
- if(ini.Junk.disassembleCheapJunk == nil) then ini.Junk.disassembleCheapJunk = true end
- if(ini.SimplifyGrenades == nil) then ini.SimplifyGrenades = {} end
- if(ini.SimplifyGrenades.Biohazard == nil) then ini.SimplifyGrenades.Biohazard=false end
- if(ini.SimplifyGrenades.Cutting == nil) then ini.SimplifyGrenades.Cutting=false end
- if(ini.SimplifyGrenades.Emp == nil) then ini.SimplifyGrenades.Emp=false end
- if(ini.SimplifyGrenades.Flash == nil) then ini.SimplifyGrenades.Flash=false end
- if(ini.SimplifyGrenades.Frag == nil) then ini.SimplifyGrenades.Frag=false end
- if(ini.SimplifyGrenades.Incendiary == nil) then ini.SimplifyGrenades.Incendiary=false end
- if(ini.SimplifyGrenades.Recon == nil) then ini.SimplifyGrenades.Recon=false end
- if(ini.SimplifyGrenades.SimplifyGrenades_Common == nil) then ini.SimplifyGrenades.SimplifyGrenades_Common=0 end
- if(ini.SimplifyGrenades.SimplifyGrenades_Uncommon == nil) then ini.SimplifyGrenades.SimplifyGrenades_Uncommon=0 end
- if(ini.SimplifyGrenades.SimplifyGrenades_Rare == nil) then ini.SimplifyGrenades.SimplifyGrenades_Rare=0 end
- if(ini.SimplifyGrenades.SimplifyGrenades_Epic == nil) then ini.SimplifyGrenades.SimplifyGrenades_Epic=0 end
- if(ini.SimplifyGrenades.SimplifyGrenades_Legendary == nil) then ini.SimplifyGrenades.SimplifyGrenades_Legendary=0 end
- if(ini.SimplifyClothesMod == nil) then ini.SimplifyClothesMod = {} end
- if(ini.SimplifyClothesMod.SimplifyClothesMod_Common == nil) then ini.SimplifyClothesMod.SimplifyClothesMod_Common=0 end
- if(ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon == nil) then ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon=0 end
- if(ini.SimplifyClothesMod.SimplifyClothesMod_Rare == nil) then ini.SimplifyClothesMod.SimplifyClothesMod_Rare=0 end
- if(ini.SimplifyClothesMod.SimplifyClothesMod_Epic == nil) then ini.SimplifyClothesMod.SimplifyClothesMod_Epic=0 end
- if(ini.SimplifyClothesMod.SimplifyClothesMod_Legendary == nil) then ini.SimplifyClothesMod.SimplifyClothesMod_Legendary=0 end
- if(ini.SimplifyWeaponMod == nil) then ini.SimplifyWeaponMod = {} end
- if(ini.SimplifyWeaponMod.SimplifyWeaponMod_Common == nil) then ini.SimplifyWeaponMod.SimplifyWeaponMod_Common=0 end
- if(ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon == nil) then ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon=0 end
- if(ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare == nil) then ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare=0 end
- if(ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic == nil) then ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic=0 end
- if(ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary == nil) then ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary=0 end
- if(ini.SimplifyWeapon == nil) then ini.SimplifyWeapon = {} end
- if(ini.SimplifyWeapon.KeepOneOfEachType == nil) then ini.SimplifyWeapon.KeepOneOfEachType=false end
- --
- if(ini.SimplifyWeapon.RifleAssault == nil) then ini.SimplifyWeapon.RifleAssault=true end
- if(ini.SimplifyWeapon.Knuckles == nil) then ini.SimplifyWeapon.Knuckles=true end
- if(ini.SimplifyWeapon.TwoHandHammer == nil) then ini.SimplifyWeapon.TwoHandHammer=true end
- if(ini.SimplifyWeapon.Handgun == nil) then ini.SimplifyWeapon.Handgun=true end
- if(ini.SimplifyWeapon.HeavyWeapon == nil) then ini.SimplifyWeapon.HeavyWeapon=true end
- if(ini.SimplifyWeapon.Katana == nil) then ini.SimplifyWeapon.Katana=true end
- if(ini.SimplifyWeapon.Knife == nil) then ini.SimplifyWeapon.Knife=true end
- if(ini.SimplifyWeapon.LMG == nil) then ini.SimplifyWeapon.LMG=true end
- if(ini.SimplifyWeapon.OneHandBlade == nil) then ini.SimplifyWeapon.OneHandBlade=true end
- if(ini.SimplifyWeapon.OneHandClub == nil) then ini.SimplifyWeapon.OneHandClub=true end
- if(ini.SimplifyWeapon.RiflePrecision == nil) then ini.SimplifyWeapon.RiflePrecision=true end
- if(ini.SimplifyWeapon.Revolver == nil) then ini.SimplifyWeapon.Revolver=true end
- if(ini.SimplifyWeapon.Shotgun == nil) then ini.SimplifyWeapon.Shotgun=true end
- if(ini.SimplifyWeapon.ShotgunDual == nil) then ini.SimplifyWeapon.ShotgunDual=true end
- if(ini.SimplifyWeapon.RifleSniper == nil) then ini.SimplifyWeapon.RifleSniper=true end
- if(ini.SimplifyWeapon.SMG == nil) then ini.SimplifyWeapon.SMG=true end
- if(ini.SimplifyWeapon.TwoHandClub == nil) then ini.SimplifyWeapon.TwoHandClub=true end
- if(ini.SimplifyWeapon.Unique == nil) then ini.SimplifyWeapon.Unique=true end
- --
- if(ini.SimplifyWeapon.SimplifyWeapon_Common == nil) then ini.SimplifyWeapon.SimplifyWeapon_Common=0 end
- if(ini.SimplifyWeapon.SimplifyWeapon_Uncommon == nil) then ini.SimplifyWeapon.SimplifyWeapon_Uncommon=0 end
- if(ini.SimplifyWeapon.SimplifyWeapon_Rare == nil) then ini.SimplifyWeapon.SimplifyWeapon_Rare=0 end
- if(ini.SimplifyWeapon.SimplifyWeapon_Epic == nil) then ini.SimplifyWeapon.SimplifyWeapon_Epic=0 end
- if(ini.SimplifyWeapon.SimplifyWeapon_Legendary == nil) then ini.SimplifyWeapon.SimplifyWeapon_Legendary=0 end
- if(ini.SimplifyFeet == nil) then ini.SimplifyFeet = {} end
- if(ini.SimplifyFeet.SimplifyFeet_Common == nil) then ini.SimplifyFeet.SimplifyFeet_Common=0 end
- if(ini.SimplifyFeet.SimplifyFeet_Uncommon == nil) then ini.SimplifyFeet.SimplifyFeet_Uncommon=0 end
- if(ini.SimplifyFeet.SimplifyFeet_Rare == nil) then ini.SimplifyFeet.SimplifyFeet_Rare=0 end
- if(ini.SimplifyFeet.SimplifyFeet_Epic == nil) then ini.SimplifyFeet.SimplifyFeet_Epic=0 end
- if(ini.SimplifyFeet.SimplifyFeet_Legendary == nil) then ini.SimplifyFeet.SimplifyFeet_Legendary=0 end
- if(ini.SimplifyHeadArmor == nil) then ini.SimplifyHeadArmor = {} end
- if(ini.SimplifyHeadArmor.SimplifyHeadArmor_Common == nil) then ini.SimplifyHeadArmor.SimplifyHeadArmor_Common=0 end
- if(ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon == nil) then ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon=0 end
- if(ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare == nil) then ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare=0 end
- if(ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic == nil) then ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic=0 end
- if(ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary == nil) then ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary=0 end
- if(ini.SimplifyChestArmor == nil) then ini.SimplifyChestArmor = {} end
- if(ini.SimplifyChestArmor.SimplifyChestArmor_Common == nil) then ini.SimplifyChestArmor.SimplifyChestArmor_Common=0 end
- if(ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon == nil) then ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon=0 end
- if(ini.SimplifyChestArmor.SimplifyChestArmor_Rare == nil) then ini.SimplifyChestArmor.SimplifyChestArmor_Rare=0 end
- if(ini.SimplifyChestArmor.SimplifyChestArmor_Epic == nil) then ini.SimplifyChestArmor.SimplifyChestArmor_Epic=0 end
- if(ini.SimplifyChestArmor.SimplifyChestArmor_Legendary == nil) then ini.SimplifyChestArmor.SimplifyChestArmor_Legendary=0 end
- if(ini.SimplifyInnerChestArmor == nil) then ini.SimplifyInnerChestArmor = {} end
- if(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common == nil) then ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common=0 end
- if(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon == nil) then ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon=0 end
- if(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare == nil) then ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare=0 end
- if(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic == nil) then ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic=0 end
- if(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary == nil) then ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary=0 end
- if(ini.SimplifyFaceArmor == nil) then ini.SimplifyFaceArmor = {} end
- if(ini.SimplifyFaceArmor.SimplifyFaceArmor_Common == nil) then ini.SimplifyFaceArmor.SimplifyFaceArmor_Common=0 end
- if(ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon == nil) then ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon=0 end
- if(ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare == nil) then ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare=0 end
- if(ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic == nil) then ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic=0 end
- if(ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary == nil) then ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary=0 end
- if(ini.SimplifyLegArmor == nil) then ini.SimplifyLegArmor = {} end
- if(ini.SimplifyLegArmor.SimplifyLegArmor_Common == nil) then ini.SimplifyLegArmor.SimplifyLegArmor_Common=0 end
- if(ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon == nil) then ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon=0 end
- if(ini.SimplifyLegArmor.SimplifyLegArmor_Rare == nil) then ini.SimplifyLegArmor.SimplifyLegArmor_Rare=0 end
- if(ini.SimplifyLegArmor.SimplifyLegArmor_Epic == nil) then ini.SimplifyLegArmor.SimplifyLegArmor_Epic=0 end
- if(ini.SimplifyLegArmor.SimplifyLegArmor_Legendary == nil) then ini.SimplifyLegArmor.SimplifyLegArmor_Legendary=0 end
- if(ini.SimplifyHealthItems == nil) then ini.SimplifyHealthItems = {} end
- if(ini.SimplifyHealthItems.MaxDoc_MK1 == nil) then ini.SimplifyHealthItems.MaxDoc_MK1=0 end
- if(ini.SimplifyHealthItems.MaxDoc_MK2 == nil) then ini.SimplifyHealthItems.MaxDoc_MK2=0 end
- if(ini.SimplifyHealthItems.MaxDoc_MK3 == nil) then ini.SimplifyHealthItems.MaxDoc_MK3=0 end
- if(ini.SimplifyHealthItems.Bounce_Back_MK1 == nil) then ini.SimplifyHealthItems.Bounce_Back_MK1=0 end
- if(ini.SimplifyHealthItems.Bounce_Back_MK2 == nil) then ini.SimplifyHealthItems.Bounce_Back_MK2=0 end
- if(ini.SimplifyHealthItems.Bounce_Back_MK3 == nil) then ini.SimplifyHealthItems.Bounce_Back_MK3=0 end
- if(ini.SimplifyShards == nil) then ini.SimplifyShards = {} end
- if(ini.SimplifyShards.SimplifyShards == nil) then ini.SimplifyShards.SimplifyShards=false end
- if(ini.SimplifyShards.SimplifyShards == 0) then
- ini.SimplifyShards.SimplifyShards = false
- end
- end
- function MyMod:INI_File_Save()
- if(initNotDone) then
- print("MyMod:INI_File_Save: Message 0 TRIED ENTERING WHILE onInit IS NOT DONE!")
- do return end
- end
- --Don't save nills!
- MyMod:INI_Check_Nills()
- --we want to save in a certain order, damned Lua
- --having tables in a random order. god dammit
- --contents = contents .. ('%s\n'):format("DESCRIPTION_HERE");
- filename = getCWD('settings.ini')
- assert(type(filename) == 'string', 'Parameter "filename" must be a string.');
- local file = assert(io.open(filename, 'w+b'), 'Error loading file :' .. filename);
- local contents = '';
- contents = contents .. ('[%s]\n'):format("Main");
- contents = contents .. ('%s=%s\n'):format("UseMod", tostring(ini.Main.UseMod));
- contents = contents .. ('%s=%s\n'):format("followCETOverlay", tostring(ini.Main.followCETOverlay));
- contents = contents .. ('%s\n'):format(";trigger the mod manually");
- contents = contents .. ('%s=%s\n'):format("UseManualMode", tostring(ini.Main.UseManualMode));
- contents = contents .. ('%s=%s\n'):format("IgnorePauseDetection", tostring(ini.Main.IgnorePauseDetection));
- contents = contents .. ('%s=%s\n'):format("UseEquipmentNotification", tostring(ini.Main.UseEquipmentNotification));
- contents = contents .. ('%s\n'):format(";time interval allowed to auto simplify food and beverages");
- contents = contents .. ('%s=%s\n'):format("simplifiedInterval", tostring(ini.Main.simplifiedInterval));
- contents = contents .. ('%s=%s\n'):format("processItemsOfLesserItemLevel_Only", tostring(ini.Main.processItemsOfLesserItemLevel_Only));
- contents = contents .. ('%s=%s\n'):format("ignoreIconicItems", tostring(ini.Main.ignoreIconicItems));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("consumable");
- contents = contents .. ('%s=%s\n'):format("ProcessAlcohol", tostring(ini.consumable.ProcessAlcohol));
- contents = contents .. ('%s=%s\n'):format("ProcessFoods", tostring(ini.consumable.ProcessFoods));
- contents = contents .. ('%s=%s\n'):format("ProcessDrinks", tostring(ini.consumable.ProcessDrinks));
- contents = contents .. ('%s=%s\n'):format("foodToKeep", tostring(ini.consumable.foodToKeep));
- contents = contents .. ('%s=%s\n'):format("beverageToKeep", tostring(ini.consumable.beverageToKeep));
- contents = contents .. ('%s=%s\n'):format("useAlcoholCraft", tostring(ini.consumable.useAlcoholCraft));
- contents = contents .. ('%s=%s\n'):format("alcoholToKeep", tostring(ini.consumable.alcoholToKeep));
- contents = contents .. ('%s=%s\n'):format("useHotkey_FoodBeverages", tostring(ini.consumable.useHotkey_FoodBeverages));
- contents = contents .. ('%s=%s\n'):format("useHotkey_Booster", tostring(ini.consumable.useHotkey_Booster));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("autoHealthInhaler");
- contents = contents .. ('%s\n'):format(";auto use health inhaler on low health.");
- contents = contents .. ('%s=%s\n'):format("autoHealthInhaler", tostring(ini.autoHealthInhaler.autoHealthInhaler));
- contents = contents .. ('%s\n'):format(";autoHealthInhalerThreshold = is the percent of the player's health when it activates");
- contents = contents .. ('%s=%s\n'):format("autoHealthInhalerThreshold", tostring(ini.autoHealthInhaler.autoHealthInhalerThreshold));
- contents = contents .. ('%s=%s\n'):format("autoHealthInhalerCoolDown", tostring(ini.autoHealthInhaler.autoHealthInhalerCoolDown));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("Junk");
- contents = contents .. ('%s\n'):format(";Determines if the script will process junk items");
- contents = contents .. ('%s=%s\n'):format("autoCleanJunk", tostring(ini.Junk.autoCleanJunk));
- contents = contents .. ('%s=%s\n'):format("sellAllJunk", tostring(ini.Junk.sellAllJunk));
- contents = contents .. ('%s=%s\n'):format("sellExpensiveJunk", tostring(ini.Junk.sellExpensiveJunk));
- contents = contents .. ('%s=%s\n'):format("disassembleAllJunk", tostring(ini.Junk.disassembleAllJunk));
- contents = contents .. ('%s=%s\n'):format("disassembleCheapJunk", tostring(ini.Junk.disassembleCheapJunk));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyGrenades");
- contents = contents .. ('%s\n'):format(";If true will process grenade type");
- contents = contents .. ('%s=%s\n'):format("Biohazard", tostring(ini.SimplifyGrenades.Biohazard));
- contents = contents .. ('%s=%s\n'):format("Cutting", tostring(ini.SimplifyGrenades.Cutting));
- contents = contents .. ('%s=%s\n'):format("Emp", tostring(ini.SimplifyGrenades.Emp));
- contents = contents .. ('%s=%s\n'):format("Flash", tostring(ini.SimplifyGrenades.Flash));
- contents = contents .. ('%s=%s\n'):format("Frag", tostring(ini.SimplifyGrenades.Frag));
- contents = contents .. ('%s=%s\n'):format("Incendiary", tostring(ini.SimplifyGrenades.Incendiary));
- contents = contents .. ('%s=%s\n'):format("Recon", tostring(ini.SimplifyGrenades.Recon));
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyGrenades_Common", tostring(ini.SimplifyGrenades.SimplifyGrenades_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyGrenades_Uncommon", tostring(ini.SimplifyGrenades.SimplifyGrenades_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyGrenades_Rare", tostring(ini.SimplifyGrenades.SimplifyGrenades_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyGrenades_Epic", tostring(ini.SimplifyGrenades.SimplifyGrenades_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyGrenades_Legendary", tostring(ini.SimplifyGrenades.SimplifyGrenades_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyClothesMod");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyClothesMod_Common", tostring(ini.SimplifyClothesMod.SimplifyClothesMod_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyClothesMod_Uncommon", tostring(ini.SimplifyClothesMod.SimplifyClothesMod_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyClothesMod_Rare", tostring(ini.SimplifyClothesMod.SimplifyClothesMod_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyClothesMod_Epic", tostring(ini.SimplifyClothesMod.SimplifyClothesMod_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyClothesMod_Legendary", tostring(ini.SimplifyClothesMod.SimplifyClothesMod_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyWeaponMod");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyWeaponMod_Common", tostring(ini.SimplifyWeaponMod.SimplifyWeaponMod_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeaponMod_Uncommon", tostring(ini.SimplifyWeaponMod.SimplifyWeaponMod_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeaponMod_Rare", tostring(ini.SimplifyWeaponMod.SimplifyWeaponMod_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeaponMod_Epic", tostring(ini.SimplifyWeaponMod.SimplifyWeaponMod_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeaponMod_Legendary", tostring(ini.SimplifyWeaponMod.SimplifyWeaponMod_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyWeapon");
- contents = contents .. ('%s\n'):format(";Prevents the system from selling a weapon if it is the only one of that type in your inventory");
- contents = contents .. ('%s=%s\n'):format("KeepOneOfEachType", tostring(ini.SimplifyWeapon.KeepOneOfEachType));
- contents = contents .. ('%s\n'):format(";Part of KeepOneOfEachType, which weapon type to keep");
- contents = contents .. ('%s=%s\n'):format("RifleAssault", tostring(ini.SimplifyWeapon.RifleAssault));
- contents = contents .. ('%s=%s\n'):format("Knuckles", tostring(ini.SimplifyWeapon.Knuckles));
- contents = contents .. ('%s=%s\n'):format("TwoHandHammer", tostring(ini.SimplifyWeapon.TwoHandHammer));
- contents = contents .. ('%s=%s\n'):format("Handgun", tostring(ini.SimplifyWeapon.Handgun));
- contents = contents .. ('%s=%s\n'):format("HeavyWeapon", tostring(ini.SimplifyWeapon.HeavyWeapon));
- contents = contents .. ('%s=%s\n'):format("Katana", tostring(ini.SimplifyWeapon.Katana));
- contents = contents .. ('%s=%s\n'):format("Knife", tostring(ini.SimplifyWeapon.Knife));
- contents = contents .. ('%s=%s\n'):format("LMG", tostring(ini.SimplifyWeapon.LMG));
- contents = contents .. ('%s=%s\n'):format("OneHandBlade", tostring(ini.SimplifyWeapon.OneHandBlade));
- contents = contents .. ('%s=%s\n'):format("OneHandClub", tostring(ini.SimplifyWeapon.OneHandClub));
- contents = contents .. ('%s=%s\n'):format("RiflePrecision", tostring(ini.SimplifyWeapon.RiflePrecision));
- contents = contents .. ('%s=%s\n'):format("Revolver", tostring(ini.SimplifyWeapon.Revolver));
- contents = contents .. ('%s=%s\n'):format("Shotgun", tostring(ini.SimplifyWeapon.Shotgun));
- contents = contents .. ('%s=%s\n'):format("ShotgunDual", tostring(ini.SimplifyWeapon.ShotgunDual));
- contents = contents .. ('%s=%s\n'):format("RifleSniper", tostring(ini.SimplifyWeapon.RifleSniper));
- contents = contents .. ('%s=%s\n'):format("SMG", tostring(ini.SimplifyWeapon.SMG));
- contents = contents .. ('%s=%s\n'):format("TwoHandClub", tostring(ini.SimplifyWeapon.TwoHandClub));
- contents = contents .. ('%s=%s\n'):format("Unique", tostring(ini.SimplifyWeapon.Unique));
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyWeapon_Common", tostring(ini.SimplifyWeapon.SimplifyWeapon_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeapon_Uncommon", tostring(ini.SimplifyWeapon.SimplifyWeapon_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeapon_Rare", tostring(ini.SimplifyWeapon.SimplifyWeapon_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeapon_Epic", tostring(ini.SimplifyWeapon.SimplifyWeapon_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyWeapon_Legendary", tostring(ini.SimplifyWeapon.SimplifyWeapon_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyFeet");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyFeet_Common", tostring(ini.SimplifyFeet.SimplifyFeet_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyFeet_Uncommon", tostring(ini.SimplifyFeet.SimplifyFeet_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyFeet_Rare", tostring(ini.SimplifyFeet.SimplifyFeet_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyFeet_Epic", tostring(ini.SimplifyFeet.SimplifyFeet_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyFeet_Legendary", tostring(ini.SimplifyFeet.SimplifyFeet_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyHeadArmor");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyHeadArmor_Common", tostring(ini.SimplifyHeadArmor.SimplifyHeadArmor_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyHeadArmor_Uncommon", tostring(ini.SimplifyHeadArmor.SimplifyHeadArmor_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyHeadArmor_Rare", tostring(ini.SimplifyHeadArmor.SimplifyHeadArmor_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyHeadArmor_Epic", tostring(ini.SimplifyHeadArmor.SimplifyHeadArmor_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyHeadArmor_Legendary", tostring(ini.SimplifyHeadArmor.SimplifyHeadArmor_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyChestArmor");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyChestArmor_Common", tostring(ini.SimplifyChestArmor.SimplifyChestArmor_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyChestArmor_Uncommon", tostring(ini.SimplifyChestArmor.SimplifyChestArmor_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyChestArmor_Rare", tostring(ini.SimplifyChestArmor.SimplifyChestArmor_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyChestArmor_Epic", tostring(ini.SimplifyChestArmor.SimplifyChestArmor_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyChestArmor_Legendary", tostring(ini.SimplifyChestArmor.SimplifyChestArmor_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyInnerChestArmor");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyInnerChestArmor_Common", tostring(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyInnerChestArmor_Uncommon", tostring(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyInnerChestArmor_Rare", tostring(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyInnerChestArmor_Epic", tostring(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyInnerChestArmor_Legendary", tostring(ini.SimplifyInnerChestArmor.SimplifyInnerChestArmor_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyFaceArmor");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyFaceArmor_Common", tostring(ini.SimplifyFaceArmor.SimplifyFaceArmor_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyFaceArmor_Uncommon", tostring(ini.SimplifyFaceArmor.SimplifyFaceArmor_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyFaceArmor_Rare", tostring(ini.SimplifyFaceArmor.SimplifyFaceArmor_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyFaceArmor_Epic", tostring(ini.SimplifyFaceArmor.SimplifyFaceArmor_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyFaceArmor_Legendary", tostring(ini.SimplifyFaceArmor.SimplifyFaceArmor_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyLegArmor");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("SimplifyLegArmor_Common", tostring(ini.SimplifyLegArmor.SimplifyLegArmor_Common));
- contents = contents .. ('%s=%s\n'):format("SimplifyLegArmor_Uncommon", tostring(ini.SimplifyLegArmor.SimplifyLegArmor_Uncommon));
- contents = contents .. ('%s=%s\n'):format("SimplifyLegArmor_Rare", tostring(ini.SimplifyLegArmor.SimplifyLegArmor_Rare));
- contents = contents .. ('%s=%s\n'):format("SimplifyLegArmor_Epic", tostring(ini.SimplifyLegArmor.SimplifyLegArmor_Epic));
- contents = contents .. ('%s=%s\n'):format("SimplifyLegArmor_Legendary", tostring(ini.SimplifyLegArmor.SimplifyLegArmor_Legendary));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyHealthItems");
- contents = contents .. ('%s\n'):format(";0=Nothing, 1=AutoSell, 2=AutoDismantle");
- contents = contents .. ('%s=%s\n'):format("MaxDoc_MK1", tostring(ini.SimplifyHealthItems.MaxDoc_MK1));
- contents = contents .. ('%s=%s\n'):format("MaxDoc_MK2", tostring(ini.SimplifyHealthItems.MaxDoc_MK2));
- contents = contents .. ('%s=%s\n'):format("MaxDoc_MK3", tostring(ini.SimplifyHealthItems.MaxDoc_MK3));
- contents = contents .. ('%s=%s\n'):format("Bounce_Back_MK1", tostring(ini.SimplifyHealthItems.Bounce_Back_MK1));
- contents = contents .. ('%s=%s\n'):format("Bounce_Back_MK2", tostring(ini.SimplifyHealthItems.Bounce_Back_MK2));
- contents = contents .. ('%s=%s\n'):format("Bounce_Back_MK3", tostring(ini.SimplifyHealthItems.Bounce_Back_MK3));
- contents = contents .. ('\n')
- contents = contents .. ('[%s]\n'):format("SimplifyShards");
- contents = contents .. ('%s\n'):format(";false=Nothing, true=AutoSell");
- contents = contents .. ('%s=%s\n'):format("SimplifyShards", tostring(ini.SimplifyShards.SimplifyShards));
- contents = contents .. ('\n')
- file:write(contents);
- file:close();
- end
- --- Returns a table containing all the data from the INI file.
- --@param filename The name of the INI file to parse. [string]
- --@return The table containing all data from the INI file. [table]
- function MyMod:LIP_Load(filename)
- if(initNotDone) then
- do return end
- end
- filename = getCWD(filename)
- local file = io.open(filename, 'r');
- local data = {};
- local section;
- for line in file:lines() do
- local tempSection = line:match('^%[([^%[%]]+)%]$');
- if(tempSection)then
- section = tonumber(tempSection) and tonumber(tempSection) or tempSection;
- data[section] = data[section] or {};
- end
- local param, value = line:match('^([%w|_]+)%s-=%s-(.+)$');
- if(param and value ~= nil)then
- if(tonumber(value))then
- value = tonumber(value);
- elseif(value == 'true')then
- value = true;
- elseif(value == 'false')then
- value = false;
- end
- if(tonumber(param))then
- param = tonumber(param);
- end
- data[section][param] = value;
- end
- end
- file:close();
- return data;
- end
- function file_exists(filename)
- local f=io.open(filename,"r")
- if (f~=nil) then io.close(f) return true else return false end
- end
- function getCWD(filename)
- if file_exists("./bin/x64/plugins/cyber_engine_tweaks/mods/food/"..filename) then
- return "./bin/x64/plugins/cyber_engine_tweaks/mods/food/"..filename
- elseif file_exists("./plugins/cyber_engine_tweaks/mods/food/"..filename) then
- return "./plugins/cyber_engine_tweaks/mods/food/"..filename
- elseif file_exists("./cyber_engine_tweaks/mods/food/"..filename) then
- return "./cyber_engine_tweaks/mods/food/"..filename
- elseif file_exists("./mods/food/"..filename) then
- return "./mods/food/"..filename
- elseif file_exists("./food/"..filename) then
- return "./food/"..filename
- elseif file_exists("./"..filename) then
- return "./"..filename
- end
- --file not found attempt to create settings.ini
- print("settings.ini not found. Creating!")
- local modpath = ""
- modpath = modDirectory("init.lua")
- print("Directory found at: ", modpath)
- modpath = modpath .. "settings.ini"
- print("There should now be a file at: ", modpath)
- file = io.open(modpath, "w")
- file:write("123")
- file:close()
- return modpath
- end
- function modDirectory(filename)
- if file_exists("./bin/x64/plugins/cyber_engine_tweaks/mods/food/"..filename) then
- return "./bin/x64/plugins/cyber_engine_tweaks/mods/food/"
- elseif file_exists("./plugins/cyber_engine_tweaks/mods/food/"..filename) then
- return "./plugins/cyber_engine_tweaks/mods/food/"
- elseif file_exists("./cyber_engine_tweaks/mods/food/"..filename) then
- return "./cyber_engine_tweaks/mods/food/"
- elseif file_exists("./mods/food/"..filename) then
- return "./mods/food/"
- elseif file_exists("./food/"..filename) then
- return "./food/"
- elseif file_exists("./"..filename) then
- return "./"
- end
- end
- function IsPlayerInAnyMenu()
- blackboard = Game.GetBlackboardSystem():Get(Game.GetAllBlackboardDefs().UI_System);
- uiSystemBB = (Game.GetAllBlackboardDefs().UI_System);
- return(blackboard:GetBool(uiSystemBB.IsInMenu));
- end
- return MyMod:new()
Add Comment
Please, Sign In to add comment