1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Charging trident?

Discussion in 'Developer Support' started by louisdearing, Jun 30, 2021.

  1. louisdearing

    Joined:
    Jun 21, 2021
    Messages:
    4
    Likes Received:
    1
    Hi all,

    I'm trying to get my bot to charge the trident but not sure what I should be using. EnterAmountDialog doesn't seem to work, and I'm not sure what alternatives I have.

    Thanks in advance
     
  2. generalsensei

    Joined:
    Apr 21, 2019
    Messages:
    43
    Likes Received:
    9
    Can you post a snippet of your code? Specifically the code that activates this function, the code that brings up the interaction menu, and the code thats supposed to enter the amount?
     
  3. louisdearing

    Joined:
    Jun 21, 2021
    Messages:
    4
    Likes Received:
    1
    Yeah of course.

    Here's what I'm using to activate the function, but this is returning false no matter what I do:

    Code (Text):
    1. ...validate() { return EnterAmountDialog.IsOpen(); }
    This is to bring up the interaction, which works fine:

    Code (Text):
    1. if (coins.click()) {
    2.             if (Execution.delayUntil(()->Inventory.getSelectedItem() != null, 800, 1200)) {
    3.                 staff.click();
    Then to charge I was using this, but this piece of code hasn't been triggered yet so I couldn't tell you if I'm on the right lines. (int amount is determined elsewhere)

    EnterAmountDialog.enterAmount(amount)
     
  4. generalsensei

    Joined:
    Apr 21, 2019
    Messages:
    43
    Likes Received:
    9
    So it seems you're telling the code to activate whenever the EnterAmountDialog box is open. When charging a trident, I dont think that Dialog box ever happens. You just click your runes and charge the Trident and its done. You need to change the condition for when you want to charge a trident, because currently it will only attempt to charge if you have an EnterAmountDialog open.

    Just for fun run your bot and go into the bank and try and withdraw X amount of items, does it start to validate for true once that dialog is open?
     
  5. louisdearing

    Joined:
    Jun 21, 2021
    Messages:
    4
    Likes Received:
    1
    I tried adjusting the code to run even if the EnterAmountDIalog isn't open, but EnterAmountDialog.enterAmount("2500") (or (2500)) does nothing :(

    Is there any way I can just force it to type 2500 and press enter once I've ran the code to bring up the dialog? This is only a private script bot so I'm not concerned with it being the 'right' way as long as it works!
     
  6. dahnae

    Joined:
    Oct 21, 2018
    Messages:
    369
    Likes Received:
    135
    Keyboard.type("2500") should work
     
    generalsensei likes this.
  7. louisdearing

    Joined:
    Jun 21, 2021
    Messages:
    4
    Likes Received:
    1
    Godsend. Thank you!

    All sorted now,
     
    generalsensei likes this.

Share This Page

Loading...