Jump to content

Apaec

Scripter III
  • Posts

    11146
  • Joined

  • Last visited

  • Days Won

    91
  • Feedback

    100%

Everything posted by Apaec

  1. woahhh!!! awesome thanks for the amazing proggies mate have featured them on front page. apa
  2. hey! glad you like it hopefully it should make you the money you spent on the script back within the hour apa
  3. Hey! thanks for showing interest. I've given you a 24h trial starting now. Enjoy! ) apa
  4. Done, done and done. Enjoy! apa
  5. You deserve some rank in recognition of what you do around here and generally I like these ideas. i'd be suprised if ipb doesn't have some sort of mobile extension? and if it does, apa
  6. Sorry, you'll have to buy the script instead of abusing my system! This seems to be atleast your 4th rock crab trial request! apa
  7. Sure please post on the trial thread here : http://osbot.org/forum/topic/61445-apa-script-trials-free/ apa
  8. Hey Cheers for the advice As I said, I created the frame and stuff with a windowbuilder which includes the actionlisteners. I could have used lambdas but the code was already generated as such so I was happy enough to leave it as is x) When I created the class in eclipse I created it as a jframe structured class courtesy of the wb plugin. This is why the whole class extends jframe - When i tidied the code up I didn't get around to sorting that out after adding additional methods to the class but I agree, that's something I shoulda done As for the other suggestions... it looks like i should put more effort into tidying up my code haha I made it hide the gui when you press save because in future i'm planning on making it re-openable with the pre-recorded data Thanks again for the suggestions. Will try and clean the code up some more ) apa Edit: updated code to tidy it up a bit. didn't have much time this morning as i've gotta head out early edited original post apa edit 2: looks like i fukd something up, will revert it back to old code and then update it when i'm not time pressured when i'm back home apa
  9. I wrote this object loader class to make a personal aio woodcutting script. I thought i'd share it with you guys Hope something can be learnt from this ObjectLoader class: import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.DefaultListModel; import javax.swing.JScrollPane; import javax.swing.JButton; import javax.swing.JList; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.util.ArrayList; import javax.swing.JLabel; import javax.swing.SwingConstants; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import javax.swing.JTextField; import javax.swing.event.ChangeListener; import javax.swing.event.ChangeEvent; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; public class ObjectLoader extends JFrame { /** * @author Apaec */ private static final long serialVersionUID = 1L; private JPanel contentPane; private String interactionString; private int radius = 10; private final DefaultListModel<String> modelDesired = new DefaultListModel<String>(); private final DefaultListModel<String> modelLoaded = new DefaultListModel<String>(); private ArrayList<RS2Object> objectListDesired = new ArrayList<RS2Object>(); private ArrayList<RS2Object> objectListLoaded = new ArrayList<RS2Object>(); private ArrayList<Position> controlPos = new ArrayList<Position>(); private boolean isVisible = false; public ObjectLoader(final Script script, String defaultSearchString, int defaultRadius) { this.interactionString = defaultSearchString; this.radius = defaultRadius; } public void openLoader(final Script script) { setTitle("Object Loader"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 450, 305); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); setAlwaysOnTop(true); setResizable(false); JLabel lblLoadObjectsWithin = new JLabel("Load objects within radius:"); JLabel lblLoadObjectsWith = new JLabel("Load objects with action:\r\n"); final JSpinner spinner = new JSpinner(); final JTextField txtChopDown = new JTextField(interactionString); JScrollPane scrollPane = new JScrollPane(); final JList<String> desiredtemsList = new JList<String>(modelDesired); JLabel lblDesiredObjects = new JLabel("Desired Objects"); JScrollPane scrollPane_1 = new JScrollPane(); final JList<String> loadedItemsList = new JList<String>(modelLoaded); JLabel lblNewLabel = new JLabel("Loaded Local Objects"); JButton btnNewButton = new JButton("<<"); JButton button = new JButton(">>"); JButton btnRefresh = new JButton("Refresh"); JButton btnSave = new JButton("Save"); lblLoadObjectsWithin.setBounds(10, 11, 193, 14); lblLoadObjectsWith.setBounds(10, 36, 193, 14); txtChopDown.setBounds(213, 33, 215, 20); btnNewButton.setBounds(192, 61, 54, 69); button.setBounds(192, 134, 54, 69); btnRefresh.setBounds(10, 214, 89, 42); btnSave.setBounds(109, 214, 319, 42); spinner.setBounds(213, 8, 215, 20); scrollPane.setBounds(10, 61, 178, 142); scrollPane_1.setBounds(250, 61, 178, 142); txtChopDown.setHorizontalAlignment(SwingConstants.CENTER); txtChopDown.setColumns(10); lblDesiredObjects.setHorizontalAlignment(SwingConstants.CENTER); lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); scrollPane.setViewportView(desiredtemsList); scrollPane.setColumnHeaderView(lblDesiredObjects); scrollPane_1.setViewportView(loadedItemsList); scrollPane_1.setColumnHeaderView(lblNewLabel); spinner.setModel(new SpinnerNumberModel(radius, 1, 30, 1)); contentPane.add(lblLoadObjectsWithin); contentPane.add(spinner); contentPane.add(lblLoadObjectsWith); contentPane.add(txtChopDown); contentPane.add(scrollPane); contentPane.add(scrollPane_1); contentPane.add(btnNewButton); contentPane.add(button); contentPane.add(btnRefresh); contentPane.add(btnSave); setVisible(true); isVisible = true; spinner.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent arg0) { radius = (int) spinner.getValue(); } }); txtChopDown.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { interactionString = txtChopDown.getText(); } public void insertUpdate(DocumentEvent arg0) { interactionString = txtChopDown.getText(); } public void removeUpdate(DocumentEvent arg0) { interactionString = txtChopDown.getText(); } }); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (loadedItemsList.getSelectedIndex() != -1) { modelDesired .addElement(convertObjectToString(objectListLoaded .get(loadedItemsList.getSelectedIndex()))); objectListDesired.add(objectListLoaded.get(loadedItemsList .getSelectedIndex())); objectListLoaded.remove(loadedItemsList.getSelectedIndex()); modelLoaded.removeElementAt(loadedItemsList .getSelectedIndex()); } } }); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (desiredtemsList.getSelectedIndex() != -1) { modelLoaded .addElement(convertObjectToString(objectListDesired .get(desiredtemsList.getSelectedIndex()))); objectListLoaded.add(objectListDesired.get(desiredtemsList .getSelectedIndex())); objectListDesired.remove(desiredtemsList.getSelectedIndex()); modelDesired.removeElementAt(desiredtemsList .getSelectedIndex()); } } }); btnRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { clearListsAndModels(); ArrayList<RS2Object> objectsAll = null; objectsAll = loadNearbyObjectsForActionAsList(script, getRadius(), getInteractionString(), true); if (objectsAll != null) { for (RS2Object o : objectsAll) modelLoaded.addElement(convertObjectToString(o)); objectListLoaded = objectsAll; } } }); btnSave.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { setVisible(false); isVisible = false; } }); } public String convertObjectToString(RS2Object o) { return o.getName() + " (" + o.getPosition().getX() + "," + o.getPosition().getY() + "," + o.getPosition().getZ() + ")"; } public String getInteractionString() { return interactionString; } public int getRadius() { return radius; } public void clearListsAndModels() { modelLoaded.clear(); modelDesired.clear(); objectListDesired.clear(); objectListLoaded.clear(); controlPos.clear(); } public boolean isOpen() { return isVisible; } public RS2Object[] getAllObjects() { if (objectListLoaded.size() > 0) { RS2Object[] objects = new RS2Object[objectListLoaded.size()]; for (RS2Object o : objectListLoaded) objects[objectListLoaded.indexOf(o)] = o; return objects; } else { return null; } } public RS2Object[] getDesiredObjects() { if (objectListDesired.size() > 0) { RS2Object[] objects = new RS2Object[objectListDesired.size()]; for (RS2Object o : objectListDesired) objects[objectListDesired.indexOf(o)] = o; return objects; } else { return null; } } private ArrayList<RS2Object> loadNearbyObjectsForActionAsList( Script script, int radius, String action, boolean clearLists) { if (clearLists) clearListsAndModels(); ArrayList<RS2Object> objects = new ArrayList<RS2Object>(); for (RS2Object r : script.objects.getAll()) { if (r != null && r.exists() && !r.getName().equals("null") && script.map.distance(r) <= radius && !controlPos.contains(r.getPosition())) { if (action.equals("")) { controlPos.add(r.getPosition()); objects.add(r); } else if (r.hasAction(action)) { controlPos.add(r.getPosition()); objects.add(r); } } } return objects.size() > 0 ? objects : null; } } >>apologies for the poor jframe code, used a gui builder. Did my best to tidy it up somewhat but I understand it's still a little messy. How to use it in an example script: import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(name = "Object loader demo", author = "Apaec", version = 1.0, info = "Demo displayin object loader", logo = "") public class ObjectLoaderDemo extends Script { ObjectLoader loader; RS2Object[] desiredObjects = null; public void onStart() { loader = new ObjectLoader(this, "", 10); if (!loader.isOpen()) loader.openLoader(this); } public int onLoop() throws InterruptedException { while (loader.isOpen()) { sleep(400); desiredObjects = loader.getDesiredObjects(); } // visual debug: if (desiredObjects.length > 0) for (RS2Object o : desiredObjects) if (o != null && o.exists()) log(o.getName()); return 10; } public void onExit() { if (loader.isOpen()) loader.dispose(); } } Where desiredObjects is your array containing the objects configured by the user. Screenshots: Gif: If you're commenting on my code, please be constructive, and I understand it's a bit below-par in places. I know how it is tho when posting snippets x) how it helps apa
  10. Hey! I've given you a 24h trial. In future, please read the rules on the front of this page. I'll let you off this once x))) enjoy apa
  11. i hope my time will come lol congrats tho x)
  12. Rename all your class files (or atleast the one being pointed to by this)... see if that changes anything. apa
  13. From writing my aio smither, I found a few stats: Mithril dart tips - require quest but they are 45k exp/h and you break even. Iron knives are ~22k per hour and you make 100k/h gp profit Gold bars make a loss but with gauntlets you can get about 60k exp/h~ Cannonballs are great profit (150k/h) but only 10k smithing exp/h If you want to bot it, feel free to request a trial by clicking my signature, i'd be willing to let you try the script apa
  14. you could get ~6m for that i'd say. Or maybe 5. Depends on whether it has membs left or not
  15. I'm sure some people have been banned, yes. But if you play it safe and use long breaks and mirror client (if you can!), you should be fine. Also, yes, the script will stop when you're out of natures or items. apa
  16. still have no idea why people play this game... it's a piece of shit x) dota>league
  17. Hey, Bot smart. Use breaks + play a little legit inbetween. Also, mirror client helps alot so if you're not on a tight budget i'd recommend using that! apa
  18. gave you a 6h trial. Enjoy! apa
  19. I used to use gyazo but recently moved to lightshot and didn't regret it
  20. Apaec

    I need halp

    perhaps u run out of memory?
×
×
  • Create New...