Config Preview
Dream Wind Turbinesโ
DreamCore.lua
DreamLocales = {} -- Do not touch this!!!
DreamFramework = {} -- Do not touch this!!!
DreamCore = {} -- Do not touch this!!!
-- Dream Wind Turbines Settings
DreamCore.Language = 'en'
DreamCore.GiveCredits = true -- Set to false if you don't want to give credits
DreamCore.Blip = {
    available = {
        show = true,
        sprite = 354,
        scale = 0.8,
        color = 0
    },
    owned = {
        show = true,
        sprite = 354,
        scale = 1.0,
        color = 26
    },
    unavailable = {
        show = true,
        sprite = 354,
        scale = 0.6,
        color = 1
    }
}
DreamCore.Commands = {
    createWindTurbineCommand = 'createwindturbine',
    calculateWindTurbineProfitCommand = 'calculatewindturbineprofit' -- โ ๏ธ Be careful!
}
DreamCore.WindSystem = {
    speed = { 1, 20 }, -- Wind Speed in m/s | min - max | light breeze (~3 m/s) to strong wind (~20 m/s)
    maxChange = 0.2, -- Max change in wind speed per interval
    chanceToChangeTrend = 5, -- 5% chance to change wind speed per interval
    interval = 5 * 1000, -- Interval in ms
}
DreamCore.WindTurbines = {
    compact = {
        kwh = 3, -- kwH per minute on 1 m/s wind speed -> kwh * wind speed = kwh per minute | e.g. 3 kwh * 6 m/s = 18 kwh per minute
        feePerMWh = 30, -- Fee per mwh in $ (Dollar)
        breakChance = 5, -- 5% chance to break chance
        repairCost = 500, -- Cost to repair the wind turbine
        upgrades = {
            -- โ ๏ธ Important: Calculate your upgrade benefit! If you have a break chance of 5% and your benefits decrease 6%, it can't be brake anymore/anytime!
            ['efficiency_blades'] = {
                name = 'Efficiency Blades',
                description = 'Upgrade the blades for better efficiency.',
                worth = 3500,
                needed = {
                    price = 2500,
                    ownershipTime = 12 * 60 * 60 * 1000, -- 12h
                    items = {
                        { name = 'carbon_fiber', label = 'Carbonfiber', amount = 4 },
                        { name = 'lubricant',    label = 'Lubricant',   amount = 2 }
                    }
                },
                benefit = {
                    kwh = 2,
                    breakChance = 1
                }
            },
            ['reinforced_gearbox'] = {
                name = 'Reinforced Gearbox',
                description = 'Upgrade the gearbox for better durability.',
                worth = 4500,
                needed = {
                    price = 3500,
                    ownershipTime = 24 * 60 * 60 * 1000,
                    items = {
                        { name = 'steel', label = 'Steel', amount = 8 },
                        { name = 'gear',  label = 'Gear',  amount = 3 }
                    }
                },
                benefit = {
                    kwh = 0,
                    breakChance = 1
                }
            },
            ['smart_control_unit'] = {
                name = 'Smart Control Unit',
                description = 'Install a smart control unit for better monitoring.',
                worth = 6500,
                needed = {
                    price = 5000,
                    ownershipTime = 36 * 60 * 60 * 1000,
                    items = {
                        { name = 'circuit_board', label = 'Circuit Board', amount = 5 },
                        { name = 'microchip',     label = 'Microchip',     amount = 3 }
                    }
                },
                benefit = {
                    kwh = 1,
                    breakChance = 2
                }
            },
            ['high_torque_motor'] = {
                name = 'High Torque Motor',
                description = 'Upgrade the motor for higher torque and efficiency.',
                worth = 10000,
                needed = {
                    price = 8000,
                    ownershipTime = 48 * 60 * 60 * 1000,
                    items = {
                        { name = 'motor',        label = 'Motor',       amount = 2 },
                        { name = 'copper',       label = 'Copper',      amount = 10 },
                        { name = 'carbon_fiber', label = 'Carbonfiber', amount = 6 }
                    }
                },
                benefit = {
                    kwh = 5,
                    breakChance = 0
                }
            },
            ['weather_shield'] = {
                name = 'Weather Shield Coating',
                description = 'Protects the turbine from weather damage, extending lifespan.',
                worth = 5000,
                needed = {
                    price = 4000,
                    ownershipTime = 24 * 60 * 60 * 1000,
                    items = {
                        { name = 'protective_coating', label = 'Protective Coating', amount = 2 },
                        { name = 'resin',              label = 'Resin',              amount = 4 }
                    }
                },
                benefit = {
                    kwh = 0,
                    breakChance = 1
                }
            }
        }
    },
    industrial = {
        kwh = 5, -- kwH per minute on 1 m/s wind speed -> kwh * wind speed = kwh per minute | e.g. 3 kwh * 6 m/s = 18 kwh per minute
        feePerMWh = 30, -- Fee per mwh in $ (Dollar)
        breakChance = 7, -- 7% chance to break chance
        repairCost = 1500, -- Cost to repair the wind turbine
        upgrades = {
            -- โ ๏ธ Important: Calculate your upgrade benefit! If you have a break chance of 5% and your benefits decrease 6%, it can't be brake anymore/anytime!
            ['titanium_blades'] = {
                name = 'Titanium Blades',
                description = 'Lightweight and strong blades for optimal wind capture.',
                worth = 12000,
                needed = {
                    price = 9500,
                    ownershipTime = 48 * 60 * 60 * 1000,
                    items = {
                        { name = 'titanium',  label = 'Titanium',  amount = 6 },
                        { name = 'lubricant', label = 'Lubricant', amount = 4 }
                    }
                },
                benefit = {
                    kwh = 5,
                    breakChance = 1
                }
            },
            ['magnetic_gearbox'] = {
                name = 'Magnetic Gearbox',
                description = 'Reduces friction using magnetic levitation.',
                worth = 10000,
                needed = {
                    price = 8000,
                    ownershipTime = 36 * 60 * 60 * 1000,
                    items = {
                        { name = 'magnet', label = 'Magnet', amount = 8 },
                        { name = 'steel',  label = 'Steel',  amount = 6 }
                    }
                },
                benefit = {
                    kwh = 2,
                    breakChance = 2
                }
            },
            ['wind_tunnel_optimization'] = {
                name = 'Wind Tunnel Optimization',
                description = 'Aerodynamic adjustments to maximize wind flow.',
                worth = 14000,
                needed = {
                    price = 11000,
                    ownershipTime = 72 * 60 * 60 * 1000,
                    items = {
                        { name = 'aero_panel',   label = 'Aero Panel',  amount = 5 },
                        { name = 'carbon_fiber', label = 'Carbonfiber', amount = 4 }
                    }
                },
                benefit = {
                    kwh = 6,
                    breakChance = 0
                }
            },
            ['heat_resistant_motor'] = {
                name = 'Heat Resistant Motor',
                description = 'Motor withstands higher temperatures, reducing wear.',
                worth = 13000,
                needed = {
                    price = 10000,
                    ownershipTime = 48 * 60 * 60 * 1000,
                    items = {
                        { name = 'heat_alloy', label = 'Heat Alloy', amount = 4 },
                        { name = 'motor',      label = 'Motor',      amount = 2 }
                    }
                },
                benefit = {
                    kwh = 3,
                    breakChance = 4
                }
            }
        }
    },
    mega = {
        kwh = 8, -- kwH per minute on 1 m/s wind speed -> kwh * wind speed = kwh per minute | e.g. 3 kwh * 6 m/s = 18 kwh per minute
        feePerMWh = 30, -- Fee per mwh in $ (Dollar)
        breakChance = 6, -- 6% chance to break chance
        repairCost = 500, -- Cost to repair the wind turbine
        upgrades = {
            -- โ ๏ธ Important: Calculate your upgrade benefit! If you have a break chance of 5% and your benefits decrease 6%, it can't be brake anymore/anytime!
            ['diamond_blades'] = {
                name = 'Diamond-Tipped Blades',
                description = 'Unmatched durability and wind cutting power.',
                worth = 30000,
                needed = {
                    price = 25000,
                    ownershipTime = 96 * 60 * 60 * 1000,
                    items = {
                        { name = 'diamond_tip', label = 'Diamond Tip', amount = 6 },
                        { name = 'titanium',    label = 'Titanium',    amount = 10 }
                    }
                },
                benefit = {
                    kwh = 4,
                    breakChance = 1
                }
            },
            ['quantum_control_core'] = {
                name = 'Quantum Control Core',
                description = 'Optimizes every rotation using quantum computing.',
                worth = 40000,
                needed = {
                    price = 32000,
                    ownershipTime = 120 * 60 * 60 * 1000,
                    items = {
                        { name = 'quantum_chip',  label = 'Quantum Chip',  amount = 4 },
                        { name = 'circuit_board', label = 'Circuit Board', amount = 10 }
                    }
                },
                benefit = {
                    kwh = 5,
                    breakChance = 2
                }
            },
            ['zero_friction_system'] = {
                name = 'Zero-Friction Drive System',
                description = 'Eliminates mechanical wear with advanced magnetic systems.',
                worth = 35000,
                needed = {
                    price = 28000,
                    ownershipTime = 96 * 60 * 60 * 1000,
                    items = {
                        { name = 'magnet',       label = 'Magnet',       amount = 12 },
                        { name = 'nano_coating', label = 'Nano Coating', amount = 6 }
                    }
                },
                benefit = {
                    kwh = 4,
                    breakChance = 3
                }
            },
            ['storm_harvester_mode'] = {
                name = 'Storm Harvester Mode',
                description = 'Allows operation in extreme wind conditions for huge gains.',
                worth = 45000,
                needed = {
                    price = 35000,
                    ownershipTime = 144 * 60 * 60 * 1000,
                    items = {
                        { name = 'reinforced_frame', label = 'Reinforced Frame', amount = 8 },
                        { name = 'heat_alloy',       label = 'Heat Alloy',       amount = 6 }
                    }
                },
                benefit = {
                    kwh = 10,
                    breakChance = 0
                }
            }
        }
    }
}
DreamCore.MaxWindTurbinesOwnerPerPlayer = 3 -- Max Wind Turbines per player (0 = Unlimited)
DreamCore.MaxWindTurbinesProfitDepot = 100000 -- Max Profit in depot per Wind Turbine (0 = Unlimited)
DreamCore.CalculateProfitInterval = 30 * 60 * 1000 -- 30 Minutes in ms (Profit will be calculated every 30 minutes)
DreamCore.MWhPrice = 40 -- Price per MWh in $ (Dollar) | 1 MWh = 1000 kWh
DreamCore.CalculateTransactionDate = function(Timestamp)
    return os.date('%d.%m.%Y %H:%M', Timestamp / 1000)
end
DreamCore.GenerateTransactionIncomeId = function()
    return 'T' .. math.random(100000, 999999)
end
DreamCore.GenerateTransactionOutcomeId = function()
    return 'T' .. math.random(100000, 999999)
end
DreamCore.GenerateTransactionPayoutId = function()
    return 'P' .. math.random(100000, 999999)
end
DreamCore.CalculateWindTurbineWorth = function(WindTurbinePrice)
    return math.floor(WindTurbinePrice / 2)
end
DreamCore.Target = function()
    if GetResourceState('ox_target') == 'started' then
        return 'ox'
    elseif GetResourceState('qb-target') == 'started' then
        return 'qb'
    else
        return error('No target system found! Please adjust DreamCore.Target!!!')
    end
end
DreamCore.Notify = function(text, type, duration)
    -- Always clientside
    -- Params:
    -- text: message: string
    -- type: info, success, warning, error
    -- duration: time in ms
    -- Default Values
    local type = type or 'info'
    local duration = duration or 5000
    -- Ox Notification (ox_lib)
    lib.notify({
        type        = type,
        position    = 'center-right',
        title       = DreamLocales[DreamCore.Language]['NotifyHeader'],
        description = text,
        duration    = duration
    })
end
DreamCoreExt.lua
DreamCore.Webhooks = {
    Enabled = true,
    -- Base Data
    Color = '10169855', -- Change the Color of the Webhook
    Author = 'Dream Wind Turbines', -- Change the Author of the Webhook
    IconURL = 'https://i.imgur.com/vDc2B6l.png', -- Change the IconURL of the Webhook
    -- Webhook URLs
    BuyWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    SellWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    TransferWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    ChangeStatusWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    RepairWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    UpgradeWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    CollectProfitWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    CalculateProfitWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
    BrokeWindTurbine = 'https://canary.discord.com/api/webhooks/XXX/XXX',
}
Dream Wind Turbines Localesโ
Reminder: You can create your own locale file in your language ๐
en.lua
DreamLocales['en'] = {
    ['NotifyHeader'] = 'Wind Turbines',
    ['WindTurbineBlipName'] = {
        ['compact'] = 'Wind Turbine [Compact]',
        ['industrial'] = 'Wind Turbine [Industrial]',
        ['mega'] = 'Wind Turbine [Mega]',
    },
    ['WindTurbineTypes'] = {
        ['compact'] = 'Compact',
        ['industrial'] = 'Industrial',
        ['mega'] = 'Mega',
    },
    ['WindTurbineCreated'] = 'Wind Turbine created',
    ['WindTurbineNotCreated'] = ' Wind Turbine not created',
    ['WindTurbineHelpUI'] = {
        ['Available'] = '[E] - See wind turbine information',
        ['Owned'] = '[E] - Manage wind turbine'
    },
    ['WindTurbineBroke'] = 'We have been informed that a wind turbine (#%s) has stopped working. Try to repair it!',
    ['BuyWindTurbine'] = {
        ['Title'] = 'โก Wind Turbine #%s',
        ['Options'] = {
            ['Type'] = {
                ['Title'] = 'Type: %s'
            },
            ['Price'] = {
                ['Title'] = 'Price: %s$'
            },
            ['Buy'] = {
                ['Title'] = 'Buy Wind Turbine',
                ['Description'] = 'Do you want to buy this wind turbine?'
            }
        },
        ['Success'] = 'Wind Turbine bought successfully!',
        ['Errors'] = {
            ['Unknown'] = 'Unknown Wind Turbine',
            ['Unavailable'] = 'Wind Turbine unavailable',
            ['UnknownPlayer'] = 'Your Player Data are invalid',
            ['MaxWindTurbines'] = 'You have already reached the maximum wind turbines',
            ['InsufficientMoney'] = 'You have not enough money',
        }
    },
    ['ManageWindTurbine'] = {
        ['Title'] = 'โก Wind Turbine #%s',
        ['Options'] = {
            ['Status'] = {
                ['Title'] = 'Status: %s',
                ['States'] = {
                    ['Active'] = 'Active',
                    ['Inactive'] = 'Inactive',
                    ['Broken'] = 'Broken'
                }
            },
            ['Wind'] = {
                ['Title'] = 'Wind: %s m/s'
            },
            ['ViewProduction'] = {
                ['Title'] = 'View Production',
                ['Description'] = 'See your current production',
                ['Options'] = {
                    ['Kwh'] = {
                        ['Title'] = 'Kwh: %s each 1 m/s',
                        ['Description'] = 'Base energy production rate in kWh per 1 m/s'
                    },
                    ['CurrentKwh'] = {
                        ['Title'] = 'Current Kwh: %s/minute',
                        ['Description'] = 'Amount currently generated per minute (in kWh)'
                    },
                    ['CurrentIncome'] = {
                        ['Title'] = 'Current Income: %s$/minute',
                        ['Description'] = 'Estimated income generated per minute'
                    },
                    ['CurrentOutcome'] = {
                        ['Title'] = 'Current Outcome: %s$/minute',
                        ['Description'] = 'Operational costs per minute'
                    },
                    ['CurrentProfit'] = {
                        ['Title'] = 'Current Profit: %s$/minute',
                        ['Description'] = 'Net profit per minute after subtracting all costs'
                    },
                    ['BreakChance'] = {
                        ['Title'] = 'Break Chance: %s%%',
                        ['Description'] = 'Probability of experiencing a breakdown'
                    }
                }
            },
            ['ViewFinancial'] = {
                ['Title'] = 'View Financial',
                ['Description'] = 'See your current financial status',
                ['Options'] = {
                    ['Revenue'] = {
                        ['Title'] = 'Revenue: %s$'
                    },
                    ['Bills'] = {
                        ['Title'] = 'Bills: %s$'
                    },
                    ['Profit'] = {
                        ['Title'] = 'Profit: %s$'
                    },
                    ['CollectProfit'] = {
                        ['Title'] = 'Collect Profit',
                        ['Description'] = 'Pay your bill and collect your profit',
                        ['Success'] = 'You have successfully collect %s$',
                        ['Errors'] = {
                            ['Unknown'] = 'Unknown Wind Turbine',
                            ['UnknownPlayer'] = 'Your Player Data are invalid',
                            ['InsufficientProfit'] = 'You have not enough profit',
                        }
                    },
                }
            },
            ['ViewTransaction'] = {
                ['Title'] = 'View Transactions',
                ['Description'] = 'See your current transactions',
                ['Options'] = {
                    ['NoTransaction'] = {
                        ['Title'] = 'No Transaction',
                        ['Description'] = 'There are no transactions available for your wind turbine'
                    },
                    ['Income'] = {
                        ['Title'] = '#%s - %s$',
                        ['Description'] = 'Date: %s',
                    },
                    ['Outcome'] = {
                        ['Title'] = '#%s - %s$',
                        ['Description'] = 'KWh: %s | Date: %s',
                    }
                }
            },
            ['ViewUpgrades'] = {
                ['Title'] = 'View Upgrades',
                ['Description'] = 'View and manage your wind turbine upgrades',
                ['Options'] = {
                    ['NoUpgrades'] = {
                        ['Title'] = 'No Upgrades',
                        ['Description'] = 'There are no upgrades available for your wind turbine'
                    },
                    ['Metadata'] = {
                        ['Kwh'] = {
                            ['Title'] = 'โก Kwh',
                            ['Description'] = '+%s per 1 m/s'
                        },
                        ['BreakChance'] = {
                            ['Title'] = '๐จ Break Chance',
                            ['Description'] = '-%s%%'
                        }
                    },
                    ['Requirements'] = {
                        ['Money'] = {
                            ['Title'] = 'Money: %s/%s (%s%%)'
                        },
                        ['Ownership'] = {
                            ['Title'] = 'Ownertime: %s/%s (%s%%)',
                            ['Hours'] = '%s Hours'
                        },
                        ['Items'] = {
                            ['Title'] = 'Items: %s/%s (%s%%)',
                            ['Metadata'] = {
                                ['Requirements'] = '๐ฆ Requirements'
                            }
                        },
                        ['BuyUpgrade'] = {
                            ['Title'] = 'Buy Upgrade',
                            ['Description'] = 'Buy and implement the upgrade',
                            ['ProgressBar'] = 'Upgrading wind turbine...',
                            ['Success'] = 'The wind turbine upgrade %s was installed successfully!',
                            ['Errors'] = {
                                ['Unknown'] = 'Unknown Wind Turbine',
                                ['UnknownPlayer'] = 'Your Player Data are invalid',
                                ['UnknownUpgrade'] = 'Unknown upgrade for your current wind turbine',
                                ['AlreadyInstalled'] = 'Already installed this upgrade to your current wind turbine',
                                ['NotEnoughRequirements'] = 'You do not meet the requirements to install this upgrade'
                            }
                        }
                    }
                }
            },
            ['ViewAdministration'] = {
                ['Title'] = 'Administrate Wind Turbine',
                ['Description'] = 'Administrate your wind turbine',
                ['Options'] = {
                    ['Status'] = {
                        ['Activate'] = {
                            ['Title'] = 'Activate Wind Turbine',
                            ['Description'] = 'Activate your wind turbine',
                            ['Success'] = 'Wind Turbine activated successfully!',
                        },
                        ['Deactivate'] = {
                            ['Title'] = 'Deactivate Wind Turbine',
                            ['Description'] = 'Deactivate your wind turbine',
                            ['Success'] = 'Wind Turbine deactivated successfully!',
                        },
                        ['Errors'] = {
                            ['UnknownWindTurbine'] = 'Unknown Wind Turbine',
                            ['UnknownPlayer'] = 'The player is not online!',
                            ['WindTurbineBroken'] = 'Your wind turbine is broken, you need to repair it first',
                        }
                    },
                    ['Repair'] = {
                        ['Title'] = 'Repair Wind Turbine',
                        ['Description'] = 'Repair your wind turbine if broken',
                        ['ProgressBar'] = 'Repairing wind turbine...',
                        ['Success'] = 'Wind Turbine repaired successfully!',
                        ['Errors'] = {
                            ['UnknownWindTurbine'] = 'Unknown Wind Turbine',
                            ['UnknownPlayer'] = 'The player is not online!',
                            ['WindTurbineNotBroken'] = 'Your wind turbine is not broken',
                            ['InsufficientMoney'] = 'You have not enough money',
                        }
                    },
                    ['Transfer'] = {
                        ['Title'] = 'Transfer Wind Turbine',
                        ['Description'] = 'Transfer your wind turbine to another player',
                        ['Input'] = {
                            ['Title'] = 'โก Transfer Wind Turbine #%s',
                            ['Fields'] = {
                                ['PlayerId'] = {
                                    ['Title'] = 'Player ID',
                                    ['Description'] = 'Enter the Player ID of the player you want to transfer the wind turbine to'
                                }
                            },
                        },
                        ['Success'] = 'Wind Turbine transferred successfully!',
                        ['Errors'] = {
                            ['OwnTarget'] = 'You cannot transfer the wind turbine to yourself',
                            ['UnknownWindTurbine'] = 'Unknown Wind Turbine',
                            ['UnknownPlayer'] = 'The player is not online!'
                        }
                    },
                    ['Sell'] = {
                        ['Title'] = 'Sell Wind Turbine',
                        ['Description'] = 'Sell your wind turbine',
                        ['Dialog'] = {
                            ['Title'] = 'โก Sell Wind Turbine #%s',
                            ['Description'] = 'Do you want to sell wind turbine #%s for %s$?',
                        },
                        ['Success'] = 'Wind Turbine sold successfully!',
                        ['Errors'] = {
                            ['UnknownWindTurbine'] = 'Unknown Wind Turbine',
                            ['UnknownPlayer'] = 'Your Player Data are invalid',
                            ['OpenTransaction'] = 'You have a open transaction',
                        }
                    }
                }
            },
        },
        ['Errors'] = {
            ['Unknown'] = 'Unknown Wind Turbine',
        }
    }
}