Skip to content

Commit 0120892

Browse files
authored
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
1 parent e404ead commit 0120892

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

2006Scape Client/src/main/java/ClientSettings.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ public class ClientSettings {
122122
* Enables the ability to take screenshots
123123
*/
124124
public static boolean SCREENSHOTS_ENABLED = false;
125+
126+
/**
127+
* @QoL
128+
* Enables the ability to take automatic screenshots on stats tab click and bank open
129+
* This is a poor man's player exports.
130+
*/
131+
public static boolean AUTOMATIC_SCREENSHOTS_ENABLED = false;
125132

126133
/**
127134
* The Npc Bits for the Server

2006Scape Client/src/main/java/Game.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5684,6 +5684,16 @@ public void processTabClick() {
56845684
needDrawTabArea = true;
56855685
tabID = 1;
56865686
tabAreaAltered = true;
5687+
if(ClientSettings.SCREENSHOTS_ENABLED && ClientSettings.AUTOMATIC_SCREENSHOTS_ENABLED) {
5688+
java.util.Timer timer = new java.util.Timer();
5689+
java.util.TimerTask delayedScreenshot = new java.util.TimerTask() {
5690+
@Override
5691+
public void run() {
5692+
screenshot(false, "stats");
5693+
}
5694+
};
5695+
timer.schedule(delayedScreenshot, 300);
5696+
}
56875697
}
56885698
if (super.saveClickX >= 597 && super.saveClickX <= 627 && super.saveClickY >= 168 && super.saveClickY < 205 && tabInterfaceIDs[2] != -1) {
56895699
needDrawTabArea = true;
@@ -11302,6 +11312,16 @@ public boolean parsePacket() {
1130211312
tabAreaAltered = true;
1130311313
aBoolean1149 = false;
1130411314
pktType = -1;
11315+
if (ClientSettings.SCREENSHOTS_ENABLED && ClientSettings.AUTOMATIC_SCREENSHOTS_ENABLED && i5 == 5292) {
11316+
java.util.Timer timer = new java.util.Timer();
11317+
java.util.TimerTask delayedScreenshot = new java.util.TimerTask() {
11318+
@Override
11319+
public void run() {
11320+
screenshot(false, "bank");
11321+
}
11322+
};
11323+
timer.schedule(delayedScreenshot, 600);
11324+
}
1130511325
return true;
1130611326
}
1130711327
if (pktType == 79) {

2006Scape Client/src/main/java/Main.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public static void main(String[] args) {
5858
case"-enable-screenshots":
5959
ClientSettings.SCREENSHOTS_ENABLED = true;
6060
break;
61+
case"-auto-screenshots":
62+
case"-enable-auto-screenshots":
63+
ClientSettings.AUTOMATIC_SCREENSHOTS_ENABLED = true;
64+
break;
6165
}
6266
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
6367
switch(args[i]) {

0 commit comments

Comments
 (0)