Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • hasAction incorrect


    DeadmanVlei

    Recommended Posts

    I'm trying to find the "Climb-up" action of a given wall and i'm not getting back a true return from gm.hasAction("Climb-up").  I believe this function is partially broken.

    The wall has Actions: [null, null, <a_bunch_of_encrypted_characters>, Climb-up, null, null]

    perhaps the encrypted characters are throwing off the loop.

     

    Additionally, the reason I'm trying to do this is because .interact() gets stuck if there's a tree in the way, which seems like it should be a bug in itself.

     

    EDIT: It seems the problem is that some actions begin with encrypted characters.  I suggest that hasAction search for strings that contain the given string, as opposed to that exact string.

    EDIT: Now the problem is though that interact() does not search the string, so I can't do it this way.  On my end I'll be using the actual action index to pass the action back, but I believe this should still be addressed.

    EDIT: My fix didn't work.  An exception was thrown when I tried to iterate through the actions, and when I try to do gm.interactForceRight(gm.getActions[2]); the mouse hovers over the object but doesn't click.  Either interact needs to be fixed to properly move the camera and not click when it's clearly hovering over a tree, or we need to properly be able to look at the actions of a GameObject. This combination of problems makes me kind of disappointed in dreambot, as this is basic interaction.

    Link to comment
    Share on other sites

    What you're experiencing sounds rather peculiar, try something like this and see if it works/make any difference:

     

    for (String s : ob.getActions()) { if (s != null && s.contains("text")) { doAction } }

    Link to comment
    Share on other sites

    That's almost exactly the code I was using at the last edit. Trying to loop through getactions and compare what was returned with a string was breaking my code, I assume because of unrecognized characters in the action string in question.

    Due to the unrecognized characters the string in the game debugger looked something like "|[ ][ ][ ]Climb-up"

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.