- import java.awt.*;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSCharacter;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSTile;
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Point;
- import java.awt.RenderingHints;
- import java.awt.image.BufferedImage;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.io.PrintWriter;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.net.URLConnection;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.imageio.ImageIO;
- import javax.swing.JFileChooser;
- import javax.swing.JOptionPane;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.util.GlobalConfiguration;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Rectangle;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSCharacter;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSTile;
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.RenderingHints;
- import java.awt.SystemColor;
- import java.awt.image.BufferedImage;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.net.URLConnection;
- import javax.imageio.ImageIO;
- import javax.swing.ImageIcon;
- import javax.swing.JButton;
- import javax.swing.JFileChooser;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.UIManager;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.awt.event.MouseMotionListener;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSTile;
- /*
- Author: LegendOwnz
- Converted To 2.XX By: Norton50
- Side note: Removed Any Useless Code In The Script
- I Keep My Promise I Will Update Now :]
- */
- @SuppressWarnings({ "unused", "deprecation" })
- @ScriptManifest(authors = { "Norton50, LegendOwnz" }, name = "<HTML><B><FONT COLOR=\"red\">Norton's Fixed LegendSudoku</FONT></B></HTML>", version = 6.3, description = "The Best Sudoku Solver")
- public class NortonSudoku extends Script implements PaintListener,
- ServerMessageListener {
- private int speed;
- private int clicks;
- private int[][] Solve;
- private Boolean exited;
- private int failcount;
- private int failed;
- private int solved;
- private boolean stop;;
- private long screentime;
- private Items items;
- private long start_gold;
- private long start_weath;
- private RSArea gameArea;
- public NortonSudoku() {
- this.speed = 1;
- this.clicks = 0;
- this.Solve = new int[9][9];
- this.exited = Boolean.valueOf(false);
- this.failcount = 0;
- this.failed = 0;
- this.solved = 0;
- this.stop = false;
- this.starttime = System.currentTimeMillis();
- this.screentime = (this.starttime + 300000L);
- this.items = null;
- this.start_gold = 0L;
- this.start_weath = 0L;
- this.gameArea = new RSArea(new RSTile(3301, 3209), new RSTile(3306,
- 3214));
- }
- public String state = "Loading Legend Sudoku";
- private int naturePrice;
- private int cosmicPrice;
- private int bloodPrice;
- private int deathPrice;
- private int chaosPrice;
- private int mindPrice;
- private int soulPrice;
- private int bodyPrice;
- private int lawPrice;
- private final RSArea gameArea1 = new RSArea(new RSTile(3301, 3209),
- new RSTile(3306, 3214));
- private long starttime;
- long getRuneCosts() {
- if (this.items == null)
- return 0L;
- long l = this.inventory.getCount(true,
- new int[] { this.items.natureID }) * 177;
- l += this.inventory.getCount(true, new int[] { this.items.cosmicID })
- * 68;
- l += this.inventory.getCount(true, new int[] { this.items.bloodID })
- * 354;
- l += this.inventory.getCount(true, new int[] { this.items.deathID })
- * 337;
- l += this.inventory.getCount(true, new int[] { this.items.chaosID })
- * 113;
- l += this.inventory.getCount(true, new int[] { this.items.mindID })
- * 3;
- l += this.inventory.getCount(true, new int[] { this.items.soulID })
- * 359;
- l += this.inventory.getCount(true, new int[] { this.items.bodyID })
- * 4;
- l += this.inventory.getCount(true, new int[] { this.items.lawID })
- * 296;
- return l;
- }
- private int natureInvID = 561;
- private int cosmicInvID = 564;
- private int bloodInvID = 565;
- private int deathInvID = 560;
- private int chaosInvID = 562;
- private int mindInvID = 558;
- private int soulInvID = 566;
- private int bodyInvID = 559;
- private int lawInvID = 563;
- private boolean started = false;
- private int profit = 0;
- private int startMoney = 0;
- private int startCash = 0;
- private int startRunes = 0;
- private long HOUR_MS = 0;
- private int currentMoney = 0;
- private int currentCash = 0;
- private int currentRunes = 0;
- private static final String UPDATER_FILE_NAME = "NortonSudoku.java";
- private static final String UPDATER_URL = "http://pastebin.com/raw.php?i=x6Jdk5GV";
- private static final Pattern UPDATER_VERSION_PATTERN = Pattern
- .compile("version\\s*=\\s*([0-9.]+)");
- boolean messedUp = false;
- boolean sudokuOpen = false;
- boolean sudokuSolved = false;
- boolean talked = false;
- public ScriptManifest properties = getClass().getAnnotation(
- ScriptManifest.class);
- private int[][] sudokuGrid = new int[9][9];
- private int mindID = 8982;
- private int fireID = 8980;
- private int airID = 8975;
- private int waterID = 8987;
- private int earthID = 8979;
- private int bodyID = 8976;
- private int deathID = 8978;
- private int chaosID = 8977;
- private int lawID = 8981;
- long scriptStartTIME = 0;
- int aliID = 1862;
- int moneyID = 995;
- private long perHour(long paramLong1, long paramLong2) {
- double d1 = 0.0D;
- long l1 = 0L;
- long l2 = 0L;
- long l3 = 0L;
- if (paramLong2 >= 1000L) {
- l1 = paramLong2 / 1000L;
- }
- if (l1 >= 60L) {
- l2 = l1 / 60L;
- l1 -= l2 * 60L;
- }
- if (l2 >= 60L) {
- l3 = l2 / 60L;
- l2 -= l3 * 60L;
- }
- if (l3 > 0L)
- d1 = l3 * 60L * 60L;
- if (l2 > 0L)
- d1 += l2 * 60L;
- if (l1 > 0L) {
- d1 += l1;
- }
- double d2 = paramLong1 / d1;
- double d3 = d2 * 60.0D;
- return Math.round(d3 * 60.0D);
- }
- private String formatLong(long paramLong) {
- if (paramLong >= 1000000000L) {
- return paramLong / 1000000000L + "BIL";
- }
- if (paramLong >= 10000000L) {
- return paramLong / 1000000L + "MIL";
- }
- if (paramLong >= 1000L) {
- return paramLong / 1000L + "K";
- }
- return "" + paramLong;
- }
- String formatTime(long paramLong) {
- if (paramLong <= 0L)
- return "00:00:00";
- long l1 = 0L;
- long l2 = 0L;
- long l3 = 0L;
- String str = "";
- if (paramLong >= 1000L) {
- l1 = paramLong / 1000L;
- }
- if (l1 >= 60L) {
- l2 = l1 / 60L;
- l1 -= l2 * 60L;
- }
- if (l2 >= 60L) {
- l3 = l2 / 60L;
- l2 -= l3 * 60L;
- }
- if (l3 < 10L)
- str = str + "0" + l3 + ":";
- else
- str = str + Long.toString(l3) + ":";
- if (l2 < 10L)
- str = str + "0" + l2 + ":";
- else
- str = str + Long.toString(l2) + ":";
- if (l1 < 10L)
- str = str + "0" + l1;
- else
- str = str + Long.toString(l1);
- if (l3 >= 10000L)
- return "00:00:00";
- return str;
- }
- public Boolean Hi() throws InterruptedException {
- if (!inArea(aliArea))
- return Faill();
- return true;
- }
- long getProfit() {
- if (this.items == null)
- return 0L;
- return this.inventory.getCount(true, new int[] { this.items.goldID })
- + getRuneCosts() - this.start_weath;
- }
- public boolean onStart() {
- HOUR_MS = System.currentTimeMillis();
- JOptionPane.showMessageDialog(null, "Welcome To Legend Sudoku revamp by Norton50\n"
- + " [V6.3.1]");
- resetGrid();
- return true;
- }
- private final int[] aliArea = { 3300, 3208, 3308, 3214 };
- private RSTile aliTile = new RSTile(3305, 3211);
- private RSTile aliTileextra = new RSTile(3305, 3212);
- private enum State {
- buyRunes, openSudoku, doSudoku, toAli, end, error, Gone;
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch (IOException e) {
- return null;
- }
- }
- private State getState() {
- try {
- if (!this.gameArea.contains(getMyPlayer().getLocation()))
- return State.Gone;
- if (inArea(aliArea)) {
- if (inventory.getCount(true, moneyID) < 70000) {
- return State.end;
- }
- if (inventory.getCount(true, moneyID) >= 70000) {
- if (sudokuOpen == false) {
- sudokuSolved = false;
- if (interfaces.get(228).getComponent(2)
- .containsText("Buy all")) {
- return State.buyRunes;
- }
- if (!interfaces.get(228).getComponent(2)
- .containsText("Buy all")) {
- return State.openSudoku;
- }
- }
- if (sudokuOpen == true) {
- return State.doSudoku;
- }
- }
- }
- if (!inArea(aliArea)) {
- return State.Gone;
- }
- } catch (Exception e) {
- }
- return State.error;
- }
- private final RenderingHints antialiasing = new RenderingHints(
- RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- private final Color color1 = new Color(153, 0, 0, 174);
- private final Color color2 = new Color(51, 204, 255);
- private final Color color3 = new Color(102, 153, 255);
- private final Color color4 = new Color(204, 255, 204);
- private final Color color5 = new Color(153, 255, 255);
- private final Color color6 = new Color(51, 204, 0);
- private final Color color7 = new Color(0, 153, 204);
- private final BasicStroke stroke1 = new BasicStroke(2);
- private final BasicStroke stroke2 = new BasicStroke(1);
- private final Font font1 = new Font("SansSerif", 1, 14);
- private final Font font2 = new Font("Segoe UI Semibold", 0, 14);
- private final Font font3 = new Font("SansSerif", 3, 14);
- private final Image img1 = getImage("http://legendownz.webs.com/Legend%20Sudoku/Bagi.png");
- @Override
- public int loop() {
- if (!started) {
- this.items = new Items(this);
- this.screentime = (this.starttime + 300000L);
- this.start_gold = this.inventory.getCount(true,
- new int[] { this.items.goldID });
- this.start_weath = (this.start_gold + getRuneCosts());
- started = true;
- }
- if (this.inventory.getCount(true, new int[] { 995 }) != 0)
- if (this.inventory.getCount(true, new int[] { 995 }) < 30000)
- if (this.npcs.getNearest(new int[] { 1862 }) != null) {
- log("We Are Below 30k. Stopping Script");
- return -1;
- }
- if (interfaces.get(288).getComponent(9).containsText("open casket")) {
- sudokuOpen = true;
- }
- if (!interfaces.get(288).getComponent(9).containsText("open casket")) {
- sudokuOpen = false;
- }
- exitGeneralStore();
- if (messedUp == true) {
- talked = false;
- sudokuOpen = false;
- messedUp = false;
- failed++;
- resetGrid();
- interfaces.getComponent(288, 212).doClick(true);
- sleep(random(500, 750));
- }
- try {
- switch (getState()) {
- case Gone:
- log("Got Lost, Walking Back");
- talked = false;
- Fail();
- break;
- case toAli:
- toAli();
- break;
- case openSudoku:
- openSudoku();
- break;
- case doSudoku:
- doSudoku();
- break;
- case buyRunes:
- buyRunes();
- break;
- case end:
- stopScript();
- break;
- }
- } catch (Exception e) {
- }
- calculateProfit();
- return 200;
- }
- private Boolean Faill() throws InterruptedException {
- walking.walkTileMM(aliTileextra, 2, 2);
- wait(700);
- RSNPC npc = npcs.getNearest(aliID);
- npc.doAction("Talk-to");
- talked = true;
- sleep(00 + random(00, 00));
- return true;
- }
- private void Fail() throws InterruptedException {
- walking.walkTileMM(aliTileextra, 2, 2);
- wait(500);
- RSNPC npc = npcs.getNearest(aliID);
- npc.doAction("Talk-to");
- talked = true;
- sleep(00 + random(00, 00));
- }
- private void getPrices() {
- naturePrice = (179);
- cosmicPrice = (70);
- bloodPrice = (347);
- deathPrice = (337);
- chaosPrice = (117);
- mindPrice = (3);
- soulPrice = (345);
- bodyPrice = (4);
- lawPrice = (295);
- startCash = inventory.getCount(true, 995);
- startRunes = (179 * inventory.getCount(561)
- + 70 * inventory.getCount(564) + 347
- * inventory.getCount(565) + 337
- * inventory.getCount(560) + 117
- * inventory.getCount(562) + 3
- * inventory.getCount(558) + 345
- * inventory.getCount(566) + 4
- * inventory.getCount(559) + 295
- * inventory.getCount(563));
- startMoney = startCash + startRunes;
- }
- public void NortonSudokuAntiBan() {
- int randomNum = random(1, 12);
- int r = random(1, 16);
- if (randomNum == 6) {
- if (r == 1) {
- state = "Doing Antiban";
- camera.setAngle(random(100, 360));
- camera.setAngle(random(100, 680));
- log("Changed Camrea View");
- sleep(random(200, 400));
- }
- if (r == 2) {
- state = "Doing Antiban";
- camera.setAngle(random(100, 360));
- camera.setAngle(random(100, 680));
- log(" Changed Camera View");
- sleep(random(200, 400));
- }
- if (r == 3) {
- state = "Doing Antiban";
- camera.setAngle(random(100, 360));
- camera.setAngle(random(100, 680));
- log("Changed Camera View");
- sleep(random(200, 400));
- }
- if (r == 4) {
- state = "Doing Antiban";
- camera.setAngle(random(100, 360));
- camera.setAngle(random(100, 680));
- log("Changed Camera View");
- sleep(random(200, 400));
- }
- if (r == 5) {
- state = "Doing Antiban";
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- log("Moved Mouse for Human Like Patterns");
- sleep(random(200, 400));
- }
- if (r == 6) {
- state = "Doing Antiban";
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- log("Moved Mouse for Human Like Patterns");
- sleep(random(200, 400));
- }
- if (r == 7) {
- state = "Doing Antiban";
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- log("Moved Mouse for Human Like Patterns");
- sleep(random(200, 400));
- }
- if (r == 8) {
- state = "Doing Antiban";
- mouse.move(random(100, 600), random(100, 400), 0, 0);
- log("Moved Mouse for Human Like Patterns");
- sleep(random(200, 400));
- }
- }
- }
- private void calculateProfit() {
- currentCash = inventory.getCount(true, 995);
- currentRunes = (177 * inventory.getCount(561))
- + (68 * inventory.getCount(564))
- + (354 * inventory.getCount(565))
- + (337 * inventory.getCount(560))
- + (113 * inventory.getCount(562))
- + (3 * inventory.getCount(558))
- + (359 * inventory.getCount(566))
- + (4 * inventory.getCount(559))
- + (296 * inventory.getCount(563));
- currentMoney = currentCash + currentRunes;
- profit = currentMoney - startMoney;
- }
- public double getVersion() {
- return properties.version();
- }
- private void GoToAli() {
- walking.walkTileMM(aliTileextra, 2, 2);
- }
- private void talktoalinow() {
- RSNPC npc = npcs.getNearest(aliID);
- npc.doAction("Talk-to");
- talked = true;
- sleep(00 + random(00, 00));
- }
- private void toAli() {
- walking.walkTileMM(aliTile, 2, 2);
- }
- private void openSudoku() throws InterruptedException {
- while (npcs.getNearest(aliID) != null && talked == false) {
- RSNPC npc = npcs.getNearest(aliID);
- npc.doAction("Talk-to");
- talked = true;
- }
- state = "Talking To Ali";
- mouse.setSpeed(random(6, 7));
- Hi();
- sleep(00 + random(10, 20));
- while ((interfaces.get(241).getComponent(4)
- .containsText("How's the adventuring"))) {
- interfaces.getComponent(241, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(228).getComponent(2)
- .containsText("Hi, Ali. Not bad"))) {
- interfaces.getComponent(228, 2).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(64).getComponent(4).containsText("Hi Ali"))) {
- interfaces.getComponent(64, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(241).getComponent(4)
- .containsText("Still selling"))) {
- interfaces.getComponent(241, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(241).getComponent(4).containsText("Sigh"))) {
- interfaces.getComponent(241, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(64).getComponent(4)
- .containsText("What's up with you"))) {
- interfaces.getComponent(64, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(243).getComponent(4)
- .containsText("Well, I always fancied"))) {
- interfaces.getComponent(243, 7).doClick(true);
- sleep(00 + random(01, 05));
- }
- if ((interfaces.get(64).getComponent(4)
- .containsText("Is there anything I could do"))) {
- interfaces.getComponent(64, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(241).getComponent(4)
- .containsText("How's the adventuring"))) {
- interfaces.getComponent(241, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(244).getComponent(4)
- .containsText("I have a friend"))) {
- interfaces.getComponent(244, 8).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(64).getComponent(4)
- .containsText("Maybe I could give it a look"))) {
- interfaces.getComponent(64, 5).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(232).getComponent(4)
- .containsText("selection of runes"))) {
- interfaces.getComponent(232, 4).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(232).getComponent(3)
- .containsText("selection of runes"))) {
- interfaces.getComponent(232, 3).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(234).getComponent(4)
- .containsText("selection of runes"))) {
- interfaces.getComponent(234, 4).doClick(true);
- sleep(00 + random(01, 05));
- }
- while ((interfaces.get(230).getComponent(2)
- .containsText("selection of runes"))) {
- interfaces.getComponent(230, 2).doClick(true);
- sleep(10 + random(100, 200));
- }
- while ((interfaces.get(241).getComponent(4).containsText("Hang on"))) {
- interfaces.getComponent(241, 5).doClick(true);
- sleep(random(100, 200));
- }
- while ((interfaces.get(233).getComponent(3)
- .containsText("large casket of runes"))) {
- interfaces.getComponent(233, 3).doClick(true);
- sleep(00 + random(00, 00));
- }
- while ((interfaces.get(231).getComponent(3)
- .containsText("large casket of runes"))) {
- interfaces.getComponent(231, 3).doClick(true);
- sleep(00 + random(00, 00));
- }
- while ((interfaces.get(235).getComponent(3)
- .containsText("large casket of runes"))) {
- interfaces.getComponent(235, 3).doClick(true);
- sleep(00 + random(00, 00));
- }
- while ((interfaces.get(64).getComponent(4)
- .containsText("On second thoughts"))) {
- talked = false;
- interfaces.getComponent(64, 5).doClick(true);
- sleep(00 + random(00, 00));
- }
- while ((interfaces.get(65).getComponent(4)
- .containsText("I'm feeling lucky"))) {
- interfaces.getComponent(65, 6).doClick(true);
- sleep(00 + random(00, 00));
- }
- while ((interfaces.get(230).getComponent(4)
- .containsText("Examine lock"))) {
- interfaces.getComponent(230, 4).doClick(true);
- sleep(00 + random(00, 00));
- sudokuOpen = true;
- }
- while (interfaces.get(64).getComponent(4)
- .containsText("Who did you want me")) {
- talked = false;
- interfaces.getComponent(64, 5).doClick(true);
- sleep(00 + random(00, 00));
- }
- }
- public void RandomWays() {
- int rr = random(1, 5);
- if (rr == 1) {
- state = "Solving Sudoku Random Way";
- mouse.setSpeed(1);
- for (int k = 0; k < 9; k++) {
- switch (k) {
- case 0:
- interfaces.getComponent(288, 205).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if ((sudokuGrid[r][c] == 1)
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == mindID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 1:
- interfaces.getComponent(288, 204).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 3
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == airID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 2:
- interfaces.getComponent(288, 206).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 2
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == fireID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 3:
- interfaces.getComponent(288, 203).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 4
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == waterID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 4:
- interfaces.getComponent(288, 207).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 6
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == bodyID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 5:
- interfaces.getComponent(288, 202).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 5
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == earthID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 6:
- interfaces.getComponent(288, 209).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 8
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == chaosID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 7:
- interfaces.getComponent(288, 208).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 7
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == deathID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 8:
- interfaces.getComponent(288, 210).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 9
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == lawID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- }
- }
- }
- if (rr == 2) {
- state = "Solving Sudoku Random Way";
- mouse.setSpeed(1);
- for (int k = 0; k < 9; k++) {
- switch (k) {
- case 0:
- interfaces.getComponent(288, 205).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if ((sudokuGrid[r][c] == 1)
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == mindID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 1:
- interfaces.getComponent(288, 204).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 3
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == airID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 2:
- interfaces.getComponent(288, 206).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 2
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == fireID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 3:
- interfaces.getComponent(288, 203).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 4
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == waterID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 4:
- interfaces.getComponent(288, 207).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 6
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == bodyID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 5:
- interfaces.getComponent(288, 209).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 8
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == chaosID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 6:
- interfaces.getComponent(288, 202).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 5
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == earthID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 7:
- interfaces.getComponent(288, 210).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 9
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == lawID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 8:
- interfaces.getComponent(288, 208).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 7
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == deathID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- }
- }
- }
- if (rr == 3) {
- state = "Solving Sudoku Normally";
- mouse.setSpeed(1);
- for (int k = 0; k < 9; k++) {
- switch (k) {
- case 0:
- interfaces.getComponent(288, 205).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if ((sudokuGrid[r][c] == 1)
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == mindID)) {
- interfaces.getComponent(288, i).doClick(true);
- sleep(00 + random(00, 00));
- }
- }
- }
- break;
- case 1:
- interfaces.getComponent(288, 206).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 2
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == fireID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 2:
- interfaces.getComponent(288, 204).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 3
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == airID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 3:
- interfaces.getComponent(288, 203).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 4
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == waterID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 4:
- interfaces.getComponent(288, 202).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 5
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == earthID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 5:
- interfaces.getComponent(288, 207).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 6
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == bodyID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 6:
- interfaces.getComponent(288, 208).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 7
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == deathID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 7:
- interfaces.getComponent(288, 209).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 8
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == chaosID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 8:
- interfaces.getComponent(288, 210).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 9
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == lawID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- }
- }
- }
- if (rr == 4) {
- state = "Solving Sudoku Normally";
- mouse.setSpeed(1);
- for (int k = 0; k < 9; k++) {
- switch (k) {
- case 0:
- interfaces.getComponent(288, 205).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if ((sudokuGrid[r][c] == 1)
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == mindID)) {
- interfaces.getComponent(288, i).doClick(true);
- sleep(00 + random(00, 00));
- }
- }
- }
- break;
- case 1:
- interfaces.getComponent(288, 206).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 2
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == fireID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 2:
- interfaces.getComponent(288, 204).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 3
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == airID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 3:
- interfaces.getComponent(288, 203).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 4
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == waterID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 4:
- interfaces.getComponent(288, 202).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 5
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == earthID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 5:
- interfaces.getComponent(288, 207).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {
- int i = (11 + c * 2 + r * 18);
- if (sudokuGrid[r][c] == 6
- && !(interfaces.get(288).getComponent(i)
- .getModelID() == bodyID)) {
- interfaces.getComponent(288, i).doClick(true);
- }
- }
- }
- break;
- case 6:
- interfaces.getComponent(288, 208).doClick(true);
- for (int r = 0; r < 9; r++) {
- for (int c = 0; c < 9; c++) {