Added screenshot functionality to API

This commit is contained in:
ipkpjersi 2023-12-27 21:25:28 -05:00
parent 2e2e3c2edc
commit 75e6a68925

View file

@ -8,7 +8,9 @@ import rt4.Font;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import static rt4.MathUtils.clamp;
import static rt4.Player.plane;
@ -270,6 +272,12 @@ public class API {
public static void DispatchCommand(String command) {
Cheat.sendCheatPacket(JagString.of(command));
}
public static void Screenshot() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd-HH_mm_ss");
String dateTime = dateFormat.format(new Date());
client.instance.saveScreenshot(PlayerList.self.username.toString() + "_" + dateTime + ".png");
}
public static void PlaySound(int volume, int trackId, int delay) {
SoundPlayer.play(volume, trackId, delay);