Jump to content

lisabe96

Members
  • Posts

    821
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by lisabe96

  1. 7SNOPDX.png


     


     


    - Completes tutorial island for you -


    - Randomizes character appearance for "less bot like look" -


    - Uses webwalking & random interaction choices to avoid patterns -


    - Picks up progress anywhere (so you can start the bot at any time) - 


    - Finished in 7 minutes! -


    - Now turns off music! -


     


     


     


    Version 2.5


    Click here to download!


    Place the downloaded jar in "c:\Users\YOUR_USER\osbot\scripts\"


     


    O3FAFCp.png


     


    NK8Mkj9.png


     


     


     


    If you find any bugs, please report them so I can fix them.


    • Like 7
  2.  

    You would use a rectangle for that. Something along the lines of:

    public static final Rectangle BUTTON_AREA = new Rectangle(413,388,58,70); // (x,y,width,height)
    
    @Override
    public void mouseClicked(MouseEvent event) {
    	int x = event.getX();
    	int y = event.getY();
    		
    	if (BUTTON_AREA.contains(x,y)) {
    		powerfishing = !powerfishing;
    		displayImage = powerfishing ? powerImg : normalImg;
    	}
    }
    
    @Override
    public void mouseMoved(MouseEvent event) {
    	int x = event.getX();
    	int y = event.getY();
    
    	tooltip = BUTTON_AREA.contains(x,y);
    }
    

    I feel like it's a bit overkill here as I have no other similar situations and only have to check twice.

    However you'd be right if you said it's a more proper way of doing it

  3.     public boolean isPendingContinuation() {
            if (this.inDialogue()) {
                int IIiiiiIiii = this.IIiiiiIiii(IIiiIiIIII);
                if (IIiiiiIiii > 0) {
                    if(this.widgets.getWidgetContainingText(IIiiiiIiii, new String[]{"to continue", "please wait..."}) != null) {
                        return true;
                    }
    
                    return false;
                }
    
                List<RS2Widget> matching = this.widgets.containingText(new String[]{"to continue", "please wait..."});
                if (matching != null && !matching.isEmpty()) {
                    IIiiIiIIII.add(Integer.valueOf((matching.get(0)).getRootId()));
                    return true;
                }
            }
    
            return false;
        }
    

    Apparently osbot's logic is flawing then because it doesn't work half of the time, while frostbug's solution does all the time

  4.  

    Sounds like a bug with the continuation method; perhaps the dialogues are different on tutorial island

     

    try something like this instead

    List<RS2Widget> diag = getWidgets().containingText("Click here to continue");
    if(!diag.isEmpty()) {
        diag.get(0).interact();
    }
    

    It's weird, it sometimes works and sometimes not.

    Ill try your solution.

     

     

    Edit:

    Seems to be working this way, thanks!

  5. 2ldIsLR.png

    if (script.getDialogues().inDialogue()) {
    	if (script.getDialogues().isPendingContinuation()) {
    		script.getDialogues().clickContinue();
    		break;
    	}
    }
    

    When I log the code,

    It says that I'm in a dialogue, but not that there's pending continuation.

    With other words, I'm stuck as it doesn't continue the dialogue.

     

    Am I missing something?

     

     

     

  6. instead of this boolean

     if (x > 413 && x < 471 && y > 388 && y < 458) {

     

    you could grab the position of the click. Use the shape of your button and see if the click is within the shape. be sides that your good.

    The image is transparent, and I don't want users to have to click inside the fish, that would be a bad

    case of UI handling. It has to work when they click the area around it as well.

    s05zeOD.png

  7. @Override
    public void onStart() {
    	getBot().addMouseListener(this);
    		
    	try {
    		normalImg = ImageIO.read(new URL("https://i.imgur.com/tXYml3w.png"));
    		powerImg = ImageIO.read(new URL("https://i.imgur.com/LVpXu5C.png"));
    		displayImage = normalImg;
    	} catch (MalformedURLException e) {
    		e.printStackTrace();
    	} catch (IOException e) {
    		e.printStackTrace();
    	}
    }
    
    @Override
    public void mouseClicked(MouseEvent event) {
    	int x = event.getX();
    	int y = event.getY();
    		
    	if (x > 413 && x < 471 && y > 388 && y < 458) {
    		powerfishing = !powerfishing;
    		displayImage = powerfishing ? powerImg : normalImg;
    	}
    }
    
    @Override
    public void mouseMoved(MouseEvent event) {
    	int x = event.getX();
    	int y = event.getY();
    
    	tooltip = x > 413 && x < 471 && y > 388 && y < 458;
    }
    
    @Override
    public void onPaint(Graphics2D graphics) {
    	Graphics2D g = (Graphics2D) graphics;
    	g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF));
    		
    		
    	if (displayImage != null) {
    		graphics.drawImage(displayImage, 420, 400, null);
    	}
    	if (tooltip) {
    		g.setColor(Color.BLUE);
    		g.drawString("Click to " + (powerfishing ? "disable" : "enable") 
    			+ " powerfishing.", 311, 15);
    	}
    }
    

    Got it all working perfectly smile.png

    Thanks, code posted for people looking for this in the future

    • Like 2
  8. Drawing a button is of course just g.drawX(...) in onPaint. Next, you basically just implement MouseListener (or extend MouseAdapter) and tell osbot you want to receive mouse events bot.addMouseListener(yourListener).  Then you implement mouseClicked(MouseEvent e), e has a property which gives you the location of the click, you can use this to determine if the click was within the bounds of your button.

    Oh so it's basically just default java implementation, I was expecting something more complex built into the API.

    Thanks I think i can figure it out

    • Like 1
  9. I have only 1 option for the user to chose and it's kinda ridiculous to make a GUI for that,

    so I'd like to draw a toggle button to the game screen and handle it when it's clicked by the user.

    I have no experience what so ever with this, how would I go about implementing this?

  10. and i'm telling you it's not lol. think about your parents, they are probably not very techy. they dont know where the hell the startupfolder is or how to locate it, but they might want x program or x file to start when windows boots. 

     

    and there are a lot of people that don't know how to locate the windows startup folder, because they simply never heard of it. sure you and i and a lot of people here are understanding with windows, but a lot of people aren't, keep that in mind wink.png

     

    Fair enough I guess :doge:

  11. did you even read the post? i litteraly said that, and that it's so easy, but not everyone knows how to, this program is dedicated to people that dont know a lot about windows

     

    No offense, sure you learned some things and enjoy making stuff without purpose, because so do I.

    But if you can't drag a shortcut into a folder you wont be able to use this program either :p

    This is uber useless :doge:

  12. - Fixed an issue where when out of bars it would keep trying to smith anyways.

    - Added anti-pattern and pseudo anti-ban options.

    - Tweaked some things

    - Can be started anywhere, any time (will go get utilities on it's own)

     

     

     

    I would love to push this to the SDN but lack the rsgp for a 2 hour proggy tongue.png

    If anybody could help me out with a proggy that'd be great!

  13. FYI, in this case. If the interface is null, it's also not visible.

    if(w != null) getKeyboard().typeString("5"); else log("Widget not found");

    will also work.

    Don't kill me when I'm wrong but with isVisible(); I'm assuming it's actually visible on the screen.

    This means that the widget might not be null, but because of e.g. lag it's not visible instantly yet.

    So checking if it's visible would be a good thing over only checking if it's not null.

    • Like 2
  14. NXLvuph.png


     


     


     


    Smiths any type of bar into items.


    Checks for better items on level-up.


    Uses the fast & close Varrock West location.


     


     


     


     


    No worries when you were in a rush and forgot to put a hammer in your inventory.


    The bot will get it out of your bank for you.


     


    Got different kinds of bars? No problem either, if you toggle "continuation" mode,


    the bot auto-switches bars until all the bars in your bank are done.


    If you only want to do one type of bar, just use "specific" mode.


     


     


     


    Current version: 1.1


    Download here!


     


    Put the downloaded JAR inside "c:\Users\YOUR_USER\osbot\scripts\" and refresh your scripts list in your client.


     


     


    aJGCs7C.png


    DmO4m9c.png


    111LSWJ.png


     


    As always, report any bugs so I can fix them.


     


    If anybody could post a longer proggy that'd be great. I'm too poor for long smithing sessions doge.png


    • Like 2
  15. No offense, but shouldn't scripter 1 be able to at least know how to use widgets?

    Use sure, thinking about it is another thing :D

    As this is dialogue related to me I was thinking dialogues and not widgets.

    Will try to get it working with widgets in a bit

  16. the enum is entirely redundant

    Not at all as not all banks are in the API and some are a bit off.

    But I read that the next API update will have those fixed

     

    Edit: well right now in OP's case it is indeed

×
×
  • Create New...