Jump to content

Welcome to DreamBot

VIP Enhancement

Want to upgrade your DreamBot experience? Consider signing up for VIP!
VIP allows you to run as many accounts as you want, view the forums ad-free, receive 10% off all script purchases, and so much more!
Visit the store to learn about all of these great features!

Upgrade to VIP Now
Frequently Asked Questions
  • Are you not able to open the client? Make sure you have Java 8 installed
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox

DreamBot is the only Deadman Mode supported bot on the market!

Download the DreamBot client today!





Hashtag

Scripting 101

Recommended Posts

First and foremost thank you for the tutorial it was very helpful! I am confused on how I can get my JcomboBox trigger my bot to walk to a chosen area and how I could set up my loop to preform that action.

 

I know I can do something like

 

if (GE_AREA.contains(getLocalPlayer)); {

         }

   else (

       if (getWalking().walk(GE_AREA.getRandomTile()))

 

but how could I set it up so that it would check for the JcomboBox's String first so it knows what location?

 

I appreciate any help!

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

I've followed everything you've done for the GUI perfectly (aside from adding more options for the enemies), but when I build it I get the error that java ')' expected in place of -> in the button.addActionListener(1 -> { ....           

I am not sure why this is happening, and dont know how to resolve this issue. Still pretty new at all of this so maybe I've just missed something, any help is greatly appreciated. 

 

for reference this is exactly what I have down 

button.addActionListener(1 -> {
    foodName = foodNameTextField.getText(); //store inputted food name
    lootBones = lootCheckBox.isSelected();
    /*
    our enemyComboBox was filled with strings but getselecteditem returns an object. This means we need to call
    .tostring() on the object to get the selected string.
     */
    enemyName = enemyComboBox.getSelectedItem().toString();

    isRunning = true;  // now our script will start looping our code.
    frame.dispose();  //closes the GUI window
});

 

Share this post


Link to post
Share on other sites
1 hour ago, SummonerLit said:

I've followed everything you've done for the GUI perfectly (aside from adding more options for the enemies), but when I build it I get the error that java ')' expected in place of -> in the button.addActionListener(1 -> { ....           

I am not sure why this is happening, and dont know how to resolve this issue. Still pretty new at all of this so maybe I've just missed something, any help is greatly appreciated. 

 

for reference this is exactly what I have down 


button.addActionListener(1 -> {
    foodName = foodNameTextField.getText(); //store inputted food name
    lootBones = lootCheckBox.isSelected();
    /*
    our enemyComboBox was filled with strings but getselecteditem returns an object. This means we need to call
    .tostring() on the object to get the selected string.
     */
    enemyName = enemyComboBox.getSelectedItem().toString();

    isRunning = true;  // now our script will start looping our code.
    frame.dispose();  //closes the GUI window
});

 

It's an L not a one.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...