Created
January 31, 2013 16:19
-
-
Save TheBatScripts/4684045 to your computer and use it in GitHub Desktop.
Textures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package scripts; | |
| import java.awt.Color; | |
| import java.awt.Graphics; | |
| import java.awt.Rectangle; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import org.tribot.api.Textures; | |
| import org.tribot.api.input.Mouse; | |
| import org.tribot.api.types.Texture; | |
| import org.tribot.script.Script; | |
| import org.tribot.script.ScriptManifest; | |
| import org.tribot.script.interfaces.Painting; | |
| @ScriptManifest(authors = { "TheBat" }, category = "Tools", name = "Texures") | |
| public class TextureGrabber extends Script implements Painting{ | |
| private Texture[] texts; | |
| private ArrayList<Texture> draw = new ArrayList<Texture>(); | |
| private HashMap<Integer,Color> colors = new HashMap<Integer,Color>(); | |
| @Override | |
| public void onPaint(Graphics g) { | |
| int y = 100; | |
| texts = Textures.getAll(); | |
| draw.clear(); | |
| for(int i = 0; i < texts.length; i++){ | |
| if(new Rectangle(texts[i].x, texts[i].y, texts[i].width, texts[i].height).contains(Mouse.getPos())){ | |
| draw.add(texts[i]); | |
| } | |
| } | |
| g.setColor(new Color(50,50,50,255)); | |
| g.fillRect(8, 103, 64, (draw.size()*15)+1); | |
| for(int i = 0; i < draw.size(); i++){ | |
| g.setColor(colors.get(i)); | |
| g.drawString(draw.get(i).crc32+"", 10, y+=15); | |
| g.drawRect(draw.get(i).x, draw.get(i).y, draw.get(i).width, draw.get(i).height); | |
| } | |
| } | |
| public boolean onStart(){ | |
| colors.put(0,Color.BLUE); | |
| colors.put(1,Color.GREEN); | |
| colors.put(2,Color.RED); | |
| colors.put(3,Color.YELLOW); | |
| colors.put(4,Color.MAGENTA); | |
| colors.put(5,Color.CYAN); | |
| colors.put(6,Color.ORANGE); | |
| colors.put(7,Color.PINK); | |
| colors.put(8,Color.BLUE.brighter().brighter()); | |
| colors.put(9,Color.GREEN.brighter().brighter()); | |
| colors.put(10,Color.RED.brighter().brighter()); | |
| colors.put(11,Color.YELLOW.brighter().brighter()); | |
| colors.put(12,Color.MAGENTA.brighter().brighter()); | |
| colors.put(13,Color.CYAN.brighter().brighter()); | |
| colors.put(14,Color.ORANGE.brighter().brighter()); | |
| colors.put(15,Color.PINK.brighter().brighter()); | |
| colors.put(16,Color.BLUE.darker().darker()); | |
| colors.put(17,Color.GREEN.darker().darker()); | |
| colors.put(18,Color.RED.darker().darker()); | |
| colors.put(19,Color.YELLOW.darker().darker()); | |
| colors.put(20,Color.MAGENTA.darker().darker()); | |
| colors.put(21,Color.CYAN.darker().darker()); | |
| colors.put(22,Color.ORANGE.darker().darker()); | |
| colors.put(23,Color.PINK.darker().darker()); | |
| return true; | |
| } | |
| public int loop(){ | |
| return 100; | |
| } | |
| public void onStop(){ | |
| } | |
| @Override | |
| public void run() { | |
| if(onStart()){ | |
| while(!Thread.interrupted() && loop()>=0){} | |
| onStop(); | |
| }else println("Script failed to start!"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment