-
Posts
288 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by Paradox68
-
Since the script got a bit of love, here's an updated version of the original script with some mouse moving anti-ban methods, and switched to webwalking. import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Paradox68", info = "Paradox simple Edgeville fishing script.", name = "Paradox Simple Edge Fisher", version = 1.0, logo = "") public class main extends Script { private long timeStart; private String state = "Initializing.."; private int invCount = 0; private int caught = 0; private int lastMA = 0; Area fishArea = new Area( new Position(3111,3437,0), new Position(3100,3422,0)); Area edgeBank = new Area( new Position(3098,3499,0), new Position(3091,3488,0)); @Override public void onStart() { getExperienceTracker().start(Skill.FISHING); timeStart = System.currentTimeMillis(); } @Override public void onPaint(Graphics2D g) { long timeElapsed = System.currentTimeMillis() - timeStart; long seconds = (timeElapsed / 1000) % 60; long minutes = (timeElapsed / (1000 * 60)) % 60; long hours = (timeElapsed / (1000 * 60 * 60)) % 24; g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14)); g.setColor(Color.white); g.drawString("x", (int)getMouse().getPosition().getX() - 4, (int)getMouse().getPosition().getY() + 5); g.drawString(state, 8, 50); g.drawString("Time Running: " + (hours >= 10 ? "" + hours : "0" + hours) + ":" + (minutes >= 10 ? "" + minutes : "0" + minutes) + ":" + (seconds >= 10 ? "" + seconds : "0" + seconds), 8, 65); g.drawString("XP Gained: " + getExperienceTracker().getGainedXP(Skill.FISHING) + " (" + getExperienceTracker().getGainedLevels(Skill.FISHING) + ")", 8, 80); g.drawString("Fish caught: " + caught, 8, 95); } private void randomizeMouse() { lastMA++; if (lastMA > 4) { int i = random(5); switch (i) { case 0: case 1: getMouse().moveOutsideScreen(); break; case 2: getMouse().moveRandomly(); break; case 3: getMouse().moveSlightly(); lastMA = 3; break; case 4: getMouse().moveVerySlightly(); break; case 5: getTabs().open(randomTab()); if (getTabs().getOpen() == Tab.SKILLS) { getMouse().move(704, 283); } } lastMA = 0; } } private Tab randomTab() { int i = random(6); switch(i) { case 0: case 1: return Tab.INVENTORY; case 2: return Tab.EQUIPMENT; case 3: return Tab.ATTACK; case 4: return Tab.SKILLS; case 5: return Tab.FRIENDS; case 6: return Tab.QUEST; } return Tab.SKILLS; } @Override public int onLoop() throws InterruptedException { if (getInventory().isFull() && !edgeBank.contains(myPlayer()) && !getBank().isOpen()) { state = "Walking to bank"; getWalking().webWalk(new Position(Banks.EDGEVILLE.getRandomPosition())); } if (getInventory().isFull() && edgeBank.contains(myPlayer()) && !getBank().isOpen()) { RS2Object bank = getObjects().closest("Bank booth"); state = "Opening bank"; if (bank != null) { if (bank.interact("Bank")) { state = "Depositing items"; sleep(1000); } } } if (getInventory().isFull() && edgeBank.contains(myPlayer()) && getBank().isOpen()) { getBank().depositAllExcept("Fly fishing rod", "Feather"); while (getInventory().contains("Trout") || getInventory().contains("Salmon")) { sleep(100); } state = "Closing bank"; getBank().close(); } if (!getInventory().isFull() && !fishArea.contains(myPlayer()) && !getBank().isOpen() ) { state = "Walking to fishing spots."; getWalking().webWalk(new Position(3102 + random(3), 3433 + random(3), 0)); } if (!getInventory().isFull() && fishArea.contains(myPlayer())) { NPC spot = getNpcs().closest("Fishing spot"); state = "Finding spot."; if (spot != null && spot.hasAction("Lure")) { spot.interact("Lure"); sleep(2000); invCount = getInventory().getEmptySlots(); } while (myPlayer().isAnimating()) { state = "Catching fish."; randomizeMouse(); if (getInventory().getEmptySlots() != invCount && fishArea.contains(myPlayer())) { invCount = getInventory().getEmptySlots(); caught += 1; } sleep(1000); } } return random(500, 800); } }
-
"A leader" LOL shoulda said "The." Would have sounded way better.
-
I had it but I lost the snippet for getting an image from URL and putting it into onPaint
-
http://osbot.org/forum/topic/90130-script-wont-start/ refer to above
-
I was having issues with GUI the other day. Try removing your GUI and seeing if the script will stay started.
-
Qubit nobody who knows what they're doing cares about your script lol. We're all capable of recreating it anyways but if you don't feel comfortable posting code for us to analyze you're crap outta luck. Troubleshooting method: after each line in the onstart add a log so you can see what checkpoint the code stops at. If you're loading a GUI built with JFormDesigner and it's complex, you might have to redo the GUI because I had that same issue. example: @Override public void onStart() throws InterruptedException { log("a"); UI gui = new UI(this); log("b"); gui.setVisible(true); log("c"); while (gui.isVisible()) { sleep(100); } log("d"); apply method as needed to figure out where the code stops being called.
-
Nah it won't get stuck because the onLoop calls depositAllExcept("Fly fishing rod", "Feather"); in the event before the while event is handled. So logically unless the computer somehow skips a line of code for the first time since the computer was invented, then the event should execute just fine. I ran the script for 8 hours yesterday no errors. If you feel more comfortable removing it, you're welcome to do so. I just used it so depositAllExcept("Fly fishing rod", "Feather"); wasn't being called every 500-800ms while the bank was open. I'm sure there are better ways but as you can see this is not a full-measure script release.
-
Yeah I was kinda upset there was nothing on the SDN for free people could use to fish for trout and salmon at edgeville/barb AND bank the fish....So I made a script really quick that does just that figured you guys might like it? I'm too lazy to upload it so if someone wants to do that go ahead. It just catches fish and banks them as opposed to power fishing. No configurable options, just does that one thing. You're welcome to those who wanted this. import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.ui.Tab; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "Paradox68", info = "Paradox simple Edgeville fishing script.", name = "Paradox Simple Edge Fisher", version = 1.0, logo = "") public class main extends Script { private long timeStart; private String state = "Initializing.."; private int invCount = 0; private int caught = 0; private int lastMA = 0; Area fishArea = new Area( new Position(3111,3437,0), new Position(3100,3422,0)); Area edgeBank = new Area( new Position(3098,3499,0), new Position(3091,3488,0)); @Override public void onStart() { getExperienceTracker().start(Skill.FISHING); timeStart = System.currentTimeMillis(); } @Override public void onPaint(Graphics2D g) { long timeElapsed = System.currentTimeMillis() - timeStart; long seconds = (timeElapsed / 1000) % 60; long minutes = (timeElapsed / (1000 * 60)) % 60; long hours = (timeElapsed / (1000 * 60 * 60)) % 24; g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14)); g.setColor(Color.white); g.drawString("x", (int)getMouse().getPosition().getX() - 4, (int)getMouse().getPosition().getY() + 5); g.drawString(state, 8, 50); g.drawString("Time Running: " + (hours >= 10 ? "" + hours : "0" + hours) + ":" + (minutes >= 10 ? "" + minutes : "0" + minutes) + ":" + (seconds >= 10 ? "" + seconds : "0" + seconds), 8, 65); g.drawString("XP Gained: " + getExperienceTracker().getGainedXP(Skill.FISHING) + " (" + getExperienceTracker().getGainedLevels(Skill.FISHING) + ")", 8, 80); g.drawString("Fish caught: " + caught, 8, 95); } private void randomizeMouse() { lastMA++; if (lastMA > 4) { int i = random(5); switch (i) { case 0: case 1: getMouse().moveOutsideScreen(); break; case 2: getMouse().moveRandomly(); break; case 3: getMouse().moveSlightly(); lastMA = 3; break; case 4: getMouse().moveVerySlightly(); break; case 5: getTabs().open(randomTab()); if (getTabs().getOpen() == Tab.SKILLS) { getMouse().move(704, 283); } } lastMA = 0; } } private Tab randomTab() { int i = random(6); switch(i) { case 0: case 1: return Tab.INVENTORY; case 2: return Tab.EQUIPMENT; case 3: return Tab.ATTACK; case 4: return Tab.SKILLS; case 5: return Tab.FRIENDS; case 6: return Tab.QUEST; } return Tab.SKILLS; } @Override public int onLoop() throws InterruptedException { if (getInventory().isFull() && !edgeBank.contains(myPlayer()) && !getBank().isOpen()) { state = "Walking to bank"; getWalking().webWalk(new Position(Banks.EDGEVILLE.getRandomPosition())); } if (getInventory().isFull() && edgeBank.contains(myPlayer()) && !getBank().isOpen()) { RS2Object bank = getObjects().closest("Bank booth"); state = "Opening bank"; if (bank != null) { if (bank.interact("Bank")) { state = "Depositing items"; sleep(1000); } } } if (getInventory().isFull() && edgeBank.contains(myPlayer()) && getBank().isOpen()) { getBank().depositAllExcept("Fly fishing rod", "Feather"); while (getInventory().contains("Trout") || getInventory().contains("Salmon")) { sleep(100); } state = "Closing bank"; getBank().close(); } if (!getInventory().isFull() && !fishArea.contains(myPlayer()) && !getBank().isOpen() ) { state = "Walking to fishing spots."; getWalking().webWalk(new Position(3102 + random(3), 3433 + random(3), 0)); } if (!getInventory().isFull() && fishArea.contains(myPlayer())) { NPC spot = getNpcs().closest("Fishing spot"); state = "Finding spot."; if (spot != null && spot.hasAction("Lure")) { spot.interact("Lure"); sleep(2000); invCount = getInventory().getEmptySlots(); } while (myPlayer().isAnimating()) { state = "Catching fish."; randomizeMouse(); if (getInventory().getEmptySlots() != invCount && fishArea.contains(myPlayer())) { invCount = getInventory().getEmptySlots(); caught += 1; } sleep(1000); } } return random(500, 800); } } Not gonna wait two hours for a good proggy but here's one. Theoretically if it lasts through one full iteration, it can last through a billion....I did two iterations for posterity and cause i'm such a saint.
-
i think it's like getWalking().canReach(); or getMap().canReach(); something with canReach...
-
Don't you know we like to scam people here? LOL jk Talk to Maldesto he'll sort it out for you ASAP. He's on a lot so just PM him.
-
Hi guys it's me Assnerd. Can someone Lend give me an account so i can test my script steal all your items. It'd mean a lot, thanks guys! haha fuck you guys so easy scams.
-
http://www.giftideas.com/great-things-under-100/a5bx7dw
-
Creating a JFormDesigner Form View from code?
Paradox68 replied to Paradox68's topic in Scripting Help
That could be the equivalent of me saying "Stop coding for the rest of your life. And you'll never have that issue." If you won't stay related to the question at hand, don't bother posting. -
Just pick the one you like better.... *sigh*
-
Thank you. I've solved the list building issues but you wouldn't happen to know why my script closes itself instantly after starting? Would you be able to help me for a minute on it because I can't find any explanation. SOMETIMES the script will run and the GUI will build, majority of the time it instantly exits script and says Error at onStart(). I only have the GUI opening method in onStart so I know it's the UI class but I can't imagine why.. 0 errors and 0 warnings.
-
In your snippet, what is core.removeComplexTask(list.getSelectedIndex()); Also why isn't it letting me reference addValues()? Sorry for the needing spoonfeeding I just came back from a long break trying to figure it all out again and I hate GUIs. I still can't seem to get it to add a value to the list.
-
Always good to see a helpful Scripter III rank....
-
//---- list1 ---- list1.setModel(new DefaultListModel<String>() { /** * */ private static final long serialVersionUID = 5147152121755459135L; String[] values = { main.monstersNearby[0], main.monstersNearby[1], main.monstersNearby[2], main.monstersNearby[3], main.monstersNearby[4], main.monstersNearby[5], main.monstersNearby[6], main.monstersNearby[7], main.monstersNearby[8], main.monstersNearby[9], main.monstersNearby[10], main.monstersNearby[11], main.monstersNearby[12], main.monstersNearby[13], main.monstersNearby[14], main.monstersNearby[15], main.monstersNearby[16], main.monstersNearby[17], main.monstersNearby[18], main.monstersNearby[19], }; @Override public int getSize() { return values.length; } @Override public String getElementAt(int i) { return values[i]; } }); scrollPane1.setViewportView(list1); } //---- button1 ---- button1.setText("> Foes >"); button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!list1.isSelectionEmpty()) { list2.setModel list1.remove(list1.getComponent(list1.getSelectedIndex())); } } }); What do you think would be a good method to handle this?
-
Trying to create a method to send list items back and forth using their respective buttons. //---- button1 ---- button1.setText("> Foes >"); button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!list1.isSelectionEmpty()) { list2.add(list1.getSelectedValue(), list1.getComponent(list1.getSelectedIndex())); list1.remove(list1.getComponent(list1.getSelectedIndex())); } } }); Tried this method. I know i'm doing something wrong because I have no idea what a component is and I couldn't find a method that didn't use components with Intellisense. Someone helppppp D:
-
Creating a JFormDesigner Form View from code?
Paradox68 replied to Paradox68's topic in Scripting Help
That does not really contribute to the problem in the thread.... -
I can generate code from the design view, but how do I generate a design view to edit from the code? I can't find anything in Eclipse to do so. when I try to select all the code and click "Open with > JFormDesigner Edit" it shows this:
-
No. Oh. Lol. wut. yeah?? i guess. Too much effort. Depending on the person. For me, it's not. Welllllllllllll Opinion. I don't like basketball so no thank you.
-
It's not a new year until it's a new year for me, bitches.
-
Fuck netbeans. I'm already so used to Eclipse.
-
When I try to register for a trial key with a new e-mail it says I have to use the one I used previously. When I try to register with the one I used previously it says i've used too many trial keys. How do I get around this without having to buy JFormDesigner?