Files
REM-Mod/EXE/REM/Lua/luastart.lua
2025-06-05 20:45:28 +02:00

103 lines
3.0 KiB
Lua

print("Lua started!")
-- Open the console after a delay
-- rem.StartTimer(2000, function()
-- rem.ShowNNMessage(9000)
-- print("Console open after 2 seconds.")
-- end)
-- Add Infocard
rem.AddInfoCard(9000, "TestSpam")
rem.AddInfoCard(1904, "REMNANT")
-- RACE INFOCARDS
rem.AddInfoCard(9001, "1")
rem.AddInfoCard(9002, "2")
rem.AddInfoCard(9003, "3")
rem.AddInfoCard(9004, "4")
rem.AddInfoCard(9005, "5")
rem.AddInfoCard(9006, "START")
rem.ConfigureWeaponFire({
{1, 70}, -- Weapon 1: 70ms Cooldown
{2, 100}, -- Weapon 2: 100ms Cooldown
{3, 150} -- Weapon 3: 150ms Cooldown
})
-- Dynamic Enviroments and Characters
-- Function to modify the config.lua file
function modifyLuaConfig(filePath)
-- Read the file
local file, err = io.open(filePath, "r")
if not file then
print("Error opening file: ".. err)
return
end
-- Read all lines from the file into a table
local lines = {}
for line in file:lines() do
table.insert(lines, line)
end
file:close()
-- Get the current day and month
local currentDay = os.date("%d")
local currentMonth = os.date("%B")
-- Modify the lines as needed
for i, line in ipairs(lines) do
-- Change day_gen to the current day
if line:find("setglobal%('day_gen',") then
lines[i] = "setglobal('day_gen', \"".. currentDay.. "\")"
-- Change months_gen to the current month
elseif line:find("setglobal%('months_gen',") then
lines[i] = "setglobal('months_gen', \"".. currentMonth.. "\")"
-- Change gcs_state to "off"
elseif line:find("setglobal%('gcs_state',") then
lines[i] = "setglobal('gcs_state', \"off\")"
-- Change char_gen to "trent"
elseif line:find("setglobal%('char_gen',") then
lines[i] = "setglobal('char_gen', \"trent\")"
-- Change gcs_voice to "trent"
elseif line:find("setglobal%('gcs_voice',") then
lines[i] = "setglobal('gcs_voice', \"trent\")"
-- Change anm_gen to "stand"
elseif line:find("setglobal%('anm_gen',") then
lines[i] = "setglobal('anm_gen', \"stand\")"
-- Change manhattan_gen, rochester_gen, toledo_gen to "origin"
elseif line:find("setglobal%('manhattan_gen',") then
lines[i] = "setglobal('manhattan_gen', \"origin\")"
elseif line:find("setglobal%('rochester_gen',") then
lines[i] = "setglobal('rochester_gen', \"origin\")"
elseif line:find("setglobal%('toledo_gen',") then
lines[i] = "setglobal('toledo_gen', \"origin\")"
end
end
-- Write the modified lines back to the file
file, err = io.open(filePath, "w")
if not file then
print("Error writing to file: ".. err)
return
end
for _, line in ipairs(lines) do
file:write(line.. "\n")
end
file:close()
print("File modified successfully.")
end
-- Execute modify function
modifyLuaConfig(".\\REM\\LUA\\DYNAMIC\\config.lua")