Jump to content

lpbrown

Members
  • Posts

    56
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by lpbrown

  1. Hey khal! Just bought it, seems awesome so far. Only thing to say about it is that im a little bummed it doesnt have the option for fire rune crafting with duel arena banking by just walkign (RoD/ walking to alkharid are the only options)
  2. Might try this in the future but as for now ive had enough headache with this GUI haha.
  3. Thank you for your help. Followed your guide slowly and got it working. You are the best.
  4. I wrote the script to take in the values as integers and make decisions on what to withdraw based on what integers had been stored. (0 = bronze, 1 = iron, etc etc) I rewrote a little bit of it in order to allow for the usage of the getSelectedItem method but this yeilds the same results. Additionally, I remade the GUI with only one combo box from scratch to see if I had maybe messed something up some where, because why not its not that hard. I am still getting the same errors.
  5. http://i.imgur.com/MGpDBwG.png gui initializes as expected and the combo boxes function when you drop them down etc. upon hitting the start button, I get this error in the log of the osbot client (although it is not a fatal error): the script then proceeds to loop through my failsafe and end as no values have been assigned to what bar we are smithing, or location we are smithing at. [INFO][Bot #1][06/15 01:46:23 PM]: Error in script onStart(): Brown Smelter CBALL [INFO][Bot #1][06/15 01:46:23 PM]: Started script : Brown Smelter CBALL [INFO][Bot #1][06/15 01:46:23 PM]: 2 bank [INFO][Bot #1][06/15 01:46:30 PM]: 2 bank [INFO][Bot #1][06/15 01:46:31 PM]: 2 bank [INFO][Bot #1][06/15 01:46:33 PM]: 2 bank [INFO][Bot #1][06/15 01:46:34 PM]: 2 bank [INFO][Bot #1][06/15 01:46:35 PM]: Terminating script Brown Smelter CBALL... [INFO][Bot #1][06/15 01:46:35 PM]: Thanks for using brown smither [INFO][Bot #1][06/15 01:46:35 PM]: Script Brown Smelter CBALL has exited!
  6. Hey guys. Finished a very solid smelting script and am just trying to get a GUI working. the script is great so far when I just hard code in the optons and then compile it, but id like the options to be selectable. Here is my onstart: public void onStart() throws InterruptedException { GUI mygui = new GUI(); mygui.setVisible(true); while(mygui.isVisible()) {sleep(100);} barselection = mygui.comboBox.getSelectedIndex(); location = mygui.comboBox_1.getSelectedIndex(); } and here is the gui im using. I made it with eclipse's JFrame builder import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JComboBox; import javax.swing.DefaultComboBoxModel; public class GUI extends JFrame { private JPanel contentPane; public JComboBox comboBox; public JComboBox comboBox_1; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { GUI frame = new GUI(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public GUI() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 446, 160); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JButton btnStartSmithing = new JButton("Start Smithing"); btnStartSmithing.setBounds(5, 5, 424, 23); btnStartSmithing.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); } }); contentPane.setLayout(null); contentPane.add(btnStartSmithing); JComboBox comboBox = new JComboBox(); comboBox.setModel(new DefaultComboBoxModel(new String[] {"Bronze", "Iron", "Silver", "Steel", "Gold", "Mithril", "Adamant", "Rune", "Cannonballs"})); comboBox.setBounds(5, 39, 200, 75); contentPane.add(comboBox); JComboBox comboBox_1 = new JComboBox(); comboBox_1.setModel(new DefaultComboBoxModel(new String[] {"Al Kharid", "Edgeville"})); comboBox_1.setBounds(215, 39, 209, 75); contentPane.add(comboBox_1); } } However, when I run the script the gui will pop up, but no information from the combobox's will be provided to the script. How can I fix this?
  7. re you buying or selling RS 07 GP : buying Amount you want to buy/sell : 4m What payment option : pp How did u contact me (Skype/Live Chat) : skype
  8. private State getState() { if (!inventory.contains(453) && SMELT_AREA.contains(myPlayer())) return State.WALK_TO_BANK; if (inventory.contains(453) && inventory.contains(440) && BANK_AREA.contains(myPlayer())) return State.WALk_TO_FURNACE; if (!inventory.contains(453) && BANK_AREA.contains(myPlayer())) return State.BANK; if (widgets.get(311,8) != null) return State.SMELT; return State.OPEN_FURNACE; } Heres my state machine. Heres the basic logic (note this is for only steel at the moment, I am going to change it to smelt whatever using a gui once i get the smelting to actually work. thats why the ids are hardcoded atm) 1) if there is no coal in our inventory, and we are at the furnace -> walk to the bank 2) if there is coal and iron in our inventory, and we are at the bank - > walk to the furnace 3) if there is no coal in our inventory and we are at the bank (this implies we have finished smelting) -> do the bank routine (Considering making this check if there ARE bars instead of there ARE NOT ores. thoughts?) 4) if the widget menu for smelting bars is open -> attempt to select (smelt x option) (only step that isnt working so far.) 5) default case of clicking the furnace if no other cases are true. EDIT HOLY FUCKING WOW All I had to do was make change options.interact("Smelt X"); to options.interact("Smelt X Steel"); Why the hell is this? When I made a miner bot you just had to use "mine" for the menu interaction, not "mine ore" or whatever. doesnt make much sense.
  9. well yes haha but im pretty sure most people can understand that. a specific number would just be keyboard.typeString("YOURNUMBER");
  10. Thanks for the input everyone. Still havent managed to get this working. I have gone ahead and made two different states as suggested case OPEN_FURNACE: log("OPEN FURNACE"); if (!myPlayer().isAnimating()) { RS2Object furnace = objects.closest(FURNACE_ID); if (furnace != null) { furnace.interact("Smelt"); sleep(2000); } } break; case SMELT: log("smelt"); RS2Widget options = widgets.get(311,8); if (options != null){ options.interact("Smelt X"); sleep(300); keyboard.typeString("" + random(29,99), true); } sleep(100); break; but this doesnt work. It simply does not interact with the widget. I also tried forcing the menu to open via a random click within the bounds of the desired area, and then using a menu method to get the smelt X option. this didnt work either, but it looks like this: case SMELT: log("smelt"); RS2Widget options = widgets.get(311,8); if (options != null){ mouse.click(random(240,270),random(393,420), true); sleep(random(300,500)); menu.selectAction("Smelt X"); sleep(300); keyboard.typeString("" + random(29,99), true); } sleep(100); break; Debating on continuing with this method and then just applying an offest to the random coords i use to open the menu. What is wrong with the above code though? really dont know
  11. Hey all, trying to get back into scripting. I scripted some in the days of kbot but havent since then. Trying to make a basic smithing bot but I am running into trouble when interacting with the smelting menu. Anly help would be appreciated. Heres my code for the smelting case case SMITH: log("smithing"); if (!myPlayer().isAnimating()) { RS2Object furnace = objects.closest(FURNACE_ID); if (furnace != null) { furnace.interact("Smelt"); log("smelting 1 complete"); } RS2Widget menu = widgets.get(311,6); if (menu != null){ log("menu detected"); menu.interact("Smelt X"); log("menu interacted"); sleep(random(200,500)); keyboard.typeString("100", true); } } And using the logs as debugs, it just loops between "smithing" and "smelting 1 complete". What is wrong with my widget detection? Is that not the correct usage? I am trying to get menu to refer to the iron ore sub widget on the smihting menu, and then interact with it using the smetl x option. However it appears that the widget is always null. Heres a picture of the widget I am trying to use.
  12. Any hints as to how to actually make the bot type in a certain amount at that widget menu?
  13. I assume this is for use on things like smelt X sort of interface? ill give this a go in a script im building
  14. Might wanna update your gfx for your store. Theres shit about your magic bot in there lol
×
×
  • Create New...