Advertisement
Guest User

Calculations of Profits - Pug Tutorials

a guest
Aug 29th, 2014
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. import java.awt.Graphics2D;
  2. import java.text.DecimalFormat;
  3.  
  4. import org.osbot.rs07.script.Script;
  5. import org.osbot.rs07.script.ScriptManifest;
  6.  
  7.  
  8. @ScriptManifest(name="ExampleScript", author="author", info="1.0", logo="", version=1.0D)
  9. public final class paintScript
  10.   extends Script
  11. {
  12.  
  13.     // PAINT VARIABLE DECLARATIONS
  14.     private int costOfItem;
  15.     private int itemsMade;
  16.     private double gpGained;
  17.     private double totalGpGained;
  18.    
  19.     // ONSTART() METHOD
  20.     public final void onStart()
  21.     {
  22.         costOfItem = 500;
  23.     }
  24.    
  25.     // ONLOOP() METHOD
  26.     @Override
  27.     public int onLoop() throws InterruptedException
  28.     {
  29.         itemsMade += 1;
  30.         return 123;
  31.     }
  32.    
  33.     // ONPAINT() METHOD
  34.     public void onPaint(Graphics2D g)
  35.       {
  36.         Graphics2D gr = g;
  37.         gpGained = itemsMade - costOfItem;
  38.         totalGpGained = gpGained / 1000;
  39.         DecimalFormat df = new DecimalFormat("#");
  40.         g.drawString("" + df.format(totalGpGained) + " k", 295, 417);
  41.       }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement