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
  • Widget (maybe) help


    Certified7

    Recommended Posts

    This is going to be hard to explain.

     

    I am working on a complex script (I don't want to share details just yet) that I plan to release upon completion, however I am not super familiar with the DB API yet, and any help would be greatly appreciated. I have already made a couple relatively complex scripts, so I feel that I'm competent, just maybe not enough for this puzzle.

     

    Pretty much, pretend this old pillory random event came up, and there was a puzzle like this with corresponding widgets to each key. Now, say the solution is always the triangle key, but the triangle key moves randomly between the 3 locations.

     

    random_pillory.gif

     

    My puzzle is very similar, and is the only hurdle I have to overcome - the rest I can do.

     

    My question is, for each widget (pretend a box is drawn around each key representing a widget), will the ID or item ID of the widget change when the diamond key changes position? Or will the widgets and IDs remain static even if the keys move?

     

    In other words, knowing that the keys move and that the triangle key is always the solution, how would you solve this puzzle reliably knowing that a widget for each key exists?

     

    If you are familiar with Simba, I could easily use a DTM / Bitmap because the solutions (in my application) don't swing as the keys do, but are fixed (in one of the three locations). Does a similar solution exist in the DB API?

     

    Any advice would be greatly appreciated and expedite the release of my script :)

    Link to comment
    Share on other sites

    On the dreambot client, Tools > Debugging > Tool: Widget Hover (or/and) Tool: Entity Hover

    And then hover over what you want.
    This will give you the info you're looking for.

    Link to comment
    Share on other sites

    On the dreambot client, Tools > Debugging > Tool: Widget Hover (or/and) Tool: Entity Hover

    And then hover over what you want.

    This will give you the info you're looking for.

     

    Thanks for your reply!

     

    I was unable to do that because I kept getting attacked which closed the interface, but I was curious how you tell what the widget is if it is a picture (e.g. no text to check against, etc). I was checking with another collection of screen widgets that are text, and other than the text, the game debugger showed no differences between the widgets minus the text and the child nodes.

     

    I have a feeling that the widgets themselves stay static, and do not follow the keys, so I'm wondering if there is some unlisted identifier that I can use to determine where the key went. I am hoping I could use widget,getID() or .getContentID().

     

    Edit: I vaguely remember the ID field (in the debugger) being blank for these other widgets I was messing with. However, I did not try to call .getID() on these widgets to see what was returned. Would the key widgets have a unique ID/contentID? Otherwise I don't think this is possible.

     

    I think this will work, assuming I have the triangle key ID. 

     if (keyWidget1 != null) {
                if (keyWidget1.getID() == triangleKeyID) {
                    keyWidget1.interact();
                } else if (keyWidget2.getID() == triangleKeyID) {
                    keyWidget2.interact();
                } else {
                    keyWidget3.interact();
                }
     }
    

    In other words, assuming that the .getID() return the IDs of the keys, and not the widgets, and is not null (as it appeared), I think I should be good to go. I was just hoping someone had stumbled across this before.

     

    I plan to stop developing the script until I have this working first, since the rest of it will take a lot of time, but is easily doable.

     

    Thanks again!! :)

    Link to comment
    Share on other sites

    Thanks for your reply!

     

    I was unable to do that because I kept getting attacked which closed the interface, but I was curious how you tell what the widget is if it is a picture (e.g. no text to check against, etc). I was checking with another collection of screen widgets that are text, and other than the text, the game debugger showed no differences between the widgets minus the text and the child nodes.

     

    I have a feeling that the widgets themselves stay static, and do not follow the keys, so I'm wondering if there is some unlisted identifier that I can use to determine where the key went. I am hoping I could use widget,getID() or .getContentID().

     

    Edit: I vaguely remember the ID field (in the debugger) being blank for these other widgets I was messing with. However, I did not try to call .getID() on these widgets to see what was returned. Would the key widgets have a unique ID/contentID? Otherwise I don't think this is possible.

     

    I think this will work, assuming I have the triangle key ID. 

     if (keyWidget1 != null) {
                if (keyWidget1.getID() == triangleKeyID) {
                    keyWidget1.interact();
                } else if (keyWidget2.getID() == triangleKeyID) {
                    keyWidget2.interact();
                } else {
                    keyWidget3.interact();
                }
     }
    

    In other words, assuming that the .getID() return the IDs of the keys, and not the widgets, and is not null (as it appeared), I think I should be good to go. I was just hoping someone had stumbled across this before.

     

    I plan to stop developing the script until I have this working first, since the rest of it will take a lot of time, but is easily doable.

     

    Thanks again!! :)

    PM me

    Link to comment
    Share on other sites

    PM me

     

    I tried to and it said that you are unable to receive any new messages  ;)

     

    Edit: Just an update, I was able to use "someWidget.getDisabledMediaType()" to find a unique ID. Seems like kind of a strange name when all of the other IDs were null, but hey, it works!

    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.