Jump to content

LoudPacks

Members
  • Posts

    926
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by LoudPacks

  1. It's called a regular expression, REGEX for short. Once you learn the syntax you can use it to build a regular expression that can be used to match parts of text or extract certain patterns from text. In this case, ".*\\d+.*" looks for any amount of text:" .*" followed by a number or series of numbers "\\d+", followed by any amount of text ".*" so any string that contains a number in it would be a match, for example "Amulet of glory (4)", "Amulet of glory (" is matched by the first ".*" the "4" is matched by the "\\d+" and the ")" is matched by the second ".*" but would also still match if there was no text after the 4.
  2. protected class WebWalk { private WebWalkEvent e = null; private boolean teleports = true; private boolean skills = false; private boolean quests = false; public void allowTeleports(boolean b) { teleports = b; } public void allowSkillLinked(boolean b) { skills = !b; } public void allowQuestLinked(boolean b) { quests = !b; } public void walk(Area walkArea, int thresh) { if (e == null || e.hasFailed() || e.hasFinished()) { e = new WebWalkEvent(walkArea); PathPreferenceProfile profile = new PathPreferenceProfile(); profile.setAllowTeleports(teleports); profile.ignoreAllSkillLinks(skills); profile.ignoreAllQuestLinks(quests); profile.checkInventoryForItems(true); e.setPathPreferenceProfile(profile); e.setBreakCondition(new Condition() { @@Override public boolean evaluate() { return false; } }); api.execute(e); } } }
  3. Area dest = new Area(x1,y1,x2,y2); getWalking.webWalk(dest.getRandomPosition());
  4. I want to be able to zoom in using scaling but right now it scales relative to the top left corner and I want to be able to scale based on my mouse position. Does any one have any ideas on how I can make this happen? This is how it looks as of now, scaling into the top left corner. Code: import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.MouseInfo; import java.awt.Point; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class PictureFrame { private ImageCanvas canvas; public PictureFrame(String filePath) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createFrame(filePath); } }); } public PictureFrame(Image image) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createFrame(image); } }); } private void createFrame(String filePath) { JFrame frame = new JFrame("Picture Frame Test"); frame.setSize(800, 600); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); canvas = new ImageCanvas(filePath, frame.getWidth(), frame.getHeight()); frame.getContentPane().add(canvas); frame.setVisible(true); } private void createFrame(Image image) { JFrame frame = new JFrame("Picture Frame Test"); frame.setSize(800, 600); frame.setResizable(false); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); canvas = new ImageCanvas(image, frame.getWidth(), frame.getHeight()); frame.getContentPane().add(canvas); frame.setVisible(true); } private class ImageCanvas extends JComponent { private Image image; private AffineTransform transformer = new AffineTransform(); ImageCanvas(String filePath, int width, int height) { try { image = ImageIO.read(new File(filePath)); setSize(width, height); EventListener eventListener = new EventListener(); addMouseListener(eventListener); addMouseWheelListener(eventListener); addMouseMotionListener(eventListener); } catch (IOException e) { System.out.println("Unable to read image file!"); } } ImageCanvas(Image image, int width, int height) { this.image = image; setSize(width, height); EventListener eventListener = new EventListener(); addMouseListener(eventListener); addMouseWheelListener(eventListener); addMouseMotionListener(eventListener); } public double getMinScale(){ double limitX = (double) canvas.getWidth() / (double) canvas.getImage().getWidth(null); double limitY = (double) canvas.getHeight() / (double) canvas.getImage().getHeight(null); return (limitX > limitY) ? limitX : limitY; } public Image getImage(){ return image; } public AffineTransform getTransformer(){ return transformer; } @[member=Override] protected void paintComponent(Graphics g) { try { Graphics2D graphics = (Graphics2D) g; graphics.setTransform(transformer); Point mouse = MouseInfo.getPointerInfo().getLocation(); SwingUtilities.convertPointFromScreen(mouse, this); graphics.drawImage(image, 0, 0, image.getWidth(null), image.getHeight(null), null); graphics.setColor(Color.BLACK); graphics.fillRect(0, 0, 90, 15); graphics.setColor(Color.WHITE); graphics.drawString(String.format("X: %.0f Y: %.0f", mouse.getX(), mouse.getY()), 10, 10); Thread.sleep(15); } catch (InterruptedException e) { e.printStackTrace(); } } } private class EventListener implements MouseListener, MouseWheelListener, MouseMotionListener { private Point startPoint, endPoint; private double deltaX, deltaY; @[member=Override] public void mouseWheelMoved(MouseWheelEvent e) { AffineTransform transformer = canvas.getTransformer(); if(e.getWheelRotation() < 0) transformer.setToScale(transformer.getScaleX() + .05, transformer.getScaleY() + .05); else transformer.setToScale(Math.max(canvas.getMinScale(), transformer.getScaleX() - .05), Math.max(canvas.getMinScale(), transformer.getScaleY() - .05)); transformer.translate(deltaX, deltaY); canvas.repaint(); } @[member=Override] public void mouseClicked(MouseEvent e) { } @[member=Override] public void mousePressed(MouseEvent e) { startPoint = e.getPoint(); } @[member=Override] public void mouseReleased(MouseEvent e) { } @[member=Override] public void mouseEntered(MouseEvent e) { } @[member=Override] public void mouseExited(MouseEvent e) { } @[member=Override] public void mouseDragged(MouseEvent e) { AffineTransform transformer = canvas.getTransformer(); try { endPoint = e.getPoint(); Point dragStart = transformPoint(startPoint); Point dragEnd = transformPoint(endPoint); /* double dx = dragEnd.getX() - dragStart.getX(); double dy = dragEnd.getY() - dragStart.getY(); deltaX += dx; deltaY += dy; */ double deltaW = (double) canvas.getWidth() - (double) canvas.getImage().getWidth(null) * transformer.getScaleX(); double deltaH = (double) canvas.getHeight() - (double) canvas.getImage().getHeight(null) * transformer.getScaleY(); double px = Math.max(deltaW, Math.min(0, deltaX + (dragEnd.getX() - dragStart.getX()))); double dx = px - deltaX; double py = Math.max(deltaH, Math.min(0, deltaY + (dragEnd.getY() - dragStart.getY()))); double dy = py - deltaY; deltaX = px; deltaY = py; transformer.translate(dx, dy); startPoint = endPoint; endPoint = null; } catch (NoninvertibleTransformException ex) { ex.printStackTrace(); } canvas.repaint(); } @[member=Override] public void mouseMoved(MouseEvent e) { canvas.repaint(); } private Point transformPoint(Point p1) throws NoninvertibleTransformException{ AffineTransform transformer = canvas.getTransformer(); AffineTransform inverse = transformer.createInverse(); Point p2 = new Point(); inverse.transform(p1, p2); return p2; } } }
  5. nah u gotta have that high class swag to attract the grillz
  6. Half pepperoni, Half bacon and pineapple, with extra cheese. Does the build your own come with a drink too? Id like a 2 liter sprite.
  7. The same way you check it when you're not using mirror mode
  8. Did you add the components to the panel? Try using a different layout manager
  9. PIP oesteoarthritis, rheumatoid arthritis, or lupus. Use heat packs and avoid the computer until you see your doctor.
  10. In what position is the pain the worst and where exactly in the pain located?
  11. Some of my many unreliable scripts
  12. Also, similarly if we assume the flux is indefinitely variable (ie. 0 < a < h < infinity) ,
  13. I don't. It's too much effort plus bans and minimal return. Easier for me to sell scripts to people trying to make money.
  14. I know more than you ever will as far as programming and anything else in general. In the past it was done using configs, then the configs were removed. In the last OSBot update they did add these hooks to the API, which I didn't notice as I've been busy with school and havent checked the updated API docs. I see now that they are included so a pleb such as yourself can use the now existing API methods: Not once did I change my mind. Using configs to accomplish something (which was the only way to do it prior to last update and before said configs were removed) is not the same as using a predefined method in the api therefore I never changed my mind. Since these are in the API, you never should have posted here to begin with as you could have easily done some searching and found the solution to your issue.
  15. Well yes of course there is a hook, its not black magic. However, OSBot doesn't have this hook in their API so as far as OP is concerned it is not possible / outside his scope of knowledge (unless of course he can find the class and field names and write his own hook). EDIT: I didn't notice Alek snuck them into in the last update so he easily could have read thru the docs before posting.
  16. What configs did you use to check and what were their values?
  17. No it is not. Jagex removed these configs along with some farming configs. There is no way to detect the status of your offers without having the interface open. Before these updates, there were configs that showed the status of the offer but they no longer exist. Box Offers (While open) --------------- ID: [375] Box 1: 0 -> 16 Box 2: 0 -> 32 Box 3: 0 -> 48 Box 4: 0 -> 64 Box 5: 0 -> 80 Box 6: 0 -> 96 Box 7: 0 -> 112 Box 8: 0 -> 128 Active Offer (While open) ----------------------- ID: [1151] - item id ID: [563] - item amount ID: [1043] - item price
  18. @ScriptManifest(author = "LoudPacks", info = "", logo = "imgur_link_to_180x180_thumbnail, name = "[Private] Merching", version = 1.0)
  19. LoudPacks

    :?:

    Happens to me when I have the chatbox open.
  20. LOL I know this guy. Im actually buying a bunch of P2P accs from him for the low. He's a scripter and farmer. Edit: hes actually a fag and scammed me. I had a feeling tho since he was gonna give me 5 members accs for 4m.
  21. Ah, I've never used javaFX but I figured it was worth a shot.
×
×
  • Create New...