0% found this document useful (0 votes)
6 views3 pages

GeoFS Flight Logger Script

The GeoFS Flight Logger is a userscript that logs flight details by prompting pilots to manually enter ICAO codes for departure and arrival airports. It sends flight reports to a specified Discord webhook, including information such as flight duration, aircraft type, and landing quality. The script monitors the flight status and resets after logging the landing details.

Uploaded by

bhavikjain2023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

GeoFS Flight Logger Script

The GeoFS Flight Logger is a userscript that logs flight details by prompting pilots to manually enter ICAO codes for departure and arrival airports. It sends flight reports to a specified Discord webhook, including information such as flight duration, aircraft type, and landing quality. The script monitors the flight status and resets after logging the landing details.

Uploaded by

bhavikjain2023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

// ==UserScript==

// @name GeoFS Flight Logger


// @namespace [Link]
// @version 2025-07-17
// @description Logs flights for every airport by asking the pilot to enter ICAO
codes manually
// @match [Link]
// @match [Link]
// @run-at document-end
// @grant none
// ==/UserScript==

(function () {
'use strict';

const WEBHOOK_URL =
"[Link]
SSfFVN4JqK9-nEdGfJ6BI5o39XIbf5Zdi0Sav3w";

let flightStarted = false;


let flightStartTime = null;
let departureICAO = "UNKNOWN";
let arrivalICAO = "UNKNOWN";
let hasLanded = false;

const pilotName = prompt(" Enter your pilot name or callsign:") ||


"UnknownPilot";

function sendLogToDiscord(data) {
const aircraftType = prompt(" Enter your aircraft type (e.g., A320, B738,
C172):") || "Unknown Aircraft";
const now = new Date();
const options = { timeZone: "Europe/London", day: '2-digit', month: 'short',
year: 'numeric', hour: '2-digit', minute: '2-digit', hour12: false };
const timestamp = new [Link]('en-GB', options).format(now);
const takeoffTime = new [Link]('en-GB', options).format(new
Date([Link]));
const landingTime = new [Link]('en-GB', options).format(new
Date([Link]));

const message = {
content: `🧾 **Flight Report - GeoFS**
**✈️Flight Number and operator**: ${[Link]}
** Aircraft**: ${aircraftType}
**📍Departure**: ${[Link]}
**🛬 Arrival**: ${[Link]}
**Flight Time**: ${[Link]} mins
**📉V/S**: ${[Link]} fpm | **G-Force**: ${[Link]}
**⚙️TAS**: ${[Link]} kts | **GS**: ${[Link]} kts
**🏁Landing**: ${[Link]}
**🕓 Takeoff Time**: ${takeoffTime} BST
**🕓 Landing Time**: ${landingTime} BST`
};

if (WEBHOOK_URL) {
fetch(WEBHOOK_URL, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: [Link](message)
}).then(r => [Link]("✅ Flight log sent"))
.catch([Link]);
} else {
[Link]("📋 Flight log:", [Link]);
}
}

function monitorFlight() {
if (!geofs?.animation?.values || [Link]()) return;

const values = [Link];


const onGround = [Link];
const altitude = [Link];

// Start
if (!flightStarted && !onGround && altitude > 200) {
flightStarted = true;
flightStartTime = [Link]();
departureICAO = prompt("📍 Enter ICAO of departure airport:") || "UNKNOWN";
[Link](`🛫 Departure: ${departureICAO}`);
}

// End
if (flightStarted && onGround && !hasLanded && [Link] < 1) {
const confirmEnd = confirm("✈️ Aircraft has come to a full stop. Do you want
to end the flight?");
if (!confirmEnd) return;
hasLanded = true;
const durationMin = [Link](([Link]() - flightStartTime) / 60000);
arrivalICAO = prompt("📍 Enter ICAO of arrival airport:") || "UNKNOWN";
const vs = [Link](1);
const g = ([Link] / 9.80665).toFixed(2);
const gs = [Link](1);
const tas = [Link](1);
const quality = (vs > -60) ? "BUTTER" : (vs > -800) ? "HARD" : "CRASH";

sendLogToDiscord({
pilot: pilotName,
takeoff: flightStartTime,
landing: [Link](),
dep: departureICAO,
arr: arrivalICAO,
duration: durationMin,
vs: vs,
gforce: g,
gs: gs,
ktrue: tas,
landingQuality: quality
});

// Reset
setTimeout(() => {
flightStarted = false;
hasLanded = false;
flightStartTime = null;
departureICAO = "UNKNOWN";
arrivalICAO = "UNKNOWN";
}, 15000);
}
}

[Link]("✅ GeoFS Flight Logger (Manual ICAO Mode) Loaded");


setInterval(monitorFlight, 1000);
})();

You might also like