Jump to content

Jack

Members
  • Posts

    2125
  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    100%

Everything posted by Jack

  1. private NPC getBestNpcToAttack(ArrayList<String> ourNames){ java.util.List<NPC> allNPCs= client.getLocalNPCs(); //all local npcs ArrayList<NPC> goodNPCs = new ArrayList<NPC>(); //all npcs with names we are looking for ArrayList<NPC> temp = new ArrayList<NPC>(); //A holder int[] currentBest = {-1,1000}; //Used in returning value //Find all npcs with names we are looking for for(int i = 0; i < allNPCs.size(); i++){ if(ourNames.contains(allNPCs.get(i).getName())){ temp.add(allNPCs.get(i)); } } //Make sure they exist, are alive, and attackable for(int i = 0; i < temp.size(); i++){ if((temp.get(i).exists())&&(temp.get(i).getHealth()>0)&&!temp.get(i).isUnderAttack()){ goodNPCs.add(temp.get(i)); } } if(goodNPCs.size()<1) return null; //No npcs you can fight else{ //Find out which npc is closest for(int i = 0; i < goodNPCs.size(); i++){ if(goodNPCs.get(i).getPosition().distance(myPlayer().getPosition())<currentBest[1]){ currentBest[0] = i; currentBest[1] = goodNPCs.get(i).getPosition().distance(myPlayer().getPosition()); } } if(currentBest[0]==-1) //Should never happen, just a check. return null; else{ return goodNPCs.get(currentBest[0]); //returns the closest npc } } } Usage: NPC openNPC = getBestNpcToAttack("NPC_NAME_HERE"); openNPC.interact("Attack"); Please post if you can improve it. I just threw this together really fast and thought it would be a good recourse for people new to scripting that want to make a combat script.
  2. get him maldy
  3. The rumors are true. You have no feelings :P I would but... you should like this
  4. osbot 2 is still not working...
  5. lol
  6. Mod Jack?
  7. This is how you test it...
  8. Jack

    999

    NO ALL MY POST ARE QUALITY!
  9. Jack

    999

    Dat postcount... Dat join date...
  10. Slow down?
  11. Jack

    Fletching script

    use [ code] //put code in here [/code ] to make the post look like: //put code in here
  12. .001/1000
  13. 5 your siggy is funny lol
  14. looks ok. there are a few already out though
  15. Dude jerks his ding dong for like 5 MONTHS but nothing ever COMES OUT.
  16. Got a quick fix?
  17. [INFO][02/26 08:52:37 PM]: The #1 and most popular free bot for OldSchool RuneScape! [ERROR][02/26 08:52:38 PM]: Uncaught exception! java.lang.ExceptionInInitializerError at java.net.Socket.setImpl(Unknown Source) at java.net.Socket.<init>(Unknown Source) at org.osbot.pB.IiIIIiIiII(Unknown Source) at org.osbot.BotApplication.IiiiiiiIiI(Unknown Source) at org.osbot.BotApplication.main(Unknown Source) Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "*" "read,write") at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at org.osbot.Ob.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPropertiesAccess(Unknown Source) at java.lang.System.getProperties(Unknown Source) at java.net.PlainSocketImpl$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.PlainSocketImpl.<clinit>(Unknown Source) ... 5 more [ERROR][02/26 08:53:09 PM]: Failed to log in! errors...
  18. thanks
  19. no
  20. So I stumbled upon a folder that has everyone's id picture in my school. I'm making a facemash site site with them as a senior prank. Wish me luck I think I wont get in trouble if I take it down after a day. http://en.wikipedia.org/wiki/History_of_Facebook
  21. uhhhhhhh
×
×
  • Create New...