Cyber Syndicate
<center><p style='font-size:120%;'><strong>Welcome to Cyber Syndicate!<strong></p>

You are visiting as a guest; please <strong>register</strong> or <strong>log in</strong>.

Being logged in provides many benefits, including access to the useful <strong>Methods forum</strong>, posting permissions, and voting permissions.

<strong>Enjoy.</strong></center>
Cyber Syndicate
<center><p style='font-size:120%;'><strong>Welcome to Cyber Syndicate!<strong></p>

You are visiting as a guest; please <strong>register</strong> or <strong>log in</strong>.

Being logged in provides many benefits, including access to the useful <strong>Methods forum</strong>, posting permissions, and voting permissions.

<strong>Enjoy.</strong></center>
Cyber Syndicate
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeLatest imagesRegisterLog in

 

 Paint isn't displaying!

Go down 
2 posters
AuthorMessage
SmokeBarrage
Member
Member



Posts : 5
Join date : 2011-02-27

Paint isn't displaying! Empty
PostSubject: Paint isn't displaying!   Paint isn't displaying! Icon_minitimeSun Feb 27, 2011 12:24 pm

So, Yeah title says all...what did I do wrong?
Code:
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Graphics;
import java.awt.Image;

import com.rsbuddy.event.listeners.PaintListener;
import com.rsbuddy.script.ActiveScript;
import com.rsbuddy.script.Manifest;
import com.rsbuddy.script.methods.Bank;
import com.rsbuddy.script.methods.Camera;
import com.rsbuddy.script.methods.Environment;
import com.rsbuddy.script.methods.GrandExchange;
import com.rsbuddy.script.methods.GroundItems;
import com.rsbuddy.script.methods.Inventory;
import com.rsbuddy.script.methods.Mouse;
import com.rsbuddy.script.methods.Objects;
import com.rsbuddy.script.methods.Players;
import com.rsbuddy.script.methods.Skills;
import com.rsbuddy.script.methods.Walking;
import com.rsbuddy.script.util.Random;
import com.rsbuddy.script.wrappers.Area;
import com.rsbuddy.script.wrappers.GameObject;
import com.rsbuddy.script.wrappers.GroundItem;
import com.rsbuddy.script.wrappers.Tile;
import com.rsbuddy.script.wrappers.TilePath;
import java.awt.*;

import javax.imageio.ImageIO;
import java.io.IOException;
import java.net.URL;

//-----IMPORTS-----\\

@Manifest(authors = { "SmokeBarrage" }, keywords = { "hunting, lizards, swamp" }, name = "SmokeLizards Pro", description = "Just Start at the supported hunting place", version = 1.6)
public class SmokeLizardsPro extends ActiveScript implements PaintListener {

   // -----VARIABLES-----\\
   int BANK_BOOTH = 11402;
   int[] NET_ROPE = { 954, 303 };
   int CATCHED = 19675;
   int TO_SET = 19679;
   int TRAPS_SET = 0;
   int SALAS = 0;
   int SALA_PRICE = 0;
   int SALA_ID = 10149;
   String STATUS;
   long startTime = System.currentTimeMillis();
   int startExp = 0;
   int expGained = 0;
   // -----VARIABLES-----\\

   Area HuntArea1 = new Area(new Tile(3540, 3448), new Tile(3556, 3455));

   Tile[] tilesToBank = { new Tile(3552, 3450), new Tile(3539, 3450),
         new Tile(3531, 3445), new Tile(3525, 3440), new Tile(3520, 3444),
         new Tile(3519, 3454), new Tile(3520, 3459), new Tile(3525, 3469),
         new Tile(3527, 3476), new Tile(3525, 3488), new Tile(3519, 3495),
         new Tile(3517, 3505), new Tile(3513, 3510), new Tile(3507, 3503),
         new Tile(3502, 3496), new Tile(3502, 3489), new Tile(3505, 3483),
         new Tile(3510, 3480) };
   TilePath pathToBank;

   Tile[] tilesToLiz = { new Tile(3510, 3478), new Tile(3503, 3484),
         new Tile(3500, 3493), new Tile(3502, 3500), new Tile(3507, 3508),
         new Tile(3515, 3515), new Tile(3525, 3504), new Tile(3522, 3497),
         new Tile(3525, 3489), new Tile(3526, 3478), new Tile(3525, 3471),
         new Tile(3522, 3463), new Tile(3518, 3457), new Tile(3518, 3449),
         new Tile(3520, 3441), new Tile(3531, 3442), new Tile(3539, 3449),
         new Tile(3549, 3451), new Tile(3552, 3451) };
   TilePath pathToLiz;

   @Override
   public boolean onStart() {
      Mouse.setSpeed(Random.nextInt(3, 4));
      startTime = System.currentTimeMillis();
      SALA_PRICE = GrandExchange.lookup(SALA_ID).getGuidePrice();
      log("Welcome to SmokeLizards");
      pathToBank = Walking.newTilePath(tilesToBank);
      pathToLiz = Walking.newTilePath(tilesToLiz);

      return true;
   }

   @Override
   public int loop() {
      if (Inventory.isFull()) {
         if (Inventory.getCount() + 2 * TRAPS_SET == 28) {
            if (atBank()) {
               doBank();
            } else {
               walk();
            }
         } else {
            pickTraps();
         }
      } else {
         if (atLiz1() && Skills.getCurrentLevel(Skills.HUNTER) < 40
               && TRAPS_SET < 2) {
            set();
            catched();
            fallen();
         } else if (Skills.getCurrentLevel(Skills.HUNTER) > 40
               && TRAPS_SET < 3) {
            set();
            catched();
            fallen();
         } else {
            walkR1();

         }
      }
      return Random.nextInt(300, 500);
   }

   private boolean atLiz1() {
      // TODO Auto-generated method stub
      return false;
   }

   private void set() {
      // TODO Auto-generated method stub

   }

   private void fallen() {
      // TODO Auto-generated method stub

   }

   private void catched() {
      // TODO Auto-generated method stub

   }

   private void walkR1() {
      // TODO Auto-generated method stub

   }

   private void pickTraps() {
      // TODO Auto-generated method stub

   }

   private void walk() {
      // TODO Auto-generated method stub

   }

   private void doBank() {
      STATUS = "Banking...";
      if (Bank.isOpen()) {
         Bank.depositAllExcept(NET_ROPE);
         sleep(800, 1200);
      } else {
         Bank.open();
         sleep(1800, 2200);
      }

   }

   private boolean atBank() {
      STATUS = "Open Bank...";
      GameObject bank = Objects.getNearest(BANK_BOOTH);
      if (bank != null)
         if (bank.isOnScreen()) {
            return true;
         }
      return false;
   }

   @Override
   public void onFinish() {
      log("Thanks for using SmokeLizards Pro!");
      Environment.saveScreenshot(true);

   }

   private Image getImage(String url) {
      try {
         return ImageIO.read(new URL(url));
      } catch (IOException e) {
         return null;
      }
   }

   public void onRepaint(Graphics g) {
      // -----EXP-----\\
      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 minutes2 = minutes + (hours * 60);
      float salassec = 0;
      if ((minutes > 0 || hours > 0 || seconds > 0) && SALAS > 0) {
         salassec = ((float) SALAS)
               / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
         

         float xpsec = 0;
         if ((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
            xpsec = ((float) expGained)
                  / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
            
            expGained = Skills.getCurrentExp(Skills.HUNTER) - startExp;
         }
         // -----EXP-----\\

         // -----MONEY-----\\

         // -----MONEY-----\\

         // -----GENERAL-----\\
         float xpmin = xpsec * 60;
         float xphour = xpmin * 60;
         float salasmin = salassec * 60;
         float salashour = salasmin * 60;
         Color color1 = new Color(255, 255, 255);

         Font font1 = new Font("Arial", 1, 13);

         Image img1 = getImage("http://i55.tinypic.com/9a3ckk.png");
         Image img2 = getImage("http://images2.wikia.nocookie.net/__cb20100728125127/runescape/images/thumb/6/63/Coins_detail.png/100px-Coins_detail.png");
         Image img3 = getImage("http://images.wikia.com/runescape/images/4/48/Hunter_king.png");

         Graphics2D g1 = (Graphics2D) g;
         g.drawImage(img1, 5, 344, null);
         g.setFont(font1);
         g.setColor(color1);
         g.drawString("Runtime: " + hours + ":" + minutes + ":" + seconds,
               7, 383);
         g.drawString("Exp Gained: " + expGained, 7, 400);
         g.drawString("Exp/h:  " + xphour, 7, 417);
         g.drawString("Caught:  " + SALAS, 7, 435);
         g.drawString("Caught/h:  " + salashour, 7, 455);
         g.drawString("Profit: " + SALAS * SALA_PRICE, 267, 382);
         g.drawString("Profit/h: " + salashour * SALA_PRICE, 267, 402);
         g.drawString("Traps set: " + TRAPS_SET, 267, 422);
         g.drawString("Status: " + STATUS, 267, 442);
         g.drawImage(img2, 318, 400, null);
         g.drawImage(img3, 405, 356, null);
      }
      // -----GENERAL-----\\
   }

}
Back to top Go down
b0xb0x
Administrator
Administrator



Posts : 130
Join date : 2011-02-25
Age : 28
Location : California

Paint isn't displaying! Empty
PostSubject: Re: Paint isn't displaying!   Paint isn't displaying! Icon_minitimeSun Feb 27, 2011 12:27 pm

Move the end bracket from line 245 to line 201 Smile It isn't displaying because you have it coded to display only if the condition on line 198 is met.
Back to top Go down
https://cybersyndicate.forumotion.com
SmokeBarrage
Member
Member



Posts : 5
Join date : 2011-02-27

Paint isn't displaying! Empty
PostSubject: Re: Paint isn't displaying!   Paint isn't displaying! Icon_minitimeSun Feb 27, 2011 12:34 pm

wow...ty:DIt's working:D
Back to top Go down
Sponsored content





Paint isn't displaying! Empty
PostSubject: Re: Paint isn't displaying!   Paint isn't displaying! Icon_minitime

Back to top Go down
 
Paint isn't displaying!
Back to top 
Page 1 of 1
 Similar topics
-
» Paint for my UniCash script
» Salvation's paint diary
» ClickableURL class for paint
» Paint makes "Uber-Lagg"

Permissions in this forum:You cannot reply to topics in this forum
Cyber Syndicate :: Development :: Scripting Help-
Jump to: