Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.Test;
- import org.tribot.api.input.Mouse;
- import org.tribot.script.Script;
- import org.tribot.script.ScriptManifest;
- import java.awt.*;
- import java.awt.event.FocusEvent;
- import java.awt.event.FocusListener;
- @ScriptManifest(authors = "IceKontroI",
- name = "Focus tester",
- category = "@ utils", description = "Tests the focus gain/loss events.")
- public class FocusTester extends Script implements FocusListener {
- @Override
- public void run() {
- this.setLoginBotState(false);
- Mouse.move(new Point(100, 100));
- Mouse.click(1);
- Mouse.leaveGame(true);
- System.out.println("Try clicking the client, and then clicking something in the background.");
- System.out.println("You cannot manually fire focusGained() or focusLost() even though it should.");
- while (true) {
- sleep(100);
- }
- }
- @Override
- public void focusGained(FocusEvent e) {
- System.out.println("Focus was gained");
- }
- @Override
- public void focusLost(FocusEvent e) {
- System.out.println("Focus was lost");
- }
- }
Add Comment
Please, Sign In to add comment