public void onRepaint(Graphics grphcs) {
drawMouse(grphcs);
strExp = Skills.getExperience(Skills.STRENGTH) - SstrExp;
attExp = Skills.getExperience(Skills.ATTACK) - SattExp;
defExp = Skills.getExperience(Skills.DEFENSE) - SdefExp;
hpExp = Skills.getExperience(Skills.CONSTITUTION) - ShpExp;
runtime = System.currentTimeMillis() - starttime;
strExph = (int) ExpHour(strExp);
attExph = (int) ExpHour(attExp);
defExph = (int) ExpHour(defExp);
hpExph = (int) ExpHour(hpExp);
Graphics2D g = (Graphics2D) grphcs;
g.setRenderingHints(antialiasing);
g.setFont(font1);
g.setColor(color3);
g.drawString("Attack xp/h :" + attExph + " (" + attExp + ")", 555, 310);
g.drawString("Strenght xp/h :" + strExph + " (" + strExp + ")", 556,
332);
g.drawString("Defence xp/h :" + defExph + " (" + defExp + ")", 555, 354);
g.drawString("Hitpoints xp/h :" + hpExph + " (" + hpExp + ")", 556, 376);
g.drawString("Time Running :" + formatTime(runtime), 557, 280);
g.drawString("Status: " + status, 555, 507);
g.drawString("Version " + version, 555, 407);
if (Game.isLoggedIn()) {
int CurrX=Mouse.getLocation().x;
int CurrY=Mouse.getLocation().y;
g.setFont(new Font("Arial", 0, 12));
g.setColor(new Color(255, 100, 100, 150));
if (UseSpecialAttack == true) {
g.drawImage(SpecialAttackBg, 526, 124, null);
SpecTimerSec = SpecTimer / 10;
Height = -2 + ((SpecCurr/3) + 3 - (SpecTimerSec / 10));
Y = 158 - Height;
g.fillRect(526,Y,34,Height);
}
if (UseSpecialAttack == true) {
g.drawImage(SpecialAttack,526,124,null);
g.setFont(new Font("Arial", 0, 16));
if (SpecCurr > 90) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + SpecCurr, 529, 144);
g.setColor(new Color(255, 255, 255));
g.drawString("" + SpecCurr, 528, 143);
} else {
g.setColor(new Color(0, 0, 0));
g.drawString(""+SpecCurr,535,144);
g.setColor(new Color(255,255,255));
g.drawString(""+SpecCurr,534,143);
}
if (SpecCurr < 99) {
g.setFont(new Font("Arial", 0, 12));
g.setColor(new Color(0, 0, 0));
g.drawString(""+SpecTimerSec,539,155);
g.setColor(new Color(255,255,255));
g.drawString(""+SpecTimerSec,538,154);
}
}
if (UseVengeance == true) {
g.drawImage(VenganceBg,690,127,null);
Height = 30 - VengTimer / 10;
Y = 157 - Height;
g.setColor(new Color(255, 255, 255, 150));
g.fillRect(690,Y,30,Height);
g.setFont(new Font("Arial", 0, 12));
g.drawImage(Vengance,690,127,null);
VengTimerSec = VengTimer / 10;
g.setFont(new Font("Arial", 0, 12));
g.setColor(new Color(0, 0, 0));
g.drawString(""+VengTimerSec,728,153);
int Red = VengTimer;
int Green = 300 - VengTimer;
if ( Red > 254 ) {
Red = 254;
}
if ( Red < 1 ) {
Red = 0;
}
if ( Green > 254 ) {
Green = 254;
}
if ( Green < 1 ) {
Green = 0;
}
g.setColor(new Color(Red, Green, 0));
g.drawString(""+VengTimerSec, 727, 152);
g.drawImage(VengPic, 700, 134, null);
if (VengTimerSec > 0) {
g.drawImage(VengPicNotReady, 700, 134, null);
}
}
if (FreezeTimer > 0 || OptionMenuOpen == true) {
if (UseFreeze == true) {
g.drawImage(BarragePicture, FreezeX, FreezeY, null);
g.setFont(new Font("Arial", 0, 24));
g.setColor(new Color(0, 0, 50));
g.drawString("" + (FreezeTimer / 10), FreezeX + 30, FreezeY + 71);
}
}
{
g.drawImage(Options, 611, 297, null);
}
{
OptionMenuOpen = true;
}
if (Mouse.isPressed() && CurrX > 216 && CurrX < 316 && CurrY > 433 && CurrY < 465) {
OptionMenuOpen = false;
}
if (OptionMenuOpen == true) {
g.drawImage(OptionsBackground, 0, 338, null);
g.drawImage(Confirm, 217, 435, null);
if (!Mouse.isPressed()) {
Clicked = false;
MoveHitPredictor = false;
MoveStatGrabber = false;
MoveFreeze = false;
}
//======= HitPredictor, Move and Toggle. =======
if (UseHitPredictor == true) {
g.drawImage(OnButton, 287, 352, null);
} else {
g.drawImage(OffButton, 287, 352, null);
}
if (UseHitPredictor == false && Clicked == false && Mouse.isPressed() && CurrX > 287 && CurrX < 358 && CurrY > 352 && CurrY < 372) {
UseHitPredictor = true;
Clicked = true;
}
if (UseHitPredictor == true && Clicked == false && Mouse.isPressed() && CurrX > 287 && CurrX < 358 && CurrY > 352 && CurrY < 372) {
UseHitPredictor = false;
Clicked = true;
}
if (UseHitPredictor == true && MoveStatGrabber == false && MoveFreeze == false && Mouse.isPressed() && CurrX > HitPredX && CurrX < HitPredX + 88 && CurrY > HitPredY && CurrY < HitPredY + 29) {
MoveHitPredictor = true;
}
if (MoveHitPredictor == true) {
HitPredX = CurrX - 44;
HitPredY = CurrY - 14;
}
//======= StatGrabber, Move and Toggle. =======
if (UseStatGrabber == true) {
g.drawImage(OnButton,287, 382, null);
} else {
g.drawImage(OffButton, 287, 382, null);
}
if (UseStatGrabber == false && Clicked == false && Mouse.isPressed() && CurrX > 287 && CurrX < 358 && CurrY > 382 && CurrY < 402) {
UseStatGrabber = true;
Clicked = true;
}
if (UseStatGrabber == true && Clicked == false && Mouse.isPressed() && CurrX > 287 && CurrX < 358 && CurrY > 382 && CurrY < 402) {
UseStatGrabber = false;
Clicked = true;
}
if (UseStatGrabber == true && MoveHitPredictor == false && MoveFreeze == false && Mouse.isPressed() && CurrX > StatGrabberX + 80 && CurrX < StatGrabberX + 550 && CurrY > StatGrabberY && CurrY < StatGrabberY + 29) {
MoveStatGrabber = true;
}
if (MoveStatGrabber == true) {
StatGrabberX = CurrX - 275;
StatGrabberY = CurrY - 14;
}
//======= HpAboveHead, Toggle. =======
if (UseHpAboveHead == true) {
g.drawImage(OnButton, 287, 410, null);
} else {
g.drawImage(OffButton, 287, 410, null);
}
if (UseHpAboveHead == false && Clicked == false && Mouse.isPressed() && CurrX > 287 && CurrX < 358 && CurrY > 410 && CurrY < 430) {
UseHpAboveHead = true;
Clicked = true;
}
if (UseHpAboveHead == true && Clicked == false && Mouse.isPressed() && CurrX > 287 && CurrX < 358 && CurrY > 410 && CurrY < 430) {
UseHpAboveHead = false;
Clicked = true;
}
//======= Freeze Timer - NOT ADDED YET! =======
if (UseFreeze == true) {
g.drawImage(OnButton, 179, 352, null);
} else {
g.drawImage(OffButton, 179, 352, null);
}
if (UseFreeze == false && Clicked == false && Mouse.isPressed() && CurrX > 179 && CurrX < 250 && CurrY > 352 && CurrY < 372) {
UseFreeze = true;
Clicked = true;
}
if (UseFreeze == true && Clicked == false && Mouse.isPressed() && CurrX > 179 && CurrX < 250 && CurrY > 352 && CurrY < 372) {
UseFreeze = false;
Clicked = true;
}
if (UseFreeze == true && MoveHitPredictor == false && MoveStatGrabber == false && Mouse.isPressed() && CurrX > FreezeX && CurrX < FreezeX + 81 && CurrY > FreezeY && CurrY < FreezeX + 117) {
MoveFreeze = true;
}
if (MoveFreeze == true) {
FreezeX = CurrX - 41;
FreezeY = CurrY - 60;
}
//======= VenganceTimer, Toggle. =======
if (UseVengeance == true) {
g.drawImage(OnButton, 179, 382, null);
} else {
g.drawImage(OffButton, 179, 382, null);
}
if (UseVengeance == false && Clicked == false && Mouse.isPressed() && CurrX > 179 && CurrX < 250 && CurrY > 382 && CurrY < 402) {
UseVengeance = true;
Clicked = true;
}
if (UseVengeance == true && Clicked == false && Mouse.isPressed() && CurrX > 179 && CurrX < 250 && CurrY > 382 && CurrY < 402) {
UseVengeance = false;
Clicked = true;
}
//======= SpecialAttackTimer, Toggle. =======
if (UseSpecialAttack == true) {
g.drawImage(OnButton, 179, 410, null);
} else {
g.drawImage(OffButton, 179, 410, null);
}
if (UseSpecialAttack == false && Clicked == false && Mouse.isPressed() && CurrX > 179 && CurrX < 250 && CurrY > 410 && CurrY < 430) {
UseSpecialAttack = true;
Clicked = true;
}
if (UseSpecialAttack == true && Clicked == false && Mouse.isPressed() && CurrX > 179 && CurrX < 250 && CurrY > 410 && CurrY < 430) {
UseSpecialAttack = false;
Clicked = true;
}
}
g.setFont(new Font("Arial", 0, 20));
if (Enemy != null ) {
Enemy.getLocation(); Enemy.getHeight();
Point M = Calculations.isOnScreen((Enemy.getLocation()));
if (Calculations.isOnScreen(M) && UseHpAboveHead == true) {
Character interacting = Players.getLocal().getInteracting();
if(interacting instanceof RSNPC){
g.setColor(new Color(0, 0, 0));
g.drawString("Hp: " + EnemyFinalHp + "%", M.x - 35, M.y - 35);
if (EnemyFinalHp > 50) {
g.setColor(new Color(0, 255, 0));
}
if (EnemyFinalHp < 51) {
g.setColor(new Color(255, 0, 0));
}
g.drawString("Hp: " + EnemyFinalHp + "%", M.x - 35, M.y - 35);
} else {
if (EnemyFinalHp > 100) {
g.setColor(new Color(0, 0, 0));
g.drawString("Hp: " + EnemyFinalHp + " / " + EnemyHp, M.x - 50, M.y - 40);
if (EnemyFinalHp / EnemyHp * 100 > 50) {
g.setColor(new Color(0, 255, 0));
}
if (EnemyFinalHp / EnemyHp * 100 < 51) {
g.setColor(new Color(255, 0, 0));
}
g.drawString("Hp: " + EnemyFinalHp + " / " + EnemyHp, M.x - 50, M.y - 40);
}
if (EnemyHp == 10) {
g.setColor(new Color(0, 0, 0));
g.drawString("Hp: " + EnemyFinalHp + "%", M.x - 35, M.y - 40);
if (EnemyFinalHp > 50) {
g.setColor(new Color(0, 255, 0));
}
if (EnemyFinalHp < 51) {
g.setColor(new Color(255, 0, 0));
}
g.drawString("Hp: " + EnemyFinalHp + "%", M.x - 35, M.y - 40);
}
}
}
}
g.setFont(new Font("Arial", 0, 15));
g.drawImage(Report, 404, 481, null);
g.setColor(new Color(255, 255, 255));
g.drawString(""+ EnemyName , 411, 497);
if (UseHitPredictor == true) {
g.drawImage(HitPredictor, HitPredX, HitPredY, null);
if (DisplayFor > 0 && Display < 2000) {
if (hit > 1000) {
hitS = "";
} else {
hitS = Integer.toString((int) hit);
g.setFont(new Font("Arial", 0, 25));
g.setColor(new Color(0, 0, 0, DisplayFor*12));
g.drawString("" + hitS, HitPredX + 14, HitPredY + 24);
g.setColor(new Color(255, 0, 0, DisplayFor*12));
g.drawString("" + hitS, HitPredX + 13, HitPredY + 23);
}
}
}
if (!(UseStatGrabber == false)) {
g.drawImage(StatGrabber, StatGrabberX + 88, StatGrabberY, null);
g.setFont(new Font("Arial", 0, 12));
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyAtt, StatGrabberX + 122, StatGrabberY + 13);
Compare(MyAtt, EnemyAtt);
g.setColor(C);
g.drawString("" + MyAtt, StatGrabberX+121, StatGrabberY + 12);
if (EnemyAtt !=1) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyAtt, StatGrabberX + 133, StatGrabberY + 26);
Compare(EnemyAtt,MyAtt);
g.setColor(C);
g.drawString(""+EnemyAtt, StatGrabberX + 132, StatGrabberY + 25);
}
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyStr, StatGrabberX + 183, StatGrabberY + 13);
Compare(MyStr, EnemyStr);
g.setColor(C);
g.drawString("" + MyStr, StatGrabberX + 182, StatGrabberY + 12);
if (EnemyStr !=1) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyStr, StatGrabberX + 193, StatGrabberY + 26);
Compare(EnemyStr,MyStr);
g.setColor(C);
g.drawString("" + EnemyStr, StatGrabberX + 192, StatGrabberY + 25);
}
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyDef, StatGrabberX + 243, StatGrabberY + 13);
Compare(MyDef, EnemyDef);
g.setColor(C);
g.drawString("" + MyDef, StatGrabberX + 242, StatGrabberY +12);
if (EnemyDef !=1) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyDef, StatGrabberX + 252, StatGrabberY + 26);
Compare(EnemyDef, MyDef);
g.setColor(C);
g.drawString("" + EnemyDef, StatGrabberX + 251, StatGrabberY + 25);
}
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyHp, StatGrabberX + 298, StatGrabberY + 13);
Compare(MyHp, EnemyHp);
g.setColor(C);
g.drawString("" + MyHp, StatGrabberX + 297, StatGrabberY + 12);
if (EnemyHp > 10) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyHp, StatGrabberX + 308, StatGrabberY + 26);
Compare(EnemyHp, MyHp);
g.setColor(C);
g.drawString("" + EnemyHp, StatGrabberX+307, StatGrabberY + 25);
}
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyMagic, StatGrabberX + 363, StatGrabberY + 13);
Compare(MyMagic, EnemyMagic);
g.setColor(C);
g.drawString("" + MyMagic, StatGrabberX + 362, StatGrabberY + 12);
if (EnemyMagic !=1) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyMagic, StatGrabberX + 373, StatGrabberY + 26);
Compare(EnemyMagic, MyMagic);
g.setColor(C);
g.drawString("" + EnemyMagic, StatGrabberX + 372, StatGrabberY + 25);
}
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyRange, StatGrabberX + 423, StatGrabberY + 13);
Compare(MyRange, EnemyRange);
g.setColor(C);
g.drawString("" + MyRange, StatGrabberX + 422, StatGrabberY + 12);
if (EnemyRange !=1) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyRange, StatGrabberX + 433, StatGrabberY + 26);
Compare(EnemyRange, MyRange);
g.setColor(C);
g.drawString("" + EnemyRange, StatGrabberX + 432, StatGrabberY + 25);
}
g.setColor(new Color(0, 0, 0));
g.drawString("" + MyPrayer, StatGrabberX + 483,StatGrabberY + 13);
Compare(MyPrayer, EnemyPrayer);
g.setColor(C);
g.drawString("" + MyPrayer, StatGrabberX + 482, StatGrabberY + 12);
if (EnemyPrayer !=1) {
g.setColor(new Color(0, 0, 0));
g.drawString("" + EnemyPrayer, StatGrabberX + 493, StatGrabberY + 26);
Compare(EnemyPrayer, MyPrayer);
g.setColor(C);
g.drawString("" + EnemyPrayer, StatGrabberX + 492, StatGrabberY + 25);
Graphics2D g1 = (Graphics2D) grphcs;
g1.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON));
Player botter = Players.getLocal();
if ((players != null)
&& (inWilderness())) {
for (Player p : players) {
if ((p != null) && (!p.equals(botter))) {
if (GUI_SETTINGS.TILE.enabled() && p.getLocation().isOnScreen()) {
drawTile(g1, p.getLocation(), colorForLevel(p));
}
if (GUI_SETTINGS.BOUNDING_BOX.enabled() && p.isOnScreen()) {
drawPlayer(g1, p, colorForLevel(p));
}
if (GUI_SETTINGS.NAME_LEVEL.enabled() && p.isOnScreen()) {
drawPlayerInformation(g1, p, colorForLevel(p));
}
}
}
}
}
}
}
}