Jump to content
MakeWebGames

All Activity

This stream auto-updates

  1. Last week
  2. yeah easy stuff just did wat a person needed who didn't understand success formulas but you made it better just somegames use boostes kike torn so i dd max anyways
  3. I didn't add any >100 formatting, but that'd be easy enough. Hell, I might even update to use a checkbox for it so users can see the direct value if they need to, or just a "yup, this is guaranteed" output. Go sick πŸ˜„
  4. That was my next step but damn you went all out that looks amazing i just did mine raw html with a jquery function but your kicked it up a whole lot πŸ˜„ whatever.html <h1>Mccodes Crime Chance Calculator</h1> <p> This was written in html css and jquery to calculate the success rates based on the users level and there will. </p> <table class='table' style='text-align: center; width: 40%;' cellspacin='1' cellpadding='1'> <tr> <th>Users Level</th> <th>Users Will</th> </tr> <tr> <td><label for='level'>Level:</label></td> <td><input type='number' min='1' value='1' max='100' id='level' required /></td> </tr> <tr> <td><label for='will'>Will:</label></td> <td><input type='number' min='1' value='100' max='99999' id='will' required /></td> </tr> <tr><td colspan='2'><input type='sumbit' id='btnclick' value='Find Percentage' /></td></tr> </table> <table class='table' style='margin-top: 10px; text-align: center; width: 40%; height: auto;'> <tr><th>Result</th></tr> <tr><td><span id='result'></span></td></tr> </table> I wrote a little bit extra that i was planning on implentnting into if people were to use on there game. so if enter over 1000 into the box it just jumps back to max level which is currently set in the jquery but i will test yours as soon as get a server running again 😞 $(document).ready(function() { $('#btnclick').click(function() { let level = $('#level').val() let will = $('#will').val() let crimeSuccess = calcChance(will, level) crimeSuccess = crimeSuccess > 100 ? 100 : crimeSuccess console.log('logged chance rate at ' + crimeSuccess) $('#result').text(crimeSuccess) }) $('#level').keyup(function() { const maxLevel = 100; let levelcheck = $('#level').val() if (levelcheck > 100) { $('#level').val(maxLevel) } }) $('#will').keyup(function() { const maxWill = 99999; let willcheck = $('#will').val() if (willcheck > 100) { $('#will').val(maxWill) } }) // Value 1 is there level and value2 is there will function calcChance(value1, value2) { if (value1 && value2) { let result = ((value2 * 0.8) / 2.5) + (value1 / 4) result = result > 100 ? 100 : result return result + '%' } } }) also i added checks to make sure not over 100% will deffo play around with yours πŸ˜›
  5. I really like the ability to visualise how the crime formulae may result; so I took your idea and added the ability to select from an existing crime, or assume the default formula ((WILL*0.8)/2.5)+(LEVEL/4) and calculate as desired. I also stripped the jQuery dependence; pure vanilla JS, woo! Fair note to our more sensitive-eyed programmers; there's no dark mode by default. Note: Written in a PHP8.4 environment. Older versions may need to change the match() call to a switch() equivalent crime-formula.php <?php declare(strict_types=1); $_GET['action'] ??= null; $_GET['id'] = array_key_exists('id', $_GET) && is_numeric($_GET['id']) && (int)$_GET['id'] > 0 ? (int)$_GET['id'] : null; class CrimeFormula { private static ?self $inst = null; private ?database $db; private ?array $settings; /** * @param database $db * @param array $settings */ public function __construct(database $db, array $settings) { $this->db = $db; $this->settings = $settings; $this->run(); } /** * @return void */ private function run(): void { $response = match ($_GET['action']) { 'get-crime-by-id' => $this->getCrimeById($_GET['id']), default => [ 'type' => 'error', 'message' => 'No action given', ], }; if ($this->isAjax()) { header('Content-type: application/json'); echo json_encode($response); exit; } if (array_key_exists('location', $response)) { header('Location: ' . $response['location']); exit; } echo $this->template('crime-select', [ '%id%' => $_GET['id'], '%menu.opts:crimes%' => $this->renderMenuOptsCrimes($_GET['id']), ]); } /** * @param int|null $id * * @return array|null */ private function getCrimeById(?int $id): ?array { if (empty($id)) { return null; } $get_crime = $this->db->query( 'SELECT * FROM crimes WHERE crimeID = ' . $id . ' LIMIT 1', ); $row = $this->db->fetch_row($get_crime); $this->db->free_result($get_crime); return $row ?? null; } /** * @return bool */ private function isAjax(): bool { return array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest'; } /** * @param string $fileName * @param array $replacements * * @return string|null */ private function template(string $fileName, array $replacements = []): ?string { $path = str_replace('/', DIRECTORY_SEPARATOR, __DIR__ . '/' . $fileName . '.html'); if (!file_exists($path)) { return null; } $content = file_get_contents($path); return strtr($content, $replacements); } /** * @param int|null $selected * * @return string */ private function renderMenuOptsCrimes(?int $selected = null): string { $ret = ''; $rows = $this->db->query( 'SELECT crimeID, crimeNAME, crimeBRAVE FROM crimes ORDER BY crimeBRAVE', ); while ($row = $this->db->fetch_row($rows)) { $ret .= sprintf( '<option value="%u" %s>%s [%s brave]</option>%s', $row['crimeID'], (int)$row['crimeID'] === $selected ? 'selected' : '', stripslashes(htmlspecialchars($row['crimeNAME'])), number_format((int)$row['crimeBRAVE']), PHP_EOL, ); } $this->db->free_result($rows); return $ret; } /** * @param database $db * @param array $settings * * @return self|null */ public static function getInstance(database $db, array $settings): ?self { if (self::$inst === null) { self::$inst = new self($db, $settings); } return self::$inst; } } global $db, $set; require_once __DIR__ . '/globals_nonauth.php'; $module = CrimeFormula::getInstance($db, $set); crime-select.html <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Crime Formula Tests</title> </head> <body> <div class="container" style="margin: 0 auto;"> <form id="crime-selection-form" method="get"> <div class="row py-2"> <div class="col"> <div class="form-group"> <label for="crime">Select Crime</label> <select name="crime" id="crime" class="form-control"> <option value="0" selected>--- None ---</option> %menu.opts:crimes% </select> </div> </div> </div> <div class="row py-2"> <div class="col-lg-6 col-md"> <div class="form-group"> <label for="level">Level</label> <input type="number" name="level" id="level" class="form-control" value="1" step="1"> </div> </div> <div class="col-lg-6 col-md"> <div class="form-group"> <label for="will">Will</label> <input type="number" name="will" id="will" class="form-control" value="100" step="1"> </div> </div> </div> </form> </div> <div class="container"> <span class="d-block m-1" id="crime-formula-raw"></span> <span class="d-block m-1" id="crime-formula-formatted"></span> <span class="d-block m-1" id="crime-response"></span> </div> <script> const apiCall = (path) => { return fetch(path, { headers: { 'credentials': 'same-origin', 'X-Requested-With': 'XMLHttpRequest', 'Content-Type': 'application/json' }, signal: AbortSignal.timeout(5000) }); }; const getCrime = (id, callback) => { apiCall(`crime-formula.php?action=get-crime-by-id&id=${id}`) .then(response => response.json()) .then(data => callback(data)); }; const responseElem = document.getElementById("crime-response"); const formulaRawElem = document.getElementById("crime-formula-raw"); const formulaFormattedElem = document.getElementById("crime-formula-formatted"); const updateCrimeInfo = (formula, will, level) => { let formulaFormatted = formula.replace('WILL', will).replace('LEVEL', level); formulaRawElem.innerText = formula; formulaFormattedElem.innerText = formulaFormatted; /* Dirty. Don't do this if you can avoid it. And certainly *never* trust user input with it. */ let amnt = eval(formulaFormatted); responseElem.innerText = amnt.toLocaleString(undefined, {maximumFractionDigits: 3}) + "%"; }; const getCrimeFullEvent = (e) => { e.stopPropagation(); e.preventDefault(); if ([undefined, null].includes(responseElem) || [undefined, null].includes(formulaRawElem) || [undefined, null].includes(formulaFormattedElem)) { console.error("Form element missing: crime-response/crime-formula-raw/crime-formula-formatted"); return; } let will = document.getElementById("will").value; let level = document.getElementById("level").value; let id = document.getElementById("crime").value; if ([undefined, null].includes(will)) { will = 100; } if ([undefined, null].includes(level)) { level = 1; } if ([undefined, null].includes(id)) { id = 0; } let formula = '((WILL*0.8)/2.5)+(LEVEL/4)'; if (id > 0) { getCrime(id, (data) => { if ([undefined, null].includes(data)) { console.error("Blank crime data response"); return false; } if (data.hasOwnProperty("type") && data.type !== "success") { console.error(data); return false; } updateCrimeInfo(data.crimePERCFORM, will, level); return true; }); } else { updateCrimeInfo(formula, will, level); } }; window.addEventListener("DOMContentLoaded", () => { const formElem = document.getElementById("crime-selection-form"); if ([undefined, null].includes(formElem)) { console.error("Form element missing: crime-selection-form"); return; } formElem.addEventListener("keyup", (e) => getCrimeFullEvent(e)); formElem.addEventListener("mouseup", (e) => getCrimeFullEvent(e)); }); </script> </body> </html> 2025-09-22 18-58-18.mp4
  6. Coded from pure html and jquery i only made it on jsfiddle thinking of implementing it into base of staff crimes file for easier viewing. For users who do not understand the formula for crime chance success rates. Enter users level and will and click calculate
  7. For anyone wanting to take this on, you're lookin' at CrateJS to re-wrap
  8. Earlier
  9. If you need hosting, feel free to hmu, comes with cPanel
  10. damn looking like torn factions now good job nd looking forward to seeing this πŸ˜›
  11. $this->querystring is being used before set adding $this->querystring = ''; or mtg works better xD i just couldn't see if it was in class as was going to suggest private ?string $querystring = null; // <-- declaring default null value for the property i have not looked at new version of grpg for while so dunno what exactly changed will need to peek
  12. https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos
  13. haha thats cool and yeah we had shit rain and been pretty cold today Yeah Github can be confusing but trust me do some research when you get free time and play around with it i have some private projects on there
  14. Thats quite a read, I'm still on the debate on github, but i am keeping it in mind. As to the Weather, I have Hourly Weather updates for Real Life weather already in place. Here is a pic of the weather at 9:29PM. Ugh, Rain inbound for the UK πŸ™‚
  15. I used to think that to but you make your project private and you can allow people to push updates which you review them before making any changes torn.com has that many staff members they have there game hosted on github and any developers that make changes to code etc are reviewed by ched or experienced developer etc before its allowed into github and if you configure it properly the update can be pushed to your server as well but this requires ssh keys private and public and linked to your cpanel but to answer the question your project would be safe. If you need help with a file you can just edit it or paste it to me here or discord and i can edit / create it for you but i suggest looking into learning github i learned it from @Magictallguy while working with grpg project and its very handy. i found this https://stackoverflow.com/questions/76094652/can-anyone-upload-changes-and-commit-to-my-github-repository-is-it-is-public From a quick read of that link you can create a private repo and organization which allows users to read you files without being able to steal the code if it helps you πŸ™‚ have you tried using a API to get real time weather? there are probably more out there but here is a example https://open-meteo.com/ this is a open source project i found with a quick google search but here is a github repo for it πŸ˜„ https://github.com/open-meteo/open-meteo Email: [email protected] Discord: em2pro4u
  16. // File: ApiClient.cs // Description: Handles all communication with the VTC website API. using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace StarTruckerLogger { public static class ApiClient { // This URL points to your live website's API endpoint. private static readonly string ApiBaseUrl = "https://startruckervtc.co.uk/api.php"; private static readonly HttpClient client = new HttpClient(); // Stores the logged-in user's session data public static UserSession CurrentUser { get; private set; } public static async Task<LoginResult> LoginAsync(string username, string password) { var credentials = new { action = "login", username, password }; var jsonContent = JsonConvert.SerializeObject(credentials); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { HttpResponseMessage response = await client.PostAsync(ApiBaseUrl, content); string jsonResponse = await response.Content.ReadAsStringAsync(); var result = JsonConvert.DeserializeObject<dynamic>(jsonResponse); if (result.status == "success") { // Store user data upon successful login CurrentUser = new UserSession { UserId = result.data.user_id, Username = result.data.username, VtcId = result.data.vtc_id }; return new LoginResult { Success = true }; } else { return new LoginResult { Success = false, Message = result.message }; } } catch (Exception ex) { return new LoginResult { Success = false, Message = $"API Connection Error: {ex.Message}" }; } } public static async Task<bool> LogJobAsync(string origin, string destination, string cargo, string distance, string pay) { if (CurrentUser == null) return false; // Not logged in var jobData = new { action = "log_job", user_id = CurrentUser.UserId, vtc_id = CurrentUser.VtcId, origin, destination, cargo, distance = double.Parse(distance), pay = double.Parse(pay) }; var jsonContent = JsonConvert.SerializeObject(jobData); var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); try { var response = await client.PostAsync(ApiBaseUrl, content); return response.IsSuccessStatusCode; } catch { return false; } } } public class LoginResult { public bool Success { get; set; } public string Message { get; set; } } public class UserSession { public int UserId { get; set; } public string Username { get; set; } public int VtcId { get; set; } } } // ------------------------------------------------------------ // StarTruckerLogger Β© 2025 by TTVytangelofhype // You are free to modify the code, but not to remove credit, // redistribute under your name, or sell it as your own. // ------------------------------------------------------------ using System; using System.IO; namespace StarTruckerLogger { public static class JobLogger { private static string logFilePath = "latest_job.txt"; public static void LogToFile(string logEntry) { File.AppendAllText(logFilePath, logEntry + Environment.NewLine); } public static string[] ReadAll() { return File.Exists(logFilePath) ? File.ReadAllLines(logFilePath) : new string[] { "No log found." }; } } } // ------------------------------------------------------------ // StarTruckerLogger Β© 2025 by TTVytangelofhype // You are free to modify the code, but not to remove credit, // redistribute under your name, or sell it as your own. // ------------------------------------------------------------ using System; using System.IO; namespace StarTruckerLogger { public static class JobWatcher { private static FileSystemWatcher watcher; public static void StartWatching() { watcher = new FileSystemWatcher { Path = "C:\\Games\\StarTrucker\\logs", Filter = "latest_job.txt", NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size, EnableRaisingEvents = true }; watcher.Changed += OnNewJobLogged; } private static void OnNewJobLogged(object sender, FileSystemEventArgs e) { try { Console.WriteLine($"Watcher triggered: {e.FullPath}"); // Debug Line 1 var content = File.ReadAllText(e.FullPath); Console.WriteLine($"New content: {content}"); // Debug Line 2 if (!string.IsNullOrWhiteSpace(content)) { JobLogger.LogToFile($"[MOD] {DateTime.Now} | {content.Trim()}"); } } catch (Exception ex) { Console.WriteLine("Error in watcher: " + ex.Message); } } } } // File: Program.cs // Description: Main entry point for the application. using System; using System.Windows.Forms; namespace StarTruckerLogger { static class Program { [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Show the login form as a dialog var loginForm = new LoginForm(); if (loginForm.ShowDialog() == DialogResult.OK) { // If login was successful, open the main application window Application.Run(new MainForm()); } // If login fails or is cancelled, the application will exit. } } } some C# work i been doing backend
  17. Cool free plugin but it doesn't work for me at least. Anyone who got this to work?
  18. Added the FAQ page, but stuck on what to add in the FAQ (would like help on what to add in the FAQ) Reset the Google Recaptcha due to me breaking the code again
  19. Project: Disrupted Website: https://disrupted.city/ Discord: https://discord.gg/xFXjPWhW35 Hey everyone, I wanted to share a project I’ve been working for quite some time now. I’m building a new browser-based text game called Disrupted, which is heavily inspired by an old game some of you might remember Zapoco. Zapoco was a unique post-apocalyptic PBBG that sadly shut down, but it left a lasting impression on a lot of players, including me. My aim isn’t to just make a clone, but to revive the spirit while giving it the polish and support it deserves. Eventually, I’ll make the project open-source so the community can help shape its future. (... what tom didn't do) I’m trying to capture the same gritty atmosphere Zapoco had, while expanding on it with more depth (features). That said, I’m still missing a lot: features, settings, and even some of the old scripts are gone. For example, I don’t remember exactly how the safehouse kitchen worked. How could it be upgraded? What were the production ratios? Was it something like 1 tonne of grain = 1 bread? These are details I’d really love to recover from people who played back then. If no one remembers, I’ll have to come up with my own solutions. So if you remember Zapoco β€” its features, ratios, or mechanics β€” please share your knowledge. It would be a huge help in making (or trying) Disrupted feel like the successor to a game many of us loved. Or just want to help build a game, your all welcome πŸ™‚ Greetings
  20. I forgot to mention that the weather maps is updated hourly with irl weather. I do want to use this eventually so make planes go around storms etc or maybe close and airport so it would reflect real Life closures. It's throwing down outside currently. Heavy rain. Checked via Con-airline. Dang rain.
  21. Thanks, I wanted to go in a different direction than most default games. I have and am running again the typical mccodes based game and its always the same thing with different takes. I am looking for help as the code is very complex, But github, I dont understand how that works, benifits etc, Wouldn't that expose all my code to everyone and open for attacks? I've no experience in it. Drop me a mail and we can talk further on said subject. My work and progress on it is slow due to irl commitment with kids. Progress is being made slowly.
  22. Well done peter i have never seen any games that is based on airliners pretty smart πŸ˜‰ Something new and Unique only thing close to this i seen was like Flight Simulator for PC / PS4 XBOX ETC, I am looking forward to see what you decide to do with the project and its final outcome. All you see is Mostly Mafia Games or Crime Games (Used to see Army games prison games Music Battle if i remember right and some Vampire games etc but more ideas out the box like this will surely bring in some members to build their ideas If you're looking for any coding help just give me a shout im experienced in GitHub if its hosted on there i can push updates for you to view before you add πŸ™‚ but all the best.
  23. Just Added Mailbox and Finished Chat.
  24. Good to know. πŸ˜€
  25. btw the forums is licensed and not a illigal copy as i paid a lot for this license
  26. well untill raw furry give us what we want and yes your right but I just thought it be something fun to do to help me get bak in my coding era but we see i know it not ment to be popular that i can work on only if they give us what we need that we request as the game might be low in popurality but it got some steady players on steam small update added forums link to it and tidyed it up coding wise to make it neater
  1. Load more activity
×
×
  • Create New...