Jump to content

mitsuki

Lifetime Sponsor
  • Posts

    121
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by mitsuki

  1. okay, thank you for the advice! PS. did you learn java before writing scripts? or did you learn through this? Cheers, Mitsuki
  2. Hey guys, I've been working on a script that cooks at the lumbridge kitchen (after cooks assistant quest). The script works, but the two main problems I have with it are as follows: 1. When it clicks on "Raw shrimps" in the inventory, it seems to freeze, and doesn't use it with the range for like 8+ seconds, which seems really bot like. 2. When the widget comes up over the dialogue box, it doesn't detect it, so it uses the raw shrimps with the range a second time, then detects it. Anyone know why it is doing this? I thought my code seemed fine? Below is my script, thank you in advance dudes. import javax.swing.JOptionPane; import org.osbot.rs07.accessor.XInteractableObject; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.utility.ConditionalSleep; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.Keyboard; import org.osbot.rs07.script.API; import org.osbot.rs07.api.Dialogues; import org.osbot.rs07.api.Widgets; import java.awt.*; import java.awt.event.KeyEvent; import org.osbot.rs07.api.Dialogues; @ScriptManifest(author = "Mitsuki", info = "CodeTest", name = "CodeTest", version = 0, logo = "") public class Main extends Script { public Area lumbridgeKitchen = new Area(3206, 3212, 3211, 3216); private RS2Widget getMyWidget() { RS2Widget cookShrimpWidget = getWidgets().get(270, 14); return cookShrimpWidget; } private boolean isMyWidgetWorking() { return getMyWidget() != null && getMyWidget().isVisible(); } @Override public void onStart() { log("Let's get started!"); } @Override public int onLoop() throws InterruptedException { if (lumbridgeKitchen.contains(myPlayer()) && getInventory().contains("Raw shrimps")) { getInventory().getItem("Raw shrimps").interact("Use"); if (getInventory().isItemSelected() == true) { RS2Object range = getObjects().closest("Cooking range"); range.interact("Use"); if (isMyWidgetWorking()) { log("Widget time"); getMyWidget().interact("Cook"); } } } return random(5000, 10000); } @Override public void onExit() { log("Thanks for running my AutoShrimper!"); } } Btw, all of the imports are there, even though they aren't being used, as this is my testcode file.
  3. do you mind if i pm you my code for a script? I've spent hours on it, and it was working fine, but now it only seems to get me to the location where i want to fish? maybe you'll see something in the code where i'm going wrong. Cheers dude
  4. How do I add a sleep? Do i just use return random(minsleeptime, maxsleeptime);?
  5. Okay dude, cheers! What about adding some sort of task feature, so that I can see if a user wants to use banking, then if they do, make the script bank instead of powerfishing?
  6. Managed to get it to walk to the area that I want finally! The only problem was that it only walked to the area if it is a 10 second walk away or less. Managed to use webWalking instead, and it seems to work much better It walks to my area, and nets fish until the inventory is full, then drops them all! How would I give the user an option, say to choose to bank or not? That way, I could try to add code to walk to the closest bank, and bank it all
  7. You, sir, are a godsend. Thank you for having the patience to explain all of this to me. I actually know a load of basic Java, but never had to try reading an api, or doing anything too creative, other than creating arrays and lists and stuff for uni projects. Thank you so much dude
  8. Ahh okay, thank you. Just reading the api seems like a nightmare, just trying to work out how to use it. I found this line of code to create an area: public Area(int x1, int y1, int x2, int y2) Would you essentially do this?: public Area(3000 x1, 3000 y1, 3100 x2, 3100 y2) and it would make a square area within 3000 x, 3000 y - 3100 x, 3000 y - 3100 x, 3100 y - 3000 x, 3100 y ? and I also can't tell how to name the area, or do you do something like: Lumbridge == public Area(3000 x1, 3000 y1, 3100 x2, 3100 y2) Is there a tutorial on how to read the api? Thank you dude
  9. I figured it out after. I never checked if the inventory was full, and therefore, the else if statement never ran. Cheers for your speedy response though. Any advice on how to start learning to move the player? like walking to a specific spot, or going to the bank? Cheers for all of the help dude, such doge
  10. I'm stuck with getting my script to work. It just stands still import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "Mitsuki", info = "AutoShrimper", name = "AutoShrimper", version = 0, logo = "") public class tanner extends Script { @Override public void onStart() { log("Let's get started!"); } @Override public int onLoop() throws InterruptedException { NPC FishingSpot = this.getNpcs().closest("Net Fishing spot"); if (getInventory().contains("Raw shrimps")) { getInventory().drop("Raw shrimps"); } if (getInventory().contains("Raw anchovies")) { getInventory().drop("Raw anchovies"); } else if (FishingSpot != null && !myPlayer().isAnimating()) { FishingSpot.interact("Net Fishing spot"); } return random(200, 300); } @Override public void onExit() { log("Thanks for running my AutoShrimper!"); } @Override public void onPaint(Graphics2D g) { } } Anything you notice to be wrong? Cheers
  11. To interact with a fishing spot, would you use getNPCs as apposed to getObjects?
  12. I've built it in intellij, but the script isn't showing up in the script selector? Any ideas? cheers for the guide btw
  13. can i get an auth please dude?
  14. just trying to point out that its not very human like
  15. but it clicks on the inventory icon at the middle top of the inventory gui, between quests and worn inventory, as apposed to just clicking again anywhere... As a real player, i never move my mouse on to the backpack icon, and click to deselct a selected item..
  16. yeah, the pestle and mortar dude
  17. This kept happening to me with swordfish and higher food. I found using lobsters makes the script flawless. It also wouldn't use b2p as food for me either. Just get some lobbys dude
  18. after it finishes crushing everything, it always moves the mouse back over the inventory icon before using the bank again. This is in mirror mode
  19. Does this support ge restocking like your crafting script?
  20. fresh account with registered email botted for a few hours, and its been banned. Also botted another account for about 5 hours, and that was banned. I would not suggest using this script in mirror mode I'll be testing it on stealth next weekend, as i've been recommended this script, and the other many khal scripts i have are really good quality.
  21. keeps getting caught by clicking on the machine, and is unable to close the window. Happens quite a bit. I'm using mirror mode It also walks past the conveyor belt sometimes, which looks very botlike, as noone else really ever does. Not sure if these issues are caused by mirror mode? Should i not use mm for this script?
  22. That's perfectly fine, no worries! Other than that, it seems flawless
  23. When i run it in mirror mode it actually works, as I can see it working on the osrs vanilla client, but it freezes the screen in my osbot client? Anyone know how to deal with this?
  24. Just purchased, and it doesn't load at all. Really frustrating xD
  25. When the house owner locks their house, the script keeps just trying to visit last visited house through the adboard over and over again. Other than that, seems to run smoothly
×
×
  • Create New...