-
Posts
140 -
Joined
-
Last visited
-
Feedback
100%
Everything posted by ikk
-
Woot, would be dope! Free is good
-
Hey! Congrats man! It felt so rewarding when my first script finally started to run flawlessly. Forgot to mention it above, but if you wanted to take a look at other people's .jars on here then it would be a good idea to download a Java decompiler. I've been using JD GUI and it's a piece of cake to use Oh wow, that makes a lot of sense. I know so little about Java at the moment I don't think I could have figured that one out on my own right now tbh. But that is a big help, thanks
-
I've spent the past month of so trying to learn how to start writing scripts here with little-to-no experience in coding. What helped me the most was looking through the downloadable script section, downloading .jars that people posted, and try to read their scripts and understand what they're doing, and why. It's also a good idea to read scripts written for other botting sites. Just keep in mind that by doing this, you may not be looking at the most optimized code. If you can find source code for more premium bots that would be a huge help for you to learn from. Also, about the conditional sleeping talk above, here is how Explv showed me to do it: new ConditionalSleep(7000) { @Override public boolean condition() throws InterruptedException { return (S.chatbox.isVisible()); } }.sleep(); If this needs explaining, this method will sleep until the condition you input returns true. However, if the condition never returns true, it will only sleep the preset amount. So the conditional sleep above will sleep until the chatbox is visible, but if the chatbox is never visible, it will stop sleeping after 7 seconds I've tried to condense it down since conditional sleeps are so common, but I couldn't get it to work Here's how I tried, maybe someone will know why this didnt work: public void customSleep(boolean sleepUntil, int sleepMax){ new ConditionalSleep(sleepMax) { @Override public boolean condition() throws InterruptedException { return (sleepUntil); } }.sleep(); }
-
Thanks for the help guys! Didn't know that OSBot wouldn't automatically have support for JGoodies. Also, I found out the issue which was causing the script to crash upon start up. Was due to me trying to use a font that was unsupported. Looks like my GUI has a JFormDesigner watermark on it that I cannot get rid of, but it could be worse Got rid of all the JGoodies dependencies and unusual fonts and here she is:
-
Hey everyone. I've spent way too much time today tinkering with GUIs. I made one which worked fine but was a bit too basic looking for me. So, I decided to try using WindowBuilder, but the code that produced ended up simply crashing my script on launch every time without any errors. So I instead tried to use JFormDesigner to make the GUI. I've made one which I am quite pleased with, however it is throwing me a ClassNotFound error which I am unsure how to solve. Here's the error: 16 01:50:41 AM]: Loading GUI [ERROR][01/16 01:50:41 AM]: Uncaught exception! java.lang.NoClassDefFoundError: com/jgoodies/forms/factories/DefaultComponentFactory at Core.GUI.initComponents(GUI.java:30) at Core.GUI.<init>(GUI.java:24) at Core.ikkDefenders.onStart(ikkDefenders.java:72) at org.osbot.rs07.event.ScriptExecutor.IiiiIIiIII(qf:246) at org.osbot.rs07.event.ScriptExecutor.start(qf:8) at org.osbot.coM8.run(aj:153) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.jgoodies.forms.factories.DefaultComponentFactory at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 9 more They should all be there, I'm not sure why this is giving me issues.. Screenshot: http://i.imgur.com/kYaKoMl.png All help greatly appreciated! Thanks in advance
-
Using osbuddy would be a nice thing to add, but wouldn't cover all the items that I might like to pick up as the monsters I am fighting also drop some worthwhile non-tradeable items. So in other words I'm trying to get the script to: -100% of the time pick up defenders and similar items -Give option for other items such as valuables and some other non-tradeables (Don't need to let them choose item-by-item) Yeah it kinda shows in my code that I'm not very comfortable with this yet. The "reason" for doing it in two different ways is because the method in the first if statement wouldn't allow me to enter in 3 parameters in the ArrayList so I tried getting it to work using the method in the else statement. Thanks a bunch for your input
-
I'm working on a script right now and I have a way that I can determine which loot the player should pick up but since I'm new with Java I'm sure it's not optimized. By default, the script will pick up one category of items I am giving the user the option to additionally pick up some valuable items that may come up Here is my current way of determining if they should pick up the valuables and merge the lists of items: public String[] getLoot() { if (!Config.enableLooting) { List<String> loot = new ArrayList<String>(Constants.LOOT_ARMOUR.length + Constants.LOOT_TOKEN.length); Collections.addAll(loot, Constants.LOOT_ARMOUR); Collections.addAll(loot, Constants.LOOT_TOKEN); return loot.toArray(new String[loot.size()]); } else { ArrayList<String> temp = new ArrayList<String>(); temp.addAll(Arrays.asList(Constants.LOOT_ARMOUR)); temp.addAll(Arrays.asList(Constants.LOOT_TOKEN)); temp.addAll(Arrays.asList(Constants.LOOT_VALUABLE)); return temp.toArray(new String[Constants.LOOT_ARMOUR.length + Constants.LOOT_TOKEN.length + Constants.LOOT_VALUABLE.length]); } } This way does seem to work but I would love to hear other ideas on how this might be done
-
[Free] ikk's Al-Kharid Warriors [Food] [Potions] [Looting]
ikk replied to ikk's topic in Combat & Prayer
Thanks everyone for all the kind words! Has anyone tested out the script yet? That XP/h is not guaranteed for all users. That xp/h was on an account with 70 attack, 70 strength, abyssal whip, and potions I put a lot of work into trying to get this to be as optimized as I could. Earlier in development I was getting 24k - 28k xp/h with 60 att, 60 str, dragon scimmy, and no potions. I have no idea what xp/h to expect for lower levels, but would love to hear feedback from users & see screenshots of it in use! -
Tried this out to obfuscate my first script but It's giving me an error. Am I just being dumb? Here's the contents of new.pro: -injars C:\Users\Cody\OSBot\Scripts\ikkWarriors.jar -outjars C:\Users\Cody\OSBot\Scripts\Obfuscated\ikkWarriors_obf.jar -libraryjars C:\Users\Cody\Desktop\OSBot 2.4.33.jar -libraryjars C:\Program Files\Java\jre1.8.0_66\lib\rt.jar -keepattributes *Annotation* -keep public class package.Core
-
SCRIPT HAS BEEN UPDATED 5/31/2016 Please post and/or PM any bugs found. Al-Kharid Warrior killer with support for banking, looting, eating, and potions Script has been re-written and should be much more efficient and stable Features: -Food supported: Trout, Salmon, Lobster, Swordfish, Monkfish, and Shark -Potions Supported: Super attack, Super strength, Attack potion, Strength potion, and Combat potions -Fights in either East or West room (chooses room with less players) -Lets other guards into your room if door closed for maximum XP per hour -Loots & banks herbs (excluding some lower level ones for more GP per hour) -GP per hour shown in paint -Small antiban features: Random camera movements, Right click loot stacks, & Hover next enemy Any other ideas for features? Post them in this thread or PM me! GUI: Progress Reports: Download .Jar - Updated 5/31/2016: (Place .Jar in User/OSBot/Scripts) Would really appreciate critiques on my code! Still learning and trying to become better with Java https://www.mediafire.com/?6czm6a7m58qu25h VirusTotal Scan: https://www.virustotal.com/en/file/bf55f16bc2cd599aa7e6edcb7538fb0ce0f4148cac838dd598aa8e5a6bbb0bac/analysis/1452727716/ I would also like to give credits to Sinatra for letting people use his Varrock Guard killer as a base for their first scripts. It was a great help to understanding a node based way of writing scripts. I used that as the backbone for this for learning purposes, but mostly everything is changed now except for the banking method. Credits also go to Explv for helping me out on my thread post when I was having issues interacting with doors and drastically helped me with cleaning up my code + optimizations, huge help.
-
Why is it that the ConditionalSleep in the openDoor() method seems to always wait the full 5 seconds and not stop the sleep when the door is open like I would expect it to?
-
Oh man, thank you so much for the critique. This was all so helpful, I've been trying to look at snippets and decompile .jars to see what good code is supposed to look like to speed up my learning process. The simplicity of the code you just wrote makes so much more sense than the way I had been doing it! I just spent the past hour or so rewriting the script to fit the style you demonstrated. Because of your help, my script is running soo much smoother and I'm getting more combat xp/h too! I really appreciate the help, can't wait to release my first script once all the last remaining bugs are fixed. I'll give you credits for helping me out
-
Oh, my mistake. Thank you so much, I was able to get it to work because of that! I also realized I needed some null checks for the areas I was trying to walk to. It's workin right now, but I don't think the code is very optimal because it's quite slow / somewhat glitchy. Any critiques would be greatly appreciated package Nodes; import org.osbot.rs07.api.DoorHandler; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.script.Script; import org.osbot.rs07.api.webwalk.dir.WalkToTile; import org.osbot.rs07.input.mouse.MiniMapTileDestination; import Core.Node; import Data.Constants; import Utils.Walking; public class PickRoom extends Node { Walking walk = new Walking(this.sA); Constants c = new Constants(); public PickRoom(Script sA) { super(sA); } public String status() { return "Choosing Fight Room"; } public boolean shouldBank() { return ( (this.sA.inventory.isFull() && this.sA.inventory.getAmount(Constants.FOOD) < 6) || ( !this.sA.inventory.contains(Constants.FOOD) ) ); } public boolean validate() throws InterruptedException { return ( Constants.AK_CHOOSE_AREA.contains(this.sA.myPlayer()) && !shouldBank()); } public void walkSleep() throws InterruptedException { while (this.sA.myPlayer().isMoving()) { Script.sleep(100 + Script.random(125)); } } public Area getHall() { if (Constants.EAST_HALL.contains(this.sA.myPlayer())) { return Constants.EAST_HALL; } else if (Constants.WEST_HALL.contains(this.sA.myPlayer())) { return Constants.WEST_HALL; } else return null; } public Area getFightArea() { if (getHall() == Constants.EAST_HALL) { return Constants.AK_EAST_FIGHT; } else if (getHall() == Constants.WEST_HALL) { return Constants.AK_WEST_FIGHT; } else return null; } public Position[] getFightPos() { if (getHall() == Constants.EAST_HALL) { return Constants.EAST_START2; } else if (getHall() == Constants.WEST_HALL) { return Constants.WEST_START2; } else return null; } public boolean execute() throws InterruptedException { /* * Check which half * check door of half * if open walk through */ //If Player isn't in fight zone if (!Constants.AK_EAST_FIGHT.contains(this.sA.myPlayer()) || !Constants.AK_WEST_FIGHT.contains(this.sA.myPlayer())) { //Null checks if (getHall() != null && getFightArea() != null && getFightPos() != null) { //If obstacle is found if ( this.sA.doorHandler.getNextObstacle(getFightArea().getRandomPosition()) != null ) { //Wait while moving, then open door if (this.sA.doorHandler.handleNextObstacle(getFightArea())) { this.sA.log("Opened door"); Script.sleep(400 + Script.random(400)); walkSleep(); } } //If no obstacle, walk inside else { //this.sA.localWalker.walk(getFightPos()); //this.walk.walkPath(getFightPos()); //^^For some reason these wouldn't walk into the room because // the tile I was trying to walk to was too close to my character this.sA.mouse.click(new MiniMapTileDestination(this.sA.bot, getFightPos()[0]), false); walkSleep(); this.sA.log("Walking into room"); } } } Script.sleep(250 + Script.random(750)); return true; } }
-
I'm fairly certain, this is the debug I'm getting in the logger: [INFO][Bot #1][01/04 01:09:07 PM]: Terminating script ikkWarriors... [ERROR][Bot #1][01/04 01:09:07 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.api.DoorHandler.getObstacles(vk:52) at org.osbot.rs07.api.DoorHandler.getNextObstacle(vk:22) at Nodes.PickRoom.execute(PickRoom.java:81) at Core.ikkWarriors.onLoop(ikkWarriors.java:83) at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(we:22) at java.lang.Thread.run(Unknown Source) [INFO][Bot #1][01/04 01:09:07 PM]: Script ikkWarriors has exited! And line 83 is the line that I pointed out in the post above. It's really weirding me out because this code worked fine yesterday, I can't figure out what I changed to make everything mess up. Here is the whole Node that I'm working from if that is of any more use: package Nodes; import org.osbot.rs07.api.DoorHandler; import org.osbot.rs07.script.Script; import Core.Node; import Data.Constants; import Utils.Walking; public class PickRoom extends Node { Walking walk = new Walking(this.sA); Constants c = new Constants(); public PickRoom(Script sA) { super(sA); } public String status() { return "Choosing Fight Room"; } public boolean shouldBank() { return ( (this.sA.inventory.isFull() && this.sA.inventory.getAmount(Constants.FOOD) < 6) || ( !this.sA.inventory.contains(Constants.FOOD) ) ); } public boolean validate() throws InterruptedException { return ( Constants.AK_CHOOSE_AREA.contains(this.sA.myPlayer()) && !shouldBank()); } public boolean execute() throws InterruptedException { if (!Constants.AK_EAST_FIGHT.contains(this.sA.myPlayer()) || !Constants.AK_WEST_FIGHT.contains(this.sA.myPlayer())) { DoorHandler doorHandler = new DoorHandler(); if (Constants.EAST_HALL.contains(this.sA.myPlayer())) { if ( doorHandler.getNextObstacle(Constants.AK_WEST_FIGHT.getRandomPosition()) != null) { doorHandler.handleNextObstacle(Constants.AK_WEST_FIGHT); Script.sleep(300 + Script.random(1000)); this.sA.log("Opened door"); } else { this.walk.walkPath(Constants.WEST_START2); this.sA.log("Entering west room"); } } else if (Constants.WEST_HALL.contains(this.sA.myPlayer())) { if ( doorHandler.getNextObstacle(Constants.AK_WEST_FIGHT.getRandomPosition()) != null) { doorHandler.handleNextObstacle(Constants.AK_WEST_FIGHT); Script.sleep(300 + Script.random(1000)); this.sA.log("Opened door"); } else { this.walk.walkPath(Constants.WEST_START2); this.sA.log("Entering west room"); } } } Script.sleep(250 + Script.random(750)); return true; }
-
Hey, I'm extremely new to scripting currently trying to work out all the bugs in my first script. I'm trying to use the door handler to open my doors but at the moment I'm getting errors in my script. Here's the code: if ( doorHandler.getNextObstacle(Constants.AK_WEST_FIGHT.getRandomPosition()) != null) { doorHandler.handleNextObstacle(Constants.AK_WEST_FIGHT); //^^ This is the line causing the error Script.sleep(300 + Script.random(1000)); this.sA.log("Opened door"); } else { this.walk.walkPath(Constants.WEST_START2); this.sA.log("Entering west room"); } Any help with this would be greatly appreciated