/* ##################### DYNAMIC MARKET SCRIPT ##################### ### AUTHOR: RYAN TT. ### ### STEAM: www.steamcommunity.com/id/ryanthett ### ### ### ### DISCLAIMER: THIS SCRIPT CAN BE USED ON EVERY SERVER ONLY ### ### WITH THIS HEADER / NOTIFICATION ### ################################################################# */ // ███████████████████████████████████████████████████████████████████████ // █████████████████ DYNAMIC MARKET BASIC CONFIGURATION ██████████████████ // ███████████████████████████████████████████████████████████████████████ DYNMARKET_Serveruptime = 05; // Serveruptime after restart in hours DYNMARKET_UseExternalDatabase = true; // Should the script use the External Database? DYNMARKET_PriceUpdateInterval = 01; // After how many minutes should the price be updated? DYNMARKET_CreateBackups = true; // Should the server save write the prices regulary into the Database? If false, it will save the prices before Server-restart? DYNMARKET_CreateBackupInterval = 03; // After how many updates (PriceUpdateIntervals) should the prices be saved into the Database? DYNMARKET_UserNotification = true; // Should the user be informed with a hint whenever the prices got updated? // █████████████████ USER NOTIFICATION TEXTS █████████████████ DYNMARKET_UserNotification_Text = [ "Your prices have been updated!", "The new prices are being calculated by the server..." ]; // █████████████████ ITEM GROUP CONFIGURATION █████████████████ DYNMARKET_Items_Groups = [ ["Legal", [ ["apple",-1,30,80], ["peach",-1,40,70], ["tbacon",-1,10,40], ["donuts",-1,50,65], ["rabbit_raw",-1,70,125], ["rabbit",-1,85,145], ["salema",-1,35,65], ["salema_raw",-1,30,6], ["ornate_raw",-1,30,50], ["ornate",-1,85,195], ["mackerel_raw",-1,120,215], ["mackerel",-1,95,240], ["tuna_raw",-1,85,155], ["tuna",-1,550,885], ["mullet_raw",-1,180,325], ["mullet",-1,280,565], ["catshark_raw",-1,250,365], ["catshark",-1,350,765], ["turtle_soup",-1,2150,3865], ["turtle_raw",-1,550,865], ["hen_raw",-1,50,75], ["hen",-1,60,95], ["rooster_raw",-1,50,75], ["rooster",-1,70,95], ["sheep_raw",-1,70,135], ["sheep",-1,85,165], ["goat_raw",-1,85,165], ["goat",-1,95,195], ["redgull",-1,180,225], ["coffee",-1,3,7], ["waterBottle",-1,3,7], ["pickaxe",-1,340,360], ["fuelFull",-1,460,575], ["spikeStrip",-1,1100,1285], ["lockpick",-1,65,85], ["goldbar",-1,75000,11500], ["blastingcharge",-1,7450,13500], ["boltcutter",-1,850,1160], ["defusekit",-1,1750,2235], ["storagesmall",-1,45000,65000], ["storagebig",-1,105000,142000], ["oil_processed",-1,2450,4150], ["copper_refined",-1,1250,1950], ["iron_refined",-1,2650,3865], ["salt_refined",-1,990,1965], ["glass",-1,990,1965], ["diamond_cut",-1,1350,3465], ["Pommes",-1,50,75], ["BeefBurger",-1,105,185] ], 0.5 ], ["Illegal", [ ["heroin_processed",-1,1650,3450], ["marijuana",-1,1450,3150], ["cocaine_processed",-1,3650,5850], ["Bier",-1,1050,2150], ["Wein",-1,865,1950], ["FaultierGeh",-1,1250,3450] ], 0.5 ] ]; // █████████████████ ALL SELLABLE ITEMS █████████████████ DYNMARKET_Items_ToTrack = [ ["apple",50], ["peach",55], ["tbacon",25], ["donuts",60], ["rabbit_raw",95], ["rabbit",115], ["salema",55], ["salema_raw",45], ["ornate_raw",40], ["ornate",150], ["mackerel_raw",175], ["mackerel",200], ["tuna_raw",100], ["tuna",700], ["mullet_raw",250], ["mullet",400], ["catshark_raw",300], ["catshark",500], ["turtle_soup",3000], ["turtle_raw",750], ["hen_raw",65], ["hen",85], ["rooster_raw",65], ["rooster",85], ["sheep_raw",95], ["sheep",115], ["goat_raw",115], ["goat",135], ["redgull",200], ["coffee",5], ["waterBottle",5], ["pickaxe",350], ["fuelFull",500], ["spikeStrip",1200], ["lockpick",75], ["goldbar",95000], ["blastingcharge",10000], ["boltcutter",1000], ["defusekit",2000], ["storagesmall",50000], ["storagebig",125000], ["oil_processed",3200], ["copper_refined",1500], ["iron_refined",3200], ["salt_refined",1450], ["glass",1450], ["diamond_cut",2000], ["cement",1950], ["heroin_processed",2560], ["marijuana",2350], ["cocaine_processed",5000], ["Bier",1420], ["Wein",1120], ["FaultierGeh",2150], ["Pommes",145], ["BeefBurger",265] ]; //███████████████████████████████████████████████████████████████████████ //██████████████████ DO NOT MODIFY THE FOLLOWING CODE! ██████████████████ //███████████████████████████████████████████████████████████████████████ DYNMARKET_Items_CurrentPriceArr = []; DYNMARKET_sellarraycopy = DYNMARKET_Items_ToTrack; DYNMARKET_Serveruptime = (DYNMARKET_Serveruptime * 3600) - 300; { _currentArray = _x; DYNMARKET_Items_CurrentPriceArr pushBack [_currentArray select 0,_currentArray select 1,0]; } forEach DYNMARKET_Items_ToTrack; publicVariable "DYNMARKET_UserNotification"; publicVariable "DYNMARKET_UserNotification_Text"; if (DYNMARKET_UseExternalDatabase) then {[1] call TON_fnc_HandleDB;}; DYNMARKET_UpdateCount = 0; if (DYNMARKET_UseExternalDatabase) then { [] spawn { sleep DYNMARKET_Serveruptime; diag_log "### DYNMARKET >> Aktuelle Preise werden übermittelt ###"; diag_log "### DYNMARKET >> Preisberechnung wird erwartet... ###"; [0] call TON_fnc_HandleDB; }; }; sleep 5; [] call TON_fnc_sleeper;