Script Features (Ren_SteamMining)
Fully Standalone UI (Standalone NUI)
Implements a custom interface using HTML/CSS/JS, independent of external menu resources like vorp_inputs or WarMenu.
Dark theme design blending seamlessly with RedM's world.
Prioritizes usability with features like “Collect All” for inventory and real-time display of remaining runtime.
Robust Persistence for Server Restarts
Saves all states (fuel, durability, warehouse contents, remaining runtime) to a database (MySQL).
If the server restarts during operation, it recalculates time upon next startup and continues or completes mining.
High-Precision Probability Settings
Allows rare drop rates to be set in increments as small as 0.001%. Enables precise adjustment of drop rates for rare gems and other items.
Immersive Visual Effects
Smoke particles (Particle) emit from the chimney only during operation.
When the completion time arrives, the smoke automatically stops, even if no one interacts with it (client-side time monitoring).
Robust Logic
Employs a safe logic that deducts fuel consumption upfront at startup to prevent calculation errors (increase/decrease inconsistencies).
Strictly uses a callback method that waits for DB updates to complete before refreshing the screen, preventing UI and server data synchronization issues.
Multi-Language Support
Instantly switches UI display, notifications, and item names between Japanese/English/Russian with a simple Config switch.
-- ========================================== -- 基本設定 -- ========================================== Config.Framework = "vorp" -- "vorp" or "rsg" Config.Debug = false Config.Language = "ja" -- "ja", "en", "ru" 切り替えでUIも変化します Config.AdminBypass = true Config.BreakdownChance = 1.0 Config.RepairItem = "repair_kit" -- ========================================== -- アイテム定義 -- ========================================== Config.Items = { fuel = "coal", } -- アイテムIDと表示名の対応表 (言語別) Config.ItemLabels = { ja = { ["coal"] = "石炭", ["ironore"] = "鉄鉱石", ["silverore"] = "銀鉱石", ["golden_nugget"] = "金鉱石", ["rock"] = "石", ["sulfurore"] = "硫黄鉱石", ["garnet"] = "ガーネット【原石】", ["topaz"] = "トパーズ【原石】", ["opal"] = "オパール【原石】", ["sapphire"] = "サファイア【原石】", ["ruby"] = "ルビー【原石】", ["emerald"] = "エメラルド【原石】", ["diamond"] = "ダイアモンド【原石】", ["red_beryl"] = "レッドベリル【原石】", ["benitoite"] = "ベニトアイト【原石】" }, en = { ["coal"] = "Coal", ["ironore"] = "Iron Ore", ["silverore"] = "Silver Ore", ["golden_nugget"] = "Gold Nugget", ["rock"] = "Rock", ["sulfurore"] = "Sulfur Ore", ["garnet"] = "Garnet (Raw)", ["topaz"] = "Topaz (Raw)", ["opal"] = "Opal (Raw)", ["sapphire"] = "Sapphire (Raw)", ["ruby"] = "Ruby (Raw)", ["emerald"] = "Emerald (Raw)", ["diamond"] = "Diamond (Raw)", ["red_beryl"] = "Red Beryl (Raw)", ["benitoite"] = "Benitoite (Raw)" }, ru = { ["coal"] = "Уголь", ["ironore"] = "Железная руда", ["silverore"] = "Серебряная руда", ["golden_nugget"] = "Золотой самородок", ["rock"] = "Камень", ["sulfurore"] = "Серная руда", ["garnet"] = "Гранат", ["topaz"] = "Топаз", ["opal"] = "Опал", ["sapphire"] = "Сапфир", ["ruby"] = "Рубин", ["emerald"] = "Изумруд", ["diamond"] = "Алмаз", ["red_beryl"] = "Красный берилл", ["benitoite"] = "Бенитоит" } } -- ========================================== -- 採掘機の設定 -- ========================================== Config.Machines = { { id = "mine_valentine_01", label = "タンブルウィード西鉱山採掘所 第1機", coords = vector3(-6019.92, -3267.49, -21.65), heading = 269.06, interactOffset = vector3(0.8, 3.0, 0.0), jobRequired = true, --false でジョブ制限を解除 allowedJobs = { "miner",}, --複数のジョブを設定可能 fuelCapacity = 10000, maxOutputWeight = 5000.0, particleOffset = vector3(-6.1, -1.2, 6.9) --objectを変更しない限り変更の必要なし }, } -- ========================================== -- 採掘コース -- ========================================== Config.MiningRoutes = { ["iron_mining"] = { localeKey = "mining_iron", -- Localesに対応するキー timePerCycle = 1, fuelPerMinute = 2, drops = { { item = "ironore", chance = 100.0, min = 1, max = 3 }, { item = "rock", chance = 50.0, min = 1, max = 5 }, { item = "coal", chance = 10.0, min = 1, max = 2 }, { item = "garnet", chance = 2.0, min = 1, max = 1 }, { item = "silverore", chance = 5.0, min = 1, max = 1 }, } }, ["silver_mining"] = { localeKey = "mining_silver", timePerCycle = 1, fuelPerMinute = 3, drops = { { item = "silverore", chance = 100.0, min = 1, max = 2 }, { item = "rock", chance = 40.0, min = 1, max = 4 }, { item = "topaz", chance = 1.5, min = 1, max = 1 }, { item = "opal", chance = 1.5, min = 1, max = 1 }, { item = "sapphire", chance = 0.5, min = 1, max = 1 }, } }, ["gold_mining"] = { localeKey = "mining_gold", timePerCycle = 1, fuelPerMinute = 5, drops = { { item = "golden_nugget", chance = 80.0, min = 1, max = 2 }, { item = "sulfurore", chance = 30.0, min = 1, max = 3 }, { item = "ruby", chance = 1.0, min = 1, max = 1 }, { item = "emerald", chance = 0.8, min = 1, max = 1 }, { item = "diamond", chance = 0.1, min = 1, max = 1 }, { item = "red_beryl", chance = 0.05, min = 1, max = 1 }, { item = "benitoite", chance = 0.001, min = 1, max = 1 }, } }, } -- ========================================== -- テキスト (UI含む) -- ========================================== Config.Locales = { ja = { menu_title = "蒸気自動採掘機",
-- ステータス status_label = "状態", status_idle = "待機中", status_running = "稼働中", status_broken = "故障中", status_finished = "完了 - 受取可能",
-- UI表示 fuel_label = "石炭残量", health_label = "耐久値", unit_count = "個", unit_min = "分", remaining = "残り", consumption = "消費: 石炭",
-- ボタン btn_open_inv = "倉庫を開く", btn_take_item = "アイテムを取り出す", btn_take_all = "すべて取り出す", btn_add_fuel = "石炭を入れる", btn_stop = "緊急停止する", btn_repair = "修理キットを使って修理", btn_back = "戻る", btn_close = "ESC で閉じる",
-- 入力ダイアログ input_setup_title = "稼働設定", input_setup_desc = "何分間 稼働させますか?", input_fuel_title = "石炭投入", input_fuel_desc = "投入する個数を入力してください", input_take_title = "取り出し", input_take_desc = "個数を入力 (最大: %s)",
-- コース名 mining_iron = "鉄鉱石採掘", mining_silver = "銀鉱石採掘", mining_gold = "金鉱石採掘", -- 通知 notify_no_job = "この機械を操作する資格がありません。", notify_no_fuel = "燃料が足りません!", notify_started = "機械が稼働し始めた。", notify_stopped = "機械を停止させた。", notify_repaired = "修理が完了した。", notify_collected = "%s を %s個 取り出した。", notify_inv_full = "これ以上入らない。", notify_broken = "ガガガッ...機械が故障して止まった!", notify_complete = "採掘作業が完了したようだ。", }, en = { menu_title = "Steam Mining Machine",
status_label = "Status", status_idle = "Idle", status_running = "Running", status_broken = "Broken", status_finished = "Finished",
fuel_label = "Fuel Level", health_label = "Health", unit_count = "", unit_min = "min", remaining = "Time left", consumption = "Fuel: Coal",
btn_open_inv = "Open Storage", btn_take_item = "Take Items", btn_take_all = "Take All", btn_add_fuel = "Add Coal", btn_stop = "Emergency Stop", btn_repair = "Repair with Kit", btn_back = "Back", btn_close = "ESC to Close",
input_setup_title = "Setup Job", input_setup_desc = "How many minutes to run?", input_fuel_title = "Add Fuel", input_fuel_desc = "Enter amount of coal", input_take_title = "Take Item", input_take_desc = "Enter amount (Max: %s)",
mining_iron = "Iron Mining", mining_silver = "Silver Mining", mining_gold = "Gold Mining", notify_no_job = "You are not authorized.", notify_no_fuel = "Not enough fuel!", notify_started = "Machine started.", notify_stopped = "Machine stopped.", notify_repaired = "Machine repaired.", notify_collected = "Collected %s x%s", notify_inv_full = "Inventory full.", notify_broken = "The machine broke down!", notify_complete = "Mining completed.", }, ru = { menu_title = "Паровая установка",
status_label = "Статус", status_idle = "Ожидание", status_running = "Работает", status_broken = "СЛОМАНО", status_finished = "Завершено",
fuel_label = "Топливо", health_label = "Состояние", unit_count = "шт", unit_min = "мин", remaining = "Осталось", consumption = "Расход: Уголь",
btn_open_inv = "Открыть склад", btn_take_item = "Взять предметы", btn_take_all = "Взять всё", btn_add_fuel = "Добавить уголь", btn_stop = "Экстренная остановка", btn_repair = "Ремонт", btn_back = "Назад", btn_close = "ESC - Закрыть",
input_setup_title = "Настройка", input_setup_desc = "Сколько минут работать?", input_fuel_title = "Топливо", input_fuel_desc = "Введите количество", input_take_title = "Взять", input_take_desc = "Количество (Макс: %s)",
mining_iron = "Добыча железа", mining_silver = "Добыча серебра", mining_gold = "Добыча золота", notify_no_job = "Нет прав", notify_no_fuel = "Нет топлива", notify_started = "Запущено", notify_stopped = "Остановлено", notify_repaired = "Отремонтировано", notify_collected = "Получено %s x%s", notify_inv_full = "Полный", notify_broken = "Сломано", notify_complete = "Завершено", } } |