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
  • Scripting 101


    Hashtag

    Recommended Posts

    Posted

    Hey im trying to get into scripting and have a couple of questions:

     

    How to get multiple tabs in the GUI like your #1 woodcutting script has for example,

     

    What would be the best way of traversing and depositing things at a bank,

     

    How to get camera and mouse movement to look human-like?

     

    Thats all, thanks.

    Hey,

     

    Multiple GUI tabs can be achieved with a JTabbedPane.

    JTabbedPane tabbedPane = new JTabbedPane();
    
    JPanel tab = new JPanel();
    tabbedPane.add("First tab", tab); // Can't remember whether the JPanel is first in the args
    
    tab = new JPanel();
    tabbedPane.add("Second tab", tab);
    
    getContentPane().add(tabbedPane);
    

    For walking, use getWalking().walk(tile);

    There's a class called Bank that contains all the methods you need for interacting with the bank when it's open. You access that class with the method getBank(). (For example: getBank().widthdraw("Coins", 100);)

     

    Making human-like camera/mouse movement is not as easy as you might think. However, you can play with the methods listed in the Camera and Mouse classes which you can access with the methods getCamera() and getMouse().

     

    I hope I managed to answer your questions. Good luck with scripting!

    Posted

    That was very useful thx,

     

    I have this code for my GUI

    dropCheckBox.addActionListener(e -> {if (dropCheckBox.isSelected()) {powerChop = true;} else {powerChop = false;}});
    

    How would i make another part of the GUI which is a combo box be refreshed to be blanked out if the variable powerChop is true?


    also: https://gyazo.com/693132a5b616fc1f71ff93a2dd3baa8f so you can see what im trying to do

     

    you tab thing worked like a charm

    Posted

    That was very useful thx,

     

    I have this code for my GUI

    dropCheckBox.addActionListener(e -> {if (dropCheckBox.isSelected()) {powerChop = true;} else {powerChop = false;}});
    

    How would i make another part of the GUI which is a combo box be refreshed to be blanked out if the variable powerChop is true?

    also: https://gyazo.com/693132a5b616fc1f71ff93a2dd3baa8f so you can see what im trying to do

     

    you tab thing worked like a charm

    Set its selected index by comboBox.setSelectedIndex(something);

    • 1 month later...
    Posted

    Is @Override really necessary? Doesn't it automatically knows it's overriding a method from the parent class?

    Posted

    Is @Override really necessary? Doesn't it automatically knows it's overriding a method from the parent class?

    It's not necessary. However, for you it's more readable.

    Posted

    @Hashtag, do you know of any open-source TaskScript code so I can take a look? Thanks

    Posted

    @Hashtag, do you know of any open-source TaskScript code so I can take a look? Thanks

    Hey, sorry I don't know any nor do I have one.

    Posted

    Hey there mate, great tutorial. Got me started using TaskScript and I'm finding it a lot easier than AbstractScript.

    My question is, in the GUI tutorial you have 

    if(isRunning = true) 

    in the onLoop of your script, however, TaskScript does not have an onLoop. This means that my GUI, effectively, does not work, as the script begins before I hit start - or, if I add this code to the onStart of TaskScript, nothing happens (as this is only ran once, when you start the script.) even when the button is pressed.

    Is there an alternative way to add a Start button to a TaskScript script?

    Thank you for your help!

     

     

    @Hashtag, do you know of any open-source TaskScript code so I can take a look? Thanks

     

    Here's a plank processing script I created using TaskScript. Github Gist

    Posted

    Hey there mate, great tutorial. Got me started using TaskScript and I'm finding it a lot easier than AbstractScript.

     

    My question is, in the GUI tutorial you have 

    if(isRunning = true) 

    in the onLoop of your script, however, TaskScript does not have an onLoop. This means that my GUI, effectively, does not work, as the script begins before I hit start - or, if I add this code to the onStart of TaskScript, nothing happens (as this is only ran once, when you start the script.) even when the button is pressed.

     

    Is there an alternative way to add a Start button to a TaskScript script?

     

    Thank you for your help!

     

     

     

    Here's a plank processing script I created using TaskScript. Github Gist

    Hey, there are several approaches to this. You can have the button click event add the nodes instead of adding them in the onStart method. Another way is to have your nodes reference to the isRunning var and in the accept method return false if isRunning is false.

    Posted

    Hey, there are several approaches to this. You can have the button click event add the nodes instead of adding them in the onStart method. Another way is to have your nodes reference to the isRunning var and in the accept method return false if isRunning is false.

     

    Adding the nodes to the start button worked perfectly, thank you!

    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.