Jump to content

Bobrocket

Members
  • Posts

    1664
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    100%

Posts posted by Bobrocket

  1. Lads let's start a merching clan right here...

    Guam tar, current price like 2gp but i expect it to rise to 200000000000000gp so buy it all at around 5gp :^)

    (pls buy my guam tar)

    • Like 1
  2. Simple suggestion, and it would help my thieving script a lot.

    Player#isStunned() - checks if the player is stunned.

    The way I currently do this is by checking the player height at the beginning of the script and whenever I'm running code to see if my new height is higher (when you are stunned, your height goes up by 7-8). This can be inaccurate at times, but it works.

     

    In short, have a method that checks if the player is stunned (and maybe even stun time remaining).

    Thanks :D

    • Like 2
  3. Thanks it's working!

     

    Also I'm having one last issue with the door.

     

    My current code to handle the door is this:

            if(!myPlayer().isMoving()) {
                RS2Object largeDoor = objects.closest(new Filter<RS2Object>() {
                    @Override
                    public boolean match(RS2Object rs2Object) {
                        return rs2Object != null && rs2Object.getName().equals("Large door") && rs2Object.getPosition().equals(new Position(3293,3166,0));
                    }
                });
    
                if(largeDoor != null){
                    getCamera().toEntity(largeDoor);
                    if(largeDoor.isVisible())
                        try {
                            largeDoor.interact("Open");
                            log("Opening the door");
                            return true;
                        }catch(Exception e){
                            log("Door is already open");
                            return false;
                        }
                }
            }
    

    The bot isn't Facing the camera on the door and doesn't interact with it.

     

    Thanks for helping me smile.png

     

    I don't think Camera#toEntity accepts an RS2Object as a parameter (could be wrong).

    Instead, use Entity for objects and NPC for NPCs:

    Entity door = getObjects().closest(new Filter<Entity>() {
     //match code
    });
    
    if (!door.isVisible()) {
        getCamera().toEntity(door);
    }
    
    if (!door.hasAction("Open")) {
        log("Door is open");
        return false;
    }
    door.interact("Open");
    Position p = door.getPosition();
    //Conditional sleep -> check objects at position p, see if they have action "Close"
    log("Door should be open");
    return true;
    

     

  4. No they are not noted. I'm trying to get the number of Jug of water in my inventory.

     

    The API states that #getItem() returns a type of item. The method you want is ItemContainer#getAmount(String ... items)

     

    Usage:

    int amt = getInventory().getAmount("Jug of Water");
    
    • Like 2
  5. Facing camera to NPC: getCamera().toEntity(NPC);

    Is your jug of water noted? inventory.getItem() returns the first found item, so you could be getting an unnoted one (hence getting 1), and none should very well be 0 as there are 0 jugs.

    • Like 1
  6. what if you press start, how would you "close it"?

     

    I always personally leave my GUIs open so people can screenshot them for bug reports, but I believe you can set it to close the GUI without ending the script.

  7. Thanks for the suggestions guys. I implemented SmartKeyboard but it was still a bit slow for my liking (although very good stuff in there). I ended up using some of the code to come up with my own solution. The text isn't instant but typing can be interrupted and will resume where it left off.

     

    Appreciate the help.

     

    If you post your additions in the SmartKeyboard thread I'd be glad to go through and implement them :)

  8. how do I make sure that the user have selected an item? cuz if i just do sleep it may not work some times...

     

    Within GUI (textbox as an example)

    if (textBox.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "You must fill out this text box first!");
        return;
    }
    

    The return; will stop execution of the method. I personally have a boolean in my main class, guiWait, which I then set from true to false when the GUI has applied the settings. I do something like this:

    GUI g = new GUI();
    public static boolean guiWait = true;
    onStart() {
    g.setVisible(true);
    while (guiWait) { sleep(400); }
    }
    
    //GUI
    
    //Button actionPerformed
    if (conditionsMet) {
        ArbitraryScriptClass.guiWait = false;
    }
    else {
        JOptionPane.showMessageDialog(null, "You must select a preset or define a monster first!");
    }
    
    • Like 1
  9.  

    Context: I go up to kids on gmod dark rp servers and tell them I will pay them vast quantities of money in exchange for them singing. To them, these pixels mean everything, so they do it. I also got this kid to rap Rap God, although you can hear my shitty laugh half way through it so I decided not to upload that.

  10. I thought I saw somewhere to install Samsung Kies, so I gave it a try. Looks like I actually needed to install Smart Watch since I have the S6, but that apparently did the trick as whatever driver was missing / not updated became updated. I actually get the RSA confirmation (Which I guess is new on the newer devices) to confirm to run the application. Thanks!

     

    Most big brand android phones have their own software like Kies. Helps with drivers and moving files and such easily. Good luck!

×
×
  • Create New...