All Activity
- Yesterday
-
mccode-v2 Con-airline, A Mccodes Based Airline Management Game
peterisgb replied to peterisgb's topic in Game Projects
I have been putting my effort into something else i enjoy alot more working on i have decided to release Con-Airline on github opensource. As much as i like the airline concept, i'm not really a plane person. https://github.com/Peterisgb/Con-Airline Enjoy. If you wish to take a peek at my current project then you can find it in my sig. Any good changes made on github, i am more than happy to throw it into the live game. Here is a pic of my current project. -
SwiftGameR started following Reddit Avertising
-
is that built from gl to look like torn or rebuilt from scratch using old rc engine? Whatever it is iv not registered but looked at screenshots and damn looks amazing π
- Last week
-
crime.fm, it isn't fully release
- Earlier
-
We ran adds through reddit and it out performed meta etc by quite the margin. ill see if i can get some numbers
-
jumpnjump changed their profile photo
-
i am the big hater of : global $db, $set;
-
onlinesafetytraining changed their profile photo
-
Never ran ads on reddit but have posted on the pbbg and webgames subreddits which have still to this day been the #1 player bringer Ads have been a pretty big dud in general but I'm probably just bad at creating attractive ads. 99.99% of my impressions were from one country and after some research were all bots. Just click farming costing me money. That was about a $300 experiment. Meta and Google ads
-
Anyone ran ads through them? How much did you spend? Did you gain more players?
-
Hiya Veda changed their profile photo
-
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
-
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 π
-
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 π
-
Magictallguy started following Mccodes Crime Calc %
-
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
-
SwiftGameR started following Mccodes Crime Calc %
-
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
-
Magictallguy started following [GLv2][FREE] Discord
-
For anyone wanting to take this on, you're lookin' at CrateJS to re-wrap
-
velkibaji changed their profile photo
-
sophia changed their profile photo
-
mccode-v2 Con-airline, A Mccodes Based Airline Management Game
peterisgb replied to peterisgb's topic in Game Projects
More to come of course -
mccode-v2 Gang System Revamped [UPDATED: 02/22/2025]
MNG replied to MajikalJoker's topic in Requests & In Production
If you need hosting, feel free to hmu, comes with cPanel -
mccode-v2 Gang System Revamped [UPDATED: 02/22/2025]
SwiftGameR replied to MajikalJoker's topic in Requests & In Production
damn looking like torn factions now good job nd looking forward to seeing this π -
SwiftGameR started following install ? and gRPG v2 paginator error
-
$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
-
https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos
-
mccode-v2 Con-airline, A Mccodes Based Airline Management Game
SwiftGameR replied to peterisgb's topic in Game Projects
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 -
mccode-v2 Con-airline, A Mccodes Based Airline Management Game
peterisgb replied to peterisgb's topic in Game Projects
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 π -
mccode-v2 Con-airline, A Mccodes Based Airline Management Game
SwiftGameR replied to peterisgb's topic in Game Projects
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 -
// 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
-
Cool free plugin but it doesn't work for me at least. Anyone who got this to work?