Jump to content

fre024

Members
  • Posts

    68
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by fre024

  1. Should be a moneymaking script =)
  2. How do you use the interface debugger? When i try to load it says: Status: FAIL: You are not logged in!
  3. I looked into events before, but cannot figure out how to use them Can someone point me in the right direction? THx
  4. Very good job. Really appreciate the dedication u guys have for this community.
  5. That is a good idea, how do i do this? Cannot find anything about this in the API.
  6. I don't want it to walk at all, i just want it to interact with the npc without first walking to it.
  7. Anything wrong with this code? public void onMessage(Message message) throws InterruptedException { if (message.toString().contains("stunned")) { log("am stunned, pausing."); sleep(random(1000, 4000)); } if (message.toString().contains("during")) { log("In combat."); map.walk(new Position(3266, 3415, 0)); } } solved: need to use message.getMessage().toString().contains("stunned") npc.interact seem to walk with minimap way to often. Even it the npc is just 4 tiles away it walks on minimap somtimes...
  8. Thx for the reply. I 'll keep in mind to formatting the code. I find the target in a seperate method now, still the same lag The script runs fine, just want to reduce cpu usage.
  9. public boolean killbeast() throws InterruptedException { NPC beast = npcs.closest("beast"); // Player p = myPlayer(); Mylog("2"); loot(); Mylog("3"); if (combat.isFighting()) { Mylog("4"); Mylog("Already attacking beast"); spec(10); if (random(100) == 1) { combat.getFighting().interact("Attack"); } if (fillLootingBag()) { lootingBagEmpty = false; } return true; } Mylog("5"); if (!beast.isVisible()) { camera.toEntity(beast, true); } Mylog("6"); if (beast.isVisible()){ return beast.interact("Attack"); } return false; }
  10. NPC beast = npcs.closest("beast name"); does this lag for someone else? It uses alot of cpu power or it is this method interact.beast("Attack"); full code public boolean killbeast() throws InterruptedException { NPC beast = npcs.closest("beast"); // Player p = myPlayer(); Mylog("2"); loot(); Mylog("3"); if (combat.isFighting()) { Mylog("4"); Mylog("Already attacking beast"); spec(10); if (random(100) == 1) { combat.getFighting().interact("Attack"); } if (fillLootingBag()) { lootingBagEmpty = false; } return true; } Mylog("5"); if (!beast.isVisible()) { camera.toEntity(beast, true); } Mylog("6"); if (beast.isVisible()){ return public boolean killbeast() throws InterruptedException { NPC beast = npcs.closest("beast"); // Player p = myPlayer(); Mylog("2"); loot(); Mylog("3"); if (combat.isFighting()) { Mylog("4"); Mylog("Already attacking beast"); spec(10); if (random(100) == 1) { combat.getFighting().interact("Attack"); } if (fillLootingBag()) { lootingBagEmpty = false; } return true; } Mylog("5"); if (!beast.isVisible()) { camera.toEntity(beast, true); } Mylog("6"); if (beast.isVisible()){ return beast.interact("Attack"); } return false; }
  11. While this works 90% of the time. It is safe to walk in minimap distance with the object you want to interact with. If the object is not loaded ( black area on minimap) u cannot walk to with with ".interact" !!!
  12. Very usefull. Thx man ! But... return me wrong values for dragon bones. This is because Babydragon bones are in front of Dragon bones in the list. U have to search for name in info and make it case sensitive and problem solved. change: public int lookUpItemPrice(String name) { String info = getInfo(name); if(info != null && info.contains(name)){ info = info.substring(info.indexOf("average") + 10); info = info.substring(0, info.indexOf(",") - 1); if(info.contains(".")){ info = info.substring(0, info.indexOf('.')); } System.out.println(Integer.parseInt(info)); return Integer.parseInt(info); } return 0; } to public int lookUpItemPrice(String name) { String info = getInfo(name); if(info != null && info.contains(name)){ info = info.substring(info.indexOf(name));// <-------- added info = info.substring(info.indexOf("average") + 10); info = info.substring(0, info.indexOf(",") - 1); if(info.contains(".")){ info = info.substring(0, info.indexOf('.')); } System.out.println(Integer.parseInt(info)); return Integer.parseInt(info); } return 0; } is this right? EDIT: this is right !
  13. public void onMessage(String message) throws InterruptedException { Mylog("Checking chat"); if (message.contains("poisoned")) { } } This does nothing for me
  14. SOLVED I use this method, but it won't paint a thing on the client. public void onPaint(Graphics g) { long millis = System.currentTimeMillis() - /* this.variables. */startTime; long hours = millis / 3600000L; millis -= hours * 3600000L; long minutes = millis / 60000L; millis -= minutes * 60000L; long seconds = millis / 1000L; // DateFormat df = new SimpleDateFormat("mm:ss"); g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 15)); g.drawString("Main script state: " + (mainState), 150, 20); g.setColor(Color.ORANGE); g.setFont(new Font("Arial", Font.PLAIN, 12)); g.drawString("Sub script state: " + (subState), 25, 35); g.drawString("Time running: " + (hours + ":" + minutes + ":" + seconds), 25, 50); }
  15. I cannot open the spoilers?? wtf is going on. I am useing google chrome.
  16. fre024

    walk();

    I want to click on the tile not walk. Sorry for the missconception Help me out here please, i am still learning. MiniMapTileDestination(bot, Tile); method is undefined.
  17. fre024

    walk();

    It is not possible? Can i not use mouse.click(dunno what comes here);
  18. fre024

    walk();

    This method will not walk to the tile if it is unreachable (for example water). // ignore : How can i walk to a tile on water? how can i CLICK on a tile on water? thx
  19. fre024

    OSBot 2.1.11

    So many updates, makes me excited
  20. Why is this not working, it only eats the item in the first inventory slot. public boolean eat() { if (!foodInInv) { Mylog("No food in inventory."); return false; } Item[] invItems = getInventory().getItems(); if (invItems != null) { for (int i = 0; i < 28; i++) { Mylog(Integer.toString(i)); if (invItems[i].getName() != null) { Mylog("test"); String[] itemActions = invItems[i].getDefinition() .getActions(); Mylog("test 1"); for (int ii = 0; ii < itemActions.length; ii++) { Mylog("test 2"); if (itemActions[ii].equalsIgnoreCase("Eat")) { Mylog("test 3"); if (invItems[i].interact("Eat")){ return true; } Mylog("test 4"); } Mylog("test 5"); } } Mylog("No item at this inv slot: " + i); } } foodInInv = false; Mylog("No food in inventory."); return false; } this is the log i get: [iNFO][bot #1][06/03 01:54:29 PM]: 0 [iNFO][bot #1][06/03 01:54:29 PM]: test [iNFO][bot #1][06/03 01:54:29 PM]: test 1 [iNFO][bot #1][06/03 01:54:29 PM]: test 2
  21. Hello all, this don't work for me. Gives wrong results. Mylog("hp = " + Integer.toString(p.getHealth())); What am i doing wrong? SOLVED: Gets the health in percentage form. (0% - 100%). Please NOTE: this is only updated in combat, which means if you got out of combat and then your hp changed, this won't reflect this. For this you should use the actual skills to check.
  22. fre024

    hover();

    I want to use hover(); because withdrawing items from the bank is very inacurrate for me. Look at the code below, i can only withdraw the weapon. After hover() the method stops. What am i doing wrong? @SuppressWarnings("unused") public boolean equip() throws InterruptedException { Inventory i = getInventory(); Bank b = getBank(); if (mainState == "Collecting white berries.") { if (openBank()) { if (!i.isEmpty()) { b.depositAll(); } b.depositEquipment(); String[] webSlashWeaponArray = { "sword ", "axe", "dagger" }; Item webSlashWeapon = getBankItemForNameThatContains(webSlashWeaponArray); Mylog(webSlashWeapon.getName()); if (28 - i.getEmptySlots() < 2) { if (webSlashWeapon != null) { webSlashWeapon.hover(); if (b.withdraw(webSlashWeapon.getId(), 1)) { sleep(random(1000, 3000)); } } else { Mylog("Out of weapons to slash webs"); stop(); } } if (!i.contains("Anti-dragon shield")) { if (!b.contains("Anti-dragon shield")) { Mylog("Out of anti-dragon shields"); stop(); } b.getItem("Anti-dragon shield").hover(); Mylog("test"); if (b.withdraw("Anti-dragon shield", 1)) { sleep(random(1000, 2000)); } } if (i.contains("Anti-dragon shield")){ b.close(); } sleep(random(1500, 2500)); if (i.interact("Wear", "Anti-dragon shield")) { sleep(random(500, 1500)); } i.interact("Wield", webSlashWeapon.getName()); sleep(random(500, 1500)); } return equipment .isWearingItem(org.osbot.rs07.api.ui.EquipmentSlot.WEAPON) && equipment .isWearingItem(org.osbot.rs07.api.ui.EquipmentSlot.SHIELD); } return false; }
  23. What is this about? [ERROR][Bot #1][05/23 12:11:14 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(zn:60) at java.lang.Thread.run(Unknown Source) [ERROR][Bot #1][05/23 12:11:15 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(zn:60) at java.lang.Thread.run(Unknown Source) [ERROR][Bot #1][05/23 12:11:16 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(zn:60) at java.lang.Thread.run(Unknown Source) [ERROR][Bot #1][05/23 12:11:17 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(zn:60) at java.lang.Thread.run(Unknown Source) [ERROR][Bot #1][05/23 12:11:18 PM]: Error in script executor! java.lang.NullPointerException at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(zn:60) at java.lang.Thread.run(Unknown Source) now i get this error [ERROR][05/23 05:39:36 PM]: Uncaught exception! java.lang.IllegalMonitorStateException at java.util.concurrent.locks.ReentrantLock$Sync.tryRelease(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer.release(Unknown Source) at java.util.concurrent.locks.ReentrantLock.unlock(Unknown Source) at java.util.concurrent.LinkedBlockingQueue.take(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) or this [ERROR][05/23 06:42:28 PM]: Uncaught exception! java.lang.ThreadDeath at java.lang.Thread.stop(Unknown Source) at org.osbot.rs07.event.ScriptExecutor.restart(ip:405) at org.osbot.rs07.event.ScriptExecutor.suspend(ip:226) at org.osbot.rs07.event.ScriptExecutor.stop(ip:156) at org.osbot.rs07.event.ScriptExecutor.stop(ip:113) at org.osbot.NA.run(im:570) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
×
×
  • Create New...