import { set } from "https://esm.town/v/std/set?v=11";
import { chorus_get_mag_data } from "https://esm.town/v/hyperglitch/chorus_get_mag_data";
import process from "node:process";
export async function chorus_data(auth) {
if (auth != process.env.chorus_access) {
return "";
}
let data = await chorus_get_mag_data();
await set("chorus_stored_data", data);
const last = data[data.length - 1];
return last.x + "\n" + last.y + "\n" + last.z + "\n" + last.tot + "\n\n";
}