catch Posted February 27, 2021 Posted February 27, 2021 (edited) So I finally got around to making a self updating discord rpc. For this to work, you need Astolfo to output to a latest.log file. The attatched file named "overlayfix.exe" is made by @Boomz, the creator of bwstats overlay and showes you how to create a latest.log file. This is created with nodejs. The attached zip file is a packaged exe. The other is the source code. const client = require('discord-rich-presence')('795673937295835177'); const fs = require('fs'); let currentRpc = undefined; let gameTypes = [ "skywars", "bedwars", "pit", "uhc", "limbo", ] let user = process.env.HOME; let oldLogs = fs.readFileSync(`${user}/AppData/Roaming/.minecraft/logs/latest.log`, 'utf-8'); function getNewLogs() { return fs.readFileSync(`${user}/AppData/Roaming/.minecraft/logs/latest.log`, 'utf-8'); }; function doLoop() { let logs = getNewLogs(); logs = logs.replace(oldLogs, ''); for (i = 0; i < gameTypes.length; i++) { if (logs.toLowerCase().includes(gameTypes[i]) && currentRpc !== gameTypes[i]) { currentRpc = gameTypes[i]; update(gameTypes[i].toUpperCase()); break; }; }; oldLogs = getNewLogs(); setTimeout(() => { doLoop(); }, 500); }; function update(gameMode) { console.log("updated"); client.updatePresence({ state: gameMode, details: "Hypixel.net", startTimestamp: Date.now(), largeImageKey: "logo", instance: true, largeImageText: "https://astolfo.lgbt" }); }; doLoop(); To run this from source, create a new folder, and then run the command: npm install This will install the discord-rich-presence dependancy. There's still things I wanna add to the script in future, but I thought I'd share it. Edit: 3/4/2021 I replaced the index.js and executable file. They should work now. overlayfix.exe package.json index.js astolfoRpc.zip Edited March 5, 2021 by catch 1 Quote Share this post Link to post Share on other sites More sharing options...
Envy Posted February 28, 2021 Posted February 28, 2021 thank you catch very cool Quote Share this post Link to post Share on other sites More sharing options...
ilydis Posted March 1, 2021 Posted March 1, 2021 Sht up catch Quote Share this post Link to post Share on other sites More sharing options...
Guest Idle Posted March 1, 2021 Posted March 1, 2021 Thank you catch very cool Quote Share this post Link to post Share on other sites More sharing options...
matthaeuswinkler Posted March 2, 2021 Posted March 2, 2021 Thank you catch very cool Quote Share this post Link to post Share on other sites More sharing options...
youssef Posted March 3, 2021 Posted March 3, 2021 Thank you catch very cool Quote Share this post Link to post Share on other sites More sharing options...
NotDuckie Posted March 3, 2021 Posted March 3, 2021 Ok Quote Share this post Link to post Share on other sites More sharing options...
catch Posted March 12, 2021 Posted March 12, 2021 bumping this thread because some people were asking about it earlier Quote Share this post Link to post Share on other sites More sharing options...
Darknessss Posted August 4, 2021 Posted August 4, 2021 exe not working for anyone else? Quote Share this post Link to post Share on other sites More sharing options...
bubkod Posted August 4, 2021 Posted August 4, 2021 Astolfo recently removed all uploaded files in the forum, You can also see that 100% of the files are 0KB there Quote Share this post Link to post Share on other sites More sharing options...
Cleaver10 Posted August 4, 2021 Posted August 4, 2021 Catch can you update please? Quote Share this post Link to post Share on other sites More sharing options...
Ookay Posted December 26, 2021 Posted December 26, 2021 it's not running on my pc, the overlayfix.exe. I tried but it won't work. It says that the versio;n is not compatible and this is for stats overlay right? Quote Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.