Advertisement
Guest User

Showing Levels - Pug Tutorials

a guest
Aug 29th, 2014
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. import java.awt.Graphics2D;
  2.  
  3. import org.osbot.rs07.api.ui.Skill;
  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 currentLevel;
  15.     private int beginningLevel;
  16.     private int levelsGained;
  17.    
  18.     // ONSTART() METHOD
  19.     public final void onStart()
  20.     {
  21.         beginningLevel = skills.getStatic(Skill.RUNECRAFTING);
  22.     }
  23.    
  24.     // ONLOOP() METHOD
  25.     @Override
  26.     public int onLoop() throws InterruptedException
  27.     {
  28.        
  29.         return 123;
  30.     }
  31.    
  32.     // ONPAINT() METHOD
  33.     public void onPaint(Graphics2D g)
  34.       {
  35.         Graphics2D gr = g;
  36.         currentLevel = skills.getStatic(Skill.RUNECRAFTING);
  37.         levelsGained = currentLevel - beginningLevel;
  38.         // STANDARD WAY TO DISPLAY LEVELS
  39.         g.drawString("" + beginningLevel, 1,1);
  40.         g.drawString("" + currentLevel, 1,1);
  41.         g.drawString("" + levelsGained, 1, 1);
  42.         // ALT WAY TO DISPLAY LEVELS AS SHOWN IN THREAD
  43.         g.drawString(beginningLevel + " / " + currentLevel + " ( +" + levelsGained + " )", 1, 1);
  44.       }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement