Jump to content

fre024

Members
  • Posts

    68
  • Joined

  • Last visited

  • Feedback

    100%

Profile Information

  • Gender
    Male

Recent Profile Visitors

1142 profile views

fre024's Achievements

Iron Poster

Iron Poster (3/10)

3

Reputation

  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); }
×
×
  • Create New...