Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.*;
- import java.awt.geom.Rectangle2D;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.text.NumberFormat;
- import java.text.DecimalFormat;
- import java.text.SimpleDateFormat;
- import java.util.Calendar;
- import java.util.Properties;
- import java.awt.*;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.URL;
- import org.rsbot.script.util.Timer;
- import org.rsbot.script.wrappers.RSCharacter;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Inventory;
- import org.rsbot.script.methods.Methods;
- import org.rsbot.script.methods.Players;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.methods.GrandExchange.GEItem;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.Configuration;
- @ScriptManifest(authors = {"#God"}, keywords = "crab", name = "AA -- iCrab Pvt.", version = 0.01, description =
- "#God PRIVATE Rock Crab Killer")
- public class iCrab extends Script implements PaintListener {
- int state;
- RSTile[] castle2bank = new RSTile[]{
- new RSTile(2758, 3478), new RSTile(2757, 3478), new RSTile(2756, 3478),
- new RSTile(2755, 3478), new RSTile(2754, 3478), new RSTile(2753, 3478),
- new RSTile(2752, 3478), new RSTile(2751, 3478), new RSTile(2749, 3478),
- new RSTile(2748, 3478), new RSTile(2747, 3478), new RSTile(2746, 3479),
- new RSTile(2745, 3479), new RSTile(2744, 3479), new RSTile(2743, 3479), new RSTile(2742, 3479),
- new RSTile(2741, 3479), new RSTile(2740, 3479), new RSTile(2739, 3480), new RSTile(2738, 3481),
- new RSTile(2737, 3482), new RSTile(2736, 3482), new RSTile(2735, 3483), new RSTile(2734, 3483),
- new RSTile(2733, 3484), new RSTile(2733, 3485), new RSTile(2732, 3485), new RSTile(2731, 3485),
- new RSTile(2730, 3485), new RSTile(2729, 3485), new RSTile(2728, 3485), new RSTile(2727, 3485),
- new RSTile(2726, 3486), new RSTile(2726, 3487), new RSTile(2726, 3488), new RSTile(2726, 3489),
- new RSTile(2726, 3490), new RSTile(2726, 3491), new RSTile(2725, 3492)
- };
- RSTile[] Bank2Crabs = new RSTile[]{
- new RSTile(2724, 3493), new RSTile(2724, 3492), new RSTile(2725, 3489), new RSTile(2725, 3488),
- new RSTile(2726, 3485), new RSTile(2725, 3485), new RSTile(2722, 3487), new RSTile(2721, 3488),
- new RSTile(2720, 3491), new RSTile(2719, 3492), new RSTile(2718, 3493), new RSTile(2718, 3494),
- new RSTile(2716, 3495), new RSTile(2715, 3496), new RSTile(2713, 3498), new RSTile(2712, 3499),
- new RSTile(2709, 3499), new RSTile(2708, 3500), new RSTile(2708, 3503), new RSTile(2708, 3504),
- new RSTile(2708, 3507), new RSTile(2708, 3508), new RSTile(2705, 3510), new RSTile(2704, 3510),
- new RSTile(2703, 3510), new RSTile(2702, 3510), new RSTile(2699, 3510), new RSTile(2698, 3510),
- new RSTile(2697, 3510), new RSTile(2696, 3510), new RSTile(2695, 3510), new RSTile(2694, 3510),
- new RSTile(2691, 3513), new RSTile(2690, 3513), new RSTile(2689, 3513), new RSTile(2688, 3514),
- new RSTile(2685, 3517), new RSTile(2684, 3518), new RSTile(2682, 3521), new RSTile(2682, 3522),
- new RSTile(2682, 3523), new RSTile(2682, 3524), new RSTile(2682, 3525), new RSTile(2682, 3526),
- new RSTile(2680, 3529), new RSTile(2680, 3530), new RSTile(2680, 3531), new RSTile(2681, 3531),
- new RSTile(2682, 3531), new RSTile(2683, 3532), new RSTile(2684, 3533), new RSTile(2685, 3533),
- new RSTile(2685, 3534), new RSTile(2685, 3535), new RSTile(2685, 3536), new RSTile(2684, 3536),
- new RSTile(2683, 3536), new RSTile(2683, 3537), new RSTile(2683, 3538), new RSTile(2683, 3539),
- new RSTile(2682, 3540), new RSTile(2681, 3541), new RSTile(2680, 3543), new RSTile(2680, 3544),
- new RSTile(2680, 3545), new RSTile(2679, 3546), new RSTile(2676, 3548), new RSTile(2675, 3549),
- new RSTile(2675, 3550), new RSTile(2675, 3551), new RSTile(2675, 3554), new RSTile(2675, 3555),
- new RSTile(2674, 3556), new RSTile(2673, 3556), new RSTile(2672, 3556), new RSTile(2671, 3556),
- new RSTile(2670, 3556), new RSTile(2669, 3557), new RSTile(2666, 3557), new RSTile(2665, 3557),
- new RSTile(2664, 3558), new RSTile(2663, 3559), new RSTile(2662, 3560), new RSTile(2661, 3561),
- new RSTile(2661, 3562), new RSTile(2661, 3563), new RSTile(2661, 3564), new RSTile(2661, 3565),
- new RSTile(2661, 3566), new RSTile(2661, 3567), new RSTile(2661, 3568), new RSTile(2660, 3569),
- new RSTile(2657, 3572), new RSTile(2656, 3573), new RSTile(2655, 3574), new RSTile(2654, 3575),
- new RSTile(2654, 3582), new RSTile(2654, 3583), new RSTile(2654, 3584), new RSTile(2653, 3585),
- new RSTile(2653, 3590), new RSTile(2654, 3599), new RSTile(2654, 3600), new RSTile(2654, 3601),
- new RSTile(2654, 3602), new RSTile(2654, 3603), new RSTile(2654, 3604), new RSTile(2654, 3605),
- new RSTile(2659, 3608), new RSTile(2660, 3608), new RSTile(2661, 3609), new RSTile(2662, 3610),
- new RSTile(2663, 3611), new RSTile(2664, 3611), new RSTile(2665, 3612), new RSTile(2666, 3613),
- new RSTile(2667, 3614), new RSTile(2667, 3615), new RSTile(2667, 3616), new RSTile(2667, 3617),
- new RSTile(2668, 3618), new RSTile(2669, 3619), new RSTile(2670, 3620), new RSTile(2671, 3620),
- new RSTile(2671, 3625), new RSTile(2671, 3626), new RSTile(2672, 3627), new RSTile(2673, 3628),
- new RSTile(2674, 3629), new RSTile(2674, 3630), new RSTile(2675, 3631), new RSTile(2676, 3632),
- new RSTile(2677, 3632), new RSTile(2678, 3632), new RSTile(2679, 3632), new RSTile(2680, 3632),
- new RSTile(2681, 3632), new RSTile(2682, 3632), new RSTile(2683, 3632), new RSTile(2684, 3632),
- new RSTile(2689, 3636), new RSTile(2690, 3636), new RSTile(2691, 3636), new RSTile(2692, 3636),
- new RSTile(2693, 3637), new RSTile(2694, 3638), new RSTile(2695, 3638), new RSTile(2696, 3638),
- new RSTile(2697, 3638), new RSTile(2698, 3639), new RSTile(2699, 3639), new RSTile(2700, 3639),
- new RSTile(2701, 3639), new RSTile(2702, 3640), new RSTile(2703, 3641), new RSTile(2704, 3642),
- new RSTile(2705, 3643), new RSTile(2706, 3644), new RSTile(2707, 3645), new RSTile(2708, 3646),
- new RSTile(2708, 3651), new RSTile(2708, 3652), new RSTile(2708, 3653), new RSTile(2708, 3654),
- new RSTile(2708, 3655), new RSTile(2708, 3656), new RSTile(2708, 3657), new RSTile(2709, 3658),
- new RSTile(2710, 3659), new RSTile(2709, 3659), new RSTile(2709, 3660), new RSTile(2709, 3661),
- new RSTile(2709, 3662), new RSTile(2709, 3663), new RSTile(2709, 3664), new RSTile(2709, 3665),
- new RSTile(2709, 3666), new RSTile(2709, 3667), new RSTile(2709, 3668), new RSTile(2709, 3669),
- new RSTile(2709, 3670), new RSTile(2709, 3671), new RSTile(2712, 3675), new RSTile(2712, 3676),
- new RSTile(2712, 3677), new RSTile(2712, 3678), new RSTile(2712, 3679), new RSTile(2712, 3680),
- new RSTile(2712, 3681), new RSTile(2712, 3682), new RSTile(2712, 3683), new RSTile(2712, 3684),
- new RSTile(2711, 3685), new RSTile(2710, 3686), new RSTile(2710, 3687), new RSTile(2710, 3688),
- new RSTile(2710, 3689), new RSTile(2710, 3690), new RSTile(2710, 3691), new RSTile(2710, 3692),
- new RSTile(2710, 3697), new RSTile(2710, 3698), new RSTile(2710, 3699), new RSTile(2710, 3700),
- new RSTile(2710, 3701), new RSTile(2710, 3702), new RSTile(2710, 3703), new RSTile(2710, 3704),
- new RSTile(2710, 3705), new RSTile(2710, 3706), new RSTile(2710, 3711), new RSTile(2710, 3712),
- new RSTile(2710, 3713), new RSTile(2709, 3714), new RSTile(2708, 3715), new RSTile(2707, 3716),
- new RSTile(2706, 3717)};
- RSNPC Rock, Crab;
- // tiles
- RSTile bankTile = new RSTile(2724,3493);
- RSTile crabTile = new RSTile(2706,3717);
- RSTile cammyTile = new RSTile(2757,3477);
- RSTile inSet = new RSTile(2773,10162);
- RSTile outSet = new RSTile(2730,3713);
- // IDs of obj + npc 's
- public int crabID[] = {1267,1265}, rockID[] = {1268,1266}, charms[] = {12158, 12159, 12160, 12162};
- public int TTabID = 8010, bankBoothID = 25808, foodID = 333, arrowID = 0, stuck = 0, foodInBank =0, tabsInBank =0; //food set to trout by default
- public int inReset = 5008, outReset = 5014, foodEat = 0;
- // booleans
- boolean needBank = false, needReset = false;
- // paint counters/timers
- public String status = "";
- public long startTime = System.currentTimeMillis();
- public long RxpGain, RxpHour, Rlvlgain, RstartExp, Rstartlvl, brakeIn, brakeFor, HxpGain, HxpHour, Hlvlgain, HstartExp, Hstartlvl;
- @Override
- public int loop() {
- switch (state){
- case 0:
- ToCrabs();
- break;
- case 1:
- ToReset();
- break;
- case 2:
- FromReset();
- break;
- case 3:
- Fight();
- break;
- case 4:
- Tobank();
- break;
- case 5:
- OpenBank();
- break;
- case 6:
- Dobank();
- break;
- case 7:
- Logout();
- break;
- case 8:
- brake();
- break;
- }
- return (random(100,280));
- }
- // START ###
- public boolean onStart() {
- status = "Loading..";
- env.enableRandom("Improved Login"); //enables random
- long varTime = random(3200000, 9990000); //gets ran time for break to vary by
- brakeIn = System.currentTimeMillis() + varTime;
- brakeFor = random(720000 , 4200000); //breaks between there 2 times
- log.severe("Started !");
- while (bank.isOpen()) { //shuts bank if its open on start
- bank.close();
- sleep(random(200, 400));
- }
- startTime = System.currentTimeMillis(); //sets time @ start
- Rstartlvl = skills.getCurrentLevel(skills.RANGE); //start range level
- RstartExp = skills.getCurrentExp(skills.RANGE); //start range xp
- Hstartlvl = skills.getCurrentLevel(skills.CONSTITUTION); //start range level
- HstartExp = skills.getCurrentExp(skills.CONSTITUTION); //start range xp
- if (calc.distanceTo(bankTile) < 10) { //bank
- if (!inventory.contains(foodID)){ //no food & in bank
- state = 5; // open bank
- }
- if (inventory.contains(foodID) && (inventory.contains(TTabID))){ //food & in bank
- state = 0; // walk 2 crabs
- }
- }
- if (calc.distanceTo(crabTile) < 40) {//crabs
- if (!inventory.contains(foodID)){ //no food & @ crabs
- state = 4; // go 2 bank
- }
- if (inventory.contains(foodID)){ //food & @ crabs
- state = 3; // start attak
- }
- sleep(random(80, 140));
- return true;
- }
- return true;
- }
- private boolean brakeCheck() {
- if (brakeIn < 1){ //if break timer has reached 0
- sleep (random(40,90));
- status = "Need To Brake..";
- state = 8; //send to break mode
- }
- return true;
- }
- private boolean brake() {
- long endIn = System.currentTimeMillis() + brakeFor; //how long break is for
- env.disableRandom("Improved Login"); //disables auto login
- status = "Taking Brake..";
- log.severe("Braking For - " +brakeFor);
- while (bank.isOpen()) { //closes bank if its open
- bank.close();
- sleep(random(200, 400));
- }
- game.logout(true); //logs out
- sleep(random(1200, 3600));
- while (System.currentTimeMillis() < endIn) { //will brake here
- status = "Braking..";
- sleep(5000);
- }
- while (System.currentTimeMillis() > endIn) { //brake is over
- env.enableRandom("Improved Login"); //enables random
- status = "Brake Over..";
- sleep(random(3000,6800)); //time to login
- if (calc.distanceTo(bankTile) < 10) { //bank
- if (!inventory.contains(foodID)){ //no food & in bank
- state = 5; // open bank
- }
- if (inventory.contains(foodID)){ //food & in bank
- state = 0; // walk 2 crabs
- }
- }
- if (calc.distanceTo(crabTile) < 25) {//crabs
- if (!inventory.contains(foodID)){ //no food & @ crabs
- state = 4; // go 2 bank
- }
- if (inventory.contains(foodID)){ //food & @ crabs
- state = 3; // start attak
- }
- sleep(random(80, 140));
- return true;
- }
- }
- return true;
- }
- private void pickItem(RSGroundItem item, String action) { //pickup method from 'glow'
- if (item != null) {
- Point middle = calc.tileToScreen(item.getLocation());
- if (item.isOnScreen() && !getMyPlayer().isMoving()) {
- if (!menu.contains(action)) {
- if (!menu.isOpen()) {
- mouse.move(middle);
- } else {
- mouse.moveOffScreen();
- }
- } else {
- menu.doAction(action);
- sleep(1000,1100);
- }
- } else if (!item.isOnScreen()) {
- if (!getMyPlayer().isMoving()) {
- walking.walkTileMM(item.getLocation()); // end 'glow' pick-up method
- }
- }
- }
- }
- public boolean ToCrabs(){
- if (!walking.isRunEnabled() && walking.getEnergy() > (random(15,35))) { // will enable run
- status = "Setting Run..";
- walking.setRun(true);
- sleep(random(80, 140));
- }
- if (calc.distanceTo(crabTile) < 6) {
- state = 3;
- status = "At Crabs..";
- sleep(random(80, 170));
- return true;
- }
- RSTilePath path = walking.newTilePath(Bank2Crabs);
- status = "Walking To Crabs..";
- if (!path.traverse()) {
- stuck++;
- if (stuck > 2) {
- walking.walkTileMM(walking.getClosestTileOnMap(new RSTile(2675, 3551)));
- }
- } else {
- stuck = 0;
- int max = 0;
- while (!getMyPlayer().isMoving() && max < 12) {
- status = "Walking To Crabs..";
- sleep(random(650, 900));
- }
- }
- return true;
- }
- public boolean ToReset(){
- RSObject GoInCave = objects.getNearest(inReset);
- walking.walkTileMM(walking.getClosestTileOnMap(outSet));
- status = "Walking To Cave..";
- sleep(500);
- if (getMyPlayer().isMoving()) {
- sleep (random(500, 650));
- }
- if (calc.distanceTo(outSet) < 5) {
- status = "Finding Cave..";
- if (GoInCave != null && needReset == true) {
- GoInCave.doAction("Enter");
- status = "Entering Cave..";
- sleep(random(1200, 1450));
- }
- }
- if (calc.distanceTo(inSet) < 2) {
- status = "Inside Cave..";
- needReset = false;
- sleep(150);
- state = 2;
- }
- return true;
- }
- private void pickupCharm() {
- if (inventory.getCount() < 27) {
- RSGroundItem ChPickUp = groundItems.getNearest(charms);
- sleep(90);
- pickItem(ChPickUp, "Take "+ ChPickUp.getItem().getName());
- checkHP();
- status = "Looted Charm..";
- sleep(random(100,250));
- }
- }
- public boolean checkHP(){
- if (combat.getLifePoints() < (((skills.getRealLevel(Skills.CONSTITUTION) * 10) - 100))){
- status = "Eating Food..";
- eatFood();
- sleep(110);
- }
- return true;
- }
- public boolean FromReset() {
- RSObject GoOutCave = objects.getNearest(outReset);
- status = "Preparing To Exit..";
- if (getMyPlayer().isMoving()) {
- sleep (random(300, 550));
- }
- if (calc.distanceTo(inSet) < 5) {
- if (GoOutCave != null) {
- status = "Exiting Cave..";
- GoOutCave.doAction("Enter");
- sleep(random(1200, 1450));
- }
- }
- if (calc.distanceTo(outSet) < 2) {
- status = "Walking To Crabs..";
- sleep(300);
- walking.walkTileMM(walking.getClosestTileOnMap(crabTile));
- sleep(1500);
- }
- if (calc.distanceTo(crabTile) < 20) {
- sleep(300);
- state = 3;
- sleep(50);
- }
- return true;
- }
- public boolean Fight() {
- Crab = npcs.getNearest(crabID);
- Rock = npcs.getNearest(rockID);
- RSTile RockLocation = Rock.getLocation();
- checkHP();
- if (!getMyPlayer().isInCombat() && (getMyPlayer().getInteracting() == null)) {
- if(Crab != null && !Crab.isInCombat() && Crab.isOnScreen() && !getMyPlayer().getLocation().equals(RockLocation)) {
- status = "Finding Crab..";
- Crab.interact("Attack");
- sleep(110,140);
- } else if(Rock != null && Rock.isOnScreen() && !getMyPlayer().getLocation().equals(RockLocation)) {
- status = "Walking To Rocks..";
- walking.walkTileOnScreen(Rock.getLocation());
- sleep(400,600);
- } else if (Rock != null && !Rock.isOnScreen()) {
- walking.walkTileMM(Rock.getLocation());
- status = "Walking..";
- } else if (getMyPlayer().getLocation().equals(RockLocation) && (getMyPlayer().getInteracting() == null)) {
- for (int i = 0; i < 50 && getMyPlayer().getLocation().equals(RockLocation) && (getMyPlayer().getInteracting() == null); i++) {
- if (getMyPlayer().isIdle()) {
- sleep(240,330);
- } for (int t = 0; t < 50 && !getMyPlayer().isInCombat(); t++) {
- status = "Need Reset..";
- needReset = true;
- }
- }
- }
- }
- if (getMyPlayer().isInCombat()){
- status = "Fighting..";
- sleep (random(10, 30));
- checkHP();
- }
- if (getMyPlayer().isMoving()) {
- sleep (random(30, 60));
- checkHP();
- }
- if (groundItems.getNearest(charms) != null) {
- status = "Looting Charms..";
- sleep(random(30, 60));
- pickupCharm();
- }
- if (needBank == true){
- state = 4;
- }
- if (!inventory.contains(foodID)){
- needBank = true;
- }
- if (needReset == true){
- state = 1;
- }
- return true;
- }
- private boolean Tobank(){
- status = "Need To Bank..";
- if (calc.distanceTo(cammyTile) > 10) {// not at cammy
- if (!inventory.contains(TTabID)) { // at crabs with no tabs
- state = 7;
- sleep(3500);
- }
- else if (inventory.contains(TTabID)) { // at crabs with tabs
- status = "Using tab..";
- inventory.getItem(TTabID).doAction("Break");
- sleep(3500);
- }
- }
- if (calc.distanceTo(cammyTile) < 5){ //at cammy
- if (!walking.isRunEnabled() && walking.getEnergy() > (random(15,35))) { // will enable run
- status = "Setting Run..";
- walking.setRun(true);
- sleep(random(80, 110));
- }
- if (calc.distanceTo(bankTile) < 3) { //meaning at bank
- status = "At Bank..";
- state = 5; //to open bank
- sleep(random(240, 320));
- return true;
- }
- RSTilePath path2 = walking.newTilePath(castle2bank);
- status = "Walking To Bank..";
- if (!path2.traverse()) {
- stuck++;
- if (stuck > 2) {
- walking.walkTileMM(walking.getClosestTileOnMap(new RSTile(2740, 3479)));
- }
- } else {
- int max = 0;
- while (!getMyPlayer().isMoving() && max < 12) {
- status = "Walking To Bank..";
- sleep(random(550, 800));
- }
- }
- }
- return true;
- }
- public boolean OpenBank() {
- brakeCheck();
- status = "Finding Bank..";
- while (!bank.isOpen()){
- RSObject bankboot = objects.getNearest(bankBoothID);
- if (bankboot != null){
- status = "Opening Bank..";
- bank.open();
- sleep(random(250, 400));
- }
- }
- if (bank.isOpen()){
- status = "Bank Is Open..";
- sleep(random(80, 120));
- state = 6;
- }
- return true;
- }
- public boolean Dobank() {
- status = "Banking..";
- while (bank.isOpen()){
- while (!inventory.contains(foodID) && (!inventory.contains(TTabID))) {
- status = "Depositing..";
- bank.depositAll();
- sleep(random(340, 450));
- status = "Withdrawing..";
- bank.withdraw(foodID, 27);
- sleep(250);
- bank.withdraw(TTabID, 1);
- sleep(350);
- foodInBank = bank.getCount(foodID);
- tabsInBank = bank.getCount(TTabID);
- sleep(random(700, 930));
- }
- if (inventory.contains(foodID) && (inventory.contains(TTabID))){
- status = "Done at bank..";
- needBank = false;
- bank.close();
- state = 0;
- sleep(random(50, 90));
- }
- if (foodInBank < 28){
- log.severe("Ran out of food.");
- state = 7;
- }
- }
- return true;
- }
- public boolean Logout() {
- env.disableRandom("Improved Login");
- status = "Logging Out..";
- log.severe("Logging Out!");
- while (bank.isOpen()) {
- bank.close();
- sleep(random(200, 400));
- }
- game.logout(true);
- return true;
- }
- public boolean antiban(){
- return true;
- }
- public boolean eatFood(){
- status = "Eating Food..";
- if (!inventory.contains(foodID)){
- needBank = true;
- } else{
- inventory.getItem(foodID).doAction("Eat");
- foodEat = foodEat + 1;
- }
- sleep(170);
- return true;
- }
- // FINISH ###
- public void onFinish() {
- log.severe("Ended !");
- }
- // PAINT ###
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- if(game.isLoggedIn()){
- Rlvlgain = skills.getCurrentLevel(skills.RANGE) - Rstartlvl;
- RxpGain = skills.getCurrentExp(skills.RANGE) - RstartExp;
- RxpHour = (int) ((RxpGain) * 3600000D / (System.currentTimeMillis() - startTime));
- Hlvlgain = skills.getCurrentLevel(skills.CONSTITUTION) - Hstartlvl;
- HxpGain = skills.getCurrentExp(skills.CONSTITUTION) - HstartExp;
- HxpHour = (int) ((HxpGain) * 3600000D / (System.currentTimeMillis() - startTime));
- final Color color1 = new Color(153, 0, 0);
- final Color color2 = new Color(0, 0, 0);
- final Color color3 = new Color(0, 102, 0);
- final Color color4 = new Color(255, 255, 255);
- final Color color5 = new Color(204, 204, 204);
- final Color color6 = new Color(153, 153, 0);
- final Color color7 = new Color(0, 102, 51);
- final Color color8 = new Color(255, 0, 0);
- final Color color9 = new Color(0, 0, 204);
- final BasicStroke stroke1 = new BasicStroke(1);
- final BasicStroke stroke2 = new BasicStroke(3);
- final BasicStroke stroke3 = new BasicStroke(2);
- final Font font1 = new Font("OCR A Extended", 0, 13);
- final Font font2 = new Font("Bradley Hand ITC", 2, 30);
- final Font font3 = new Font("OCR A Extended", 1, 18);
- final Font font4 = new Font("MS PGothic", 1, 25);
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- long bra = brakeIn - System.currentTimeMillis();
- long h = bra / (1000 * 60 * 60);
- bra -= h * (1000 * 60 * 60);
- long m = bra / (1000 * 60);
- bra -= m * (1000 * 60);
- long s = bra / 1000;
- if(game.isLoggedIn()){
- // Paints the Mouse Location
- g.setColor(Color.black);
- Point mousey = mouse.getLocation();
- int x = (int) mousey.getX();
- int y = (int) mousey.getY();
- g.drawLine(x, 0, x, game.getHeight());
- g.drawLine(0, y, game.getWidth(), y);
- g.setColor(Color.white);
- g.drawRect(x - 2, y - 2, 5, 5);
- g.fillRect(x - 2, y - 2, 5, 5);
- g.setColor(color1);
- g.fillRect(7, 373, 491, 25);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(7, 373, 491, 25);
- g.setColor(color3);
- g.fillRect(7, 346, 491, 25);
- g.setColor(color2);
- g.drawRect(7, 346, 491, 25);
- g.setFont(font1);
- g.setColor(color4);
- g.drawString("Level: "+ skills.getCurrentLevel(skills.RANGE) +"(+" + Rlvlgain + ") Xp: " + RxpGain + "(+" + RxpHour + "/Hr)",14, 363);
- g.drawString("Level: "+ skills.getCurrentLevel(skills.CONSTITUTION) + "(+"+ Hlvlgain +") Xp: " +HxpGain + "(+" + HxpHour + "/Hr)", 11, 392);
- g.fillRoundRect(6, 272, 311, 64, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke2);
- g.drawRoundRect(6, 272, 311, 64, 16, 16);
- g.setColor(color5);
- g.fillOval(522, 121, 42, 43);
- g.setColor(color6);
- g.setStroke(stroke3);
- g.drawOval(522, 121, 42, 43);
- g.setColor(color7);
- g.drawString("Ran: "+ hours + ":" + minutes + ":"
- + seconds, 16, 309);
- g.setColor(color8);
- g.drawString("Time TB: "+ h + ":" + m + ":" + s, 138, 308);
- g.setFont(font2);
- g.setColor(color2);
- g.drawString("#GOD Pvt. Crab Slayer", 10, 292);
- g.setFont(font3);
- g.setColor(color9);
- g.drawString(""+status, 15, 332);
- g.setFont(font4);
- g.setColor(color2);
- g.drawString(""+foodEat, 526, 152);
- }
- //END: Code generated using Enfilade's Easel
- }
- }
- // SERVER MESSAGE LISTER
- public void messageReceived(MessageEvent e) {
- try {
- String serverString = e.getMessage();
- if (serverString.contains("just advanced")) {
- log.info("Leveled!");
- }
- if (serverString.contains("Oh dear")) {
- log.severe("Char. Died ! - Logged out");
- state = 7;
- }
- if (serverString.contains("System update in")) {
- log.warning("System Update ! - Logged Out");
- state = 7;
- }
- } catch (Throwable t) {
- }
- }
- }
Add Comment
Please, Sign In to add comment