Jump to content

harrypotter

Trade With Caution
  • Posts

    397
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by harrypotter

  1. On 4/22/2017 at 11:23 PM, sudoinit6 said:

    I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells.

     

    script.inventory.getItem("Pie dish").interact("Use");
    Script.sleep(Script.random(2000, 3000));
    script.inventory.getItem("Pastry dough").interact("Use");
    Script.sleep(Script.random(800, 1500));
    script.log("debug 1");

    It never gets to writing to the log (or any other action I put there).

     

    Any idea what I am doing wrong?

     

     

    What I would do is start by structuring your script so that if an event fails at anytime, it will simply retry that action only, not the whole loop again (as @Apaec suggested):

    if (!inventory.isItemSelected()) {
        // Use first item
        // Sleep until inventory.isSelected()
    } else {
        // Use first item with second item
        // Sleep until finished making pie shell
    }

    Here is a full example taken from my AIO Herblore script:

    if (!script.inventory.isItemSelected()) {
        Item pestle = script.inventory.getItem("Pestle and mortar");
        if (pestle != null) {
            if (pestle.interact("Use")) {
                Sleep.sleepUntil(() -> script.inventory.isItemSelected(), 5000);
            }
        }
    } else {
        int clickSlot = script.inventory.getSlot(itemToGrind);
        InventorySlotDestination itemSlot = new InventorySlotDestination(script.getBot(), clickSlot);
        script.getMouse().move(itemSlot);
        if (script.getMouse().click(false)) {
            Sleep.sleepUntil(() -> !script.inventory.contains(itemToGrind) || script.getDialogues().isPendingContinuation(), 120000);
        }
    }

     

  2. 2 minutes ago, dabadoodle said:

    Basically im trying to make my first script, a cow killer

    I'm making it to kill cows south of falador but i cant manage to get it to recognize and attack the cows can somebody give me the basic concept for coding this action

    Have a look at this: 

    Should be a good learning resource!

  3. 1 minute ago, aceduece said:

    I'm trying to do soft leather, with ge mode off. I initially tried ge mode on, but the bot tries to buy hides at market price no matter what i put in the ratio boxes. The bot also always heads to the ge, even with ge mode turned off. 

    I'll have a look into this tonight when I'm home.

  4. 3 minutes ago, Facial said:

    No, no and no.

    First I was unable to get the error even with false details, now it gives me the error I want when false details.

    But still wont print my debug function.

    From the snippet you've shown you're not even calling the 

    debug_Connection()

    function?

  5. 13 minutes ago, Facial said:

    Yes, but it still wont print the debug_Connection() function..

    I missed the dbname= in the PDO(), now it also gives me error IF the DB wont exists, but doesnt give me a connection succeed message when I try to print it.

     

    I'm not really sure what you mean, if should return an error if the database table doesn't exist. Why would it give a connection success message when it didn't successfully connect?

    If you're getting an error stating that the db table doesn't exist then double check your table name is correct

  6. Also I believe this:

    $this->connection = new PDO("mysql:host=$this->db_hostname;$this->db_database", $this->db_username, $this->db_password);

    Is invalid, you need to specify that 

    $this->db_datebase

    is the database name:

    $this->connection = new PDO("mysql:host=$this->db_hostname;dbname=$this->db_database", $this->db_username, $this->db_password);

    Might be wrong though

    • Like 2
  7. 10 minutes ago, JARNQ said:

    I've been trying to find out whats wrong but i just can't find the mistake.

    If i'm on the tile where i'm trying to go, nothing happens. ( this is correct )

    But if i'm not on the tile all i see is the "Returning to exact AFK spot." get spammed on log and my character doesn't walk there.

    Can someone point me to the right direction?

     

    This is on my getState:

    
    if (afk.contains(myPlayer()) && !(myPlayer().getX() == 2704) && !(myPlayer().getY() == 3726))
    			return State.AFKSPOT;

    Position:

    
    Position afkspot = new Position(2704, 3726, 0);

    And this is my AFKSPOT case:

    
    case AFKSPOT:
        		getWalking().walk(afkspot);
        		log("Returning to exact AFK spot.");
        		sleep(random(345, 825));
        		break;

     

    Why are you doing:

    !(myPlayer().getX() == 2704)

    Wouldn't:

    myPlayer().getX() != 2704

    Be better?

    As for your question you need to do something like so:

    WalkingEvent walkToSpot = new WalkingEvent(afkspot);
    walkToSpot.setMinDistanceThreshold(0); 
    execute(walkToSpot);

     

  8. Disputed member: https://osbot.org/forum/profile/93838-chrisscott99/

    Thread Link: 

     

    Explanation:

    Fee of 150m for service + 15m for supplies was agreed. 150m paid @Decode MM.

    User received login details for account that contained 15m supply cash.

    *Hidden*

    User states he will only be online for another hour, this implies he's already on the account (If the 15m wasn't on the account he would ask about it? - this is in the likely event that he's going to claim the gp was never palced on the account in the first place).

    *Hidden*

    This morning I asked him about his progress to which he replied:

    *Hidden*

    A few hours later around 12pm I checked the accounts stats against an xp tracking website I submitted the account to: http://www.crystalmathlabs.com/tracker/track.php?player=lane+zoo+64

    Given that the account was fresh from tut island some progress should have been made in a few hours of play time, I was worried at this point and decided to login to the account to check the progress. I found the account in lummy where I left it with the gp gone.

    Evidence: ^^ See Explanation

×
×
  • Create New...