Jump to content

TorRS

Members
  • Posts

    21
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

983 profile views

TorRS's Achievements

Bronze Poster

Bronze Poster (2/10)

1

Reputation

  1. Do you have any suggestions on how to approach this problem, the only other thing I can think of currently is just copy-pasting the code from script to script and I'm trying to avoid that. I would prefer if I was able to change it once and be able to import it in all the scripts. Thanks again for the responses guys
  2. Yes, the script part works fine but when i try to turn one of my classes into a jar file and import them in another project it wont work If they are in the same project everything works as intended but the moment i try to export the class as a jar and import it and do everything the same it wont work and i get the error Ex code: Main class: @ScriptManifest(author = "Me", name = "example", info = "", version = 1, logo = "") public class Main extends Script { @Override public int onLoop() { Printer.testPrint(this); return 1000; } } Another class that I'm trying to turn into a jar file for the purpose of making it easier to implement in all of my scripts: import org.osbot.rs07.script.MethodProvider; public class Printer { public static void testPrint(MethodProvider mp){ mp.log("Hello world"); } }
  3. No matter what I found online didn't work, I tried exporting as jar and runnable jars, and I even switched from Eclipse to IntelliJ and played around with the artifacts without success. In the script, everything looks alright but when I run the script I get the java.lang.NoClassDefFoundError. Would appreciate some help and guidance, Thanks
  4. My problem is that when I use WebWalking it often clicks on another side of a wall and then it walks a long path until it actually goes the right direction. This is very bot like and hurts the overall efficiency of the bot. What i want to ask is is there a way to prevent this?
  5. Did this and something else VERY important that i forgot is i forgot to "call" starter on the onStart function. *FACEPALM* thanks dude you helped me a lot today
  6. When i start the script this error comes: [ERROR][Bot #1][08/19 08:04:33 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.api.map.Area.contains(kn:165) at flourMaker.Grind.grinder(Grind.java:92) at flourMaker.Main.onLoop(Main.java:24) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(qn:254) at java.lang.Thread.run(Unknown Source) And as far as I understood it I have to do some sort of null check but dont know how to do it The code: package flourMaker; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.MethodProvider; public class Grind extends MethodProvider{ final Area BANK_AREA = new Area(3183, 34405, 3185, 3444); final Area GUILD_TRAY = new Area(3142, 3449, 3146, 3446); final Area GUILD_HOPPER = new Area(3140, 3452, 3143, 3450).setPlane(2); final int BANK_BOTH_ID = 10583; final int GRAIN_ID = 1947; final String HOPPER_NAME = "Hopper"; final String CONTROLS_NAME = "Hopper controls"; boolean tray = false; boolean con = false; boolean shouldGrain; boolean finishedGrain; Inventory inv; Player player; Bank bank; public void starter() { exchangeContext(getBot()); inv = getInventory(); player = myPlayer(); bank = getBank(); } public void grinder() throws InterruptedException { if (inventory.isFull() && inventory.contains(GRAIN_ID)) { shouldGrain = true; } Entity hopper = getObjects().closest(HOPPER_NAME); Entity controller = getObjects().closest(CONTROLS_NAME); Entity bankbooth = getObjects().closest(BANK_BOTH_ID); if (shouldGrain) { if (GUILD_HOPPER.contains(player)) { if (inventory.contains(GRAIN_ID)) { if (!con) { if (hopper != null) { if (hopper.isVisible()) { if (!player.isAnimating()) { if (!player.isMoving()) { hopper.interact("Fill"); sleep(random(1500, 2000)); con = true; } } } else { getCamera().toEntity(hopper); } } } else { if (controller != null) { if (controller.isVisible()) { if (!player.isAnimating()) { if (!player.isMoving()) { controller.interact("Operate"); sleep(random(1500, 2000)); con = false; } } } } } } else { tray = true; shouldGrain = false; controller.interact("Operate"); sleep(random(1500, 2000)); } } else { getWalking().webWalk(GUILD_HOPPER); } } else { if (BANK_AREA.contains(player)) { if (bank.isOpen()) { bank.withdrawAll(GRAIN_ID); } else { if (bankbooth != null) { if (bankbooth.isVisible()) { bankbooth.interact("Bank"); sleep(random(2000, 3000)); } else { getCamera().toEntity(bankbooth); } } } } else { getWalking().webWalk(BANK_AREA); } } } } AS far as I understood it the problem is something to do with the areas but dont know what to do
  7. I am new to scripting and so far when I created a script, I put it all in one class and things went pretty smoothly. But now I wanted to learn how to script while also using different classes and Ive tried stuff but nothing worked and I couldn't fin a tutorial on this anywhere. Would be awesome if someone could link a tutorial or something
  8. Got any link where i can read into this, if u dont mind
  9. Thanks a lot guys, it works now
  10. Today I was testing some stuff and tried to make a new script that basically makes flour in the cooking guild. But my problem is that the script wont even start, I tried out to see if onStart will function but not even that works. Looked at some of my other scripts and I don't see why it wont start. And when i run the script I cant control the player anymore My code (A mess ik): package flourMaker; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "TorRS", info = "Makes Flour", name = "Flour Maker", version = 0, logo = "") public class Main extends Script { boolean tray = false; boolean con = false; boolean shouldGrain; boolean finishedGrain; final Area BANK_AREA = new Area(3167, 3490, 3169, 3489); final Area GUILD_TRAY = new Area(3142, 3449, 3146, 3446); final Area GUILD_HOPPER = new Area(3140, 3452, 3143, 3450).setPlane(2); final int BANK_BOTH_ID = 10060; final int GRAIN_ID = 1947; final String HOPPER_NAME = "Hopper"; final String CONTROLS_NAME = "Hopper controls"; Inventory inventory = getInventory(); Player player = myPlayer(); Bank bank = getBank(); @Override public void onStart() throws InterruptedException { log("We are off"); super.onStart(); } @Override public int onLoop() throws InterruptedException { if (inventory.isFull() && inventory.contains(GRAIN_ID)) { shouldGrain = true; } if (tray == false) { if (shouldGrain == true) { if (GUILD_HOPPER.contains(player)) { if (inventory.contains(GRAIN_ID)) { Entity hopper = getObjects().closest(HOPPER_NAME); Entity controller = getObjects().closest(CONTROLS_NAME); if (con == false) { if (hopper != null) { if (hopper.isVisible()) { if (!player.isAnimating()) { if (!player.isMoving()) { hopper.interact("Fill"); sleep(random(1500, 2000)); con = true; } } } else { getCamera().toEntity(hopper); } } } else { if (controller != null) { if (controller.isVisible()) { if (!player.isAnimating()) { if (!player.isMoving()) { controller.interact("Operate"); sleep(random(1500, 2000)); con = false; } } } } } } else { tray = true; shouldGrain = false; } } else { getWalking().webWalk(GUILD_HOPPER); } } else { if (BANK_AREA.contains(player)) { Entity bankbooth = getObjects().closest(BANK_BOTH_ID); if (bank.isOpen()) { bank.withdrawAll(GRAIN_ID); } else { if (bankbooth != null) { if (bankbooth.isVisible()) { bankbooth.interact("Bank"); sleep(random(2000, 3000)); } else { getCamera().toEntity(bankbooth); } } } } else { getWalking().webWalk(BANK_AREA); } } } else { // Get pots and empty tray } return random(400, 600); } @Override public void onExit() throws InterruptedException { log("WE out"); super.onExit(); } }
  11. Hey guys, im trying to create an area it just takes the x and y cords and have not found a way to make it so it also uses the z cords.
×
×
  • Create New...