

empathy
-
Posts
110 -
Joined
-
Last visited
-
Feedback
66.7%
Posts posted by empathy
-
-
So I just can't figure it out!
I have tired many different ways and it just keeps crashing osbot!
I create a list of ground items and it does fetch what I'm looking for and the list become populated. how can I take the items from this list and interact with them?
getGroundItems().closest("name").interact("Take")
??????? I am on my phone so this may not be accurate.
-
1
-
-
I made this for fun and I really don't plan on using it. I'm gonna release it. Feel free to use it or don't. I don't care
Also the code isn't that clean.
What it does:
https://gyazo.com/442cf002eb683ed0343f6f62f79e2d15
Code (Note* the first item search may lag a tiny bit due to loading the text document from online. An easy fix is to load the text document locally):
package org.empathy.combat.equipment.gui; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; public class Gui extends JFrame { private JPanel contentPane; private JTextField textField; private int itemId; String path = "http://cdn.rsbuddy.com/items/" + itemId + ".png"; JLabel lblNewLabel; BufferedImage image; private JLabel lblTypeAnItem; /** * 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, 340, 382); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); textField = new JTextField(); textField.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { checkText(); } }); textField.setBounds(118, 49, 86, 20); contentPane.add(textField); textField.setColumns(10); try { image = ImageIO.read(new URL(path)); lblNewLabel = new JLabel(); lblNewLabel.setBounds(118, 92, 86, 73); contentPane.add(lblNewLabel); lblTypeAnItem = new JLabel("Type an item name and hit Enter"); lblTypeAnItem.setBounds(80, 28, 208, 14); contentPane.add(lblTypeAnItem); } catch (IOException e) { e.printStackTrace(); } } public void checkText() { if (textField.getText() != null) { try { URL url = new URL("https://gist.githubusercontent.com/anonymous/a1aa9894c1acc0c1c201/raw/b8bd35ed57a9cedfb1dc2379212ac79faa979136/IDs.txt"); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); String line; while ((line = in.readLine()) != null) { if (line.toLowerCase().contains(textField.getText().toLowerCase())) { String[] x = line.toLowerCase().split(textField.getText().toLowerCase() + " - "); int i = Integer.parseInt(x[1]); image = ImageIO.read(new URL("http://cdn.rsbuddy.com/items/" + i + ".png")); lblNewLabel.setIcon(new ImageIcon(image)); break; } } } catch (IOException e) { e.printStackTrace(); } } } }
-
4
-
-
private final int[] DEADMAN_WORLDS = {317, 319, 321, 345, 352, 357, 360, 374}; private boolean isDeadman(){ for(int i : DEADMAN_WORLDS){ if(getBot().getWorld() == i){ return true; } } return false; }
Pretty simple, probs forgetting a world or new worlds will be added. Change the modifiers if necessary.
Nice convention naming
private final int[] deadmanWorlds
-
Disputed Member:@empathy
Why it should be removed: someone left me feedback for helping with code. It's my most recent feed back
-
Hey! It does click the bank 1 time now! Thanks for that. Only problem is. It doesn't deposit the logs anymore.
EDIT: Trying it with the !myPlayer().isMoving()). Will let you know in a sec.
if (bankbooth != null && !getBank().isOpen()) { if (inventory.isFull()) { camera.toEntity(bankbooth); bankbooth.interact("Bank"); bank.depositAll("Willow logs"); sleep(random(500,700)); } }
There's no sleep time between opening the bank and depositing willow logs. Try adding a conditional sleep after interacting like this:
bankbooth.interact("Bank"); new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep();
This means that the bot will sleep for 5000 milliseconds or until the bank is open. Whichever comes first.
You should generally avoid doing multiple interactions in 1 loop cycle, and always evaluate the success of your actions (never assume success).
In this particular case tho, I think you can solve it by adding a check to the case for opening the bank
You can evaluate the success by adding conditional sleeps.
-
1
-
-
My bro got banned on deadman boting in safe zone. He probably got reported or a p/mod j/mod walked by. IDK he was boting for 4 hours only with breaks so very unlucky.
Breaks dont work on deadman mode since the 10 second timer doesn't let you log out.
-
4
-
-
Mrdefnerd is the best by far. How active he is may be a different question
-
Bought 33m OSRS Gold, he went first, wouldn't hesistate to deal with him!
-
1
-
-
I was writing a framework for my scripts, I went to start it up and got this error..
Paste the code?
-
get the substring of the string. then convert the string into an int
http://www.tutorialspoint.com/java/java_string_substring.htm
You could also split the string, which would be easier.
-
i have been on that line for over an hour, the bit i dont understand is how to say for example
if hp is below 5
all i can do is get hp
getSkills().getDynamic(Skill.HITPOINTS) < 5
lol
-
getSkills().getDynamic(Skill.HITPOINTS)
getInventory().getItem("Food_Name").interact("Eat")
Use the api docs.
-
I hope you're not trying to recover an account you sold to @Master Chief 2 years ago. (Saw it in your feedback)
-
Erm that's not his skype, I have him added, this is his skype: http://prntscr.com/8cx4c0
show his profile. -
Mom I won!!!!!!!!!!!!
-
Holy camoley I won!
-
Mom did I win? Yes son you did!
-
Mom did I win??!?!?!
-
Mom I WON!!!!!!!!!!!!!!!!!!!!!
-
MOM DID I WIN?
-
Im #1 yo
-
Yes son you won
-
MOMOMOMOMOMOM DID I WININININ?
-
MOM!!!!!!!!!!
Trolling Live Chat
in Spam/Off Topic
Posted
fuck!