From 0120892521c1538814197118c023713a92013928 Mon Sep 17 00:00:00 2001 From: ipkpjersi <33754783+ipkpjersi@users.noreply.github.com> Date: Fri, 20 Sep 2024 23:14:45 -0400 Subject: [PATCH] Added automatic screenshots (#657) * Added automatic screenshots This branch is based off of the screenshots branch, but it will also require the develop branch to be merged first to not cause a git conflict with adding more QoL options to ClientSettings.java, so we'll want to pull the develop branch onto this branch eventually (or, I suppose, the master branch after it's merged). In other words, we can add 2 new QoL settings to ClientSettings at a later time (after my develop branch fixes/improvements PR is merged). * Fixed params for auto screenshots * Added auto screenshots toggle * Fixed auto screenshots var typo --- .../src/main/java/ClientSettings.java | 7 +++++++ 2006Scape Client/src/main/java/Game.java | 20 +++++++++++++++++++ 2006Scape Client/src/main/java/Main.java | 4 ++++ 3 files changed, 31 insertions(+) diff --git a/2006Scape Client/src/main/java/ClientSettings.java b/2006Scape Client/src/main/java/ClientSettings.java index 42a4ee86..bc5b0c5f 100644 --- a/2006Scape Client/src/main/java/ClientSettings.java +++ b/2006Scape Client/src/main/java/ClientSettings.java @@ -122,6 +122,13 @@ public class ClientSettings { * Enables the ability to take screenshots */ public static boolean SCREENSHOTS_ENABLED = false; + + /** + * @QoL + * Enables the ability to take automatic screenshots on stats tab click and bank open + * This is a poor man's player exports. + */ + public static boolean AUTOMATIC_SCREENSHOTS_ENABLED = false; /** * The Npc Bits for the Server diff --git a/2006Scape Client/src/main/java/Game.java b/2006Scape Client/src/main/java/Game.java index eff470a9..50458e40 100644 --- a/2006Scape Client/src/main/java/Game.java +++ b/2006Scape Client/src/main/java/Game.java @@ -5684,6 +5684,16 @@ public class Game extends RSApplet { needDrawTabArea = true; tabID = 1; tabAreaAltered = true; + if(ClientSettings.SCREENSHOTS_ENABLED && ClientSettings.AUTOMATIC_SCREENSHOTS_ENABLED) { + java.util.Timer timer = new java.util.Timer(); + java.util.TimerTask delayedScreenshot = new java.util.TimerTask() { + @Override + public void run() { + screenshot(false, "stats"); + } + }; + timer.schedule(delayedScreenshot, 300); + } } if (super.saveClickX >= 597 && super.saveClickX <= 627 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) { needDrawTabArea = true; @@ -11302,6 +11312,16 @@ public class Game extends RSApplet { tabAreaAltered = true; aBoolean1149 = false; pktType = -1; + if (ClientSettings.SCREENSHOTS_ENABLED && ClientSettings.AUTOMATIC_SCREENSHOTS_ENABLED && i5 == 5292) { + java.util.Timer timer = new java.util.Timer(); + java.util.TimerTask delayedScreenshot = new java.util.TimerTask() { + @Override + public void run() { + screenshot(false, "bank"); + } + }; + timer.schedule(delayedScreenshot, 600); + } return true; } if (pktType == 79) { diff --git a/2006Scape Client/src/main/java/Main.java b/2006Scape Client/src/main/java/Main.java index fe9f3d95..144ab158 100644 --- a/2006Scape Client/src/main/java/Main.java +++ b/2006Scape Client/src/main/java/Main.java @@ -58,6 +58,10 @@ public final class Main { case"-enable-screenshots": ClientSettings.SCREENSHOTS_ENABLED = true; break; + case"-auto-screenshots": + case"-enable-auto-screenshots": + ClientSettings.AUTOMATIC_SCREENSHOTS_ENABLED = true; + break; } if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) { switch(args[i]) {