Trivial Posted December 29, 2014 Share Posted December 29, 2014 Im trying to get my fishing script to hover over the next fishing spot to interact with. I use josedpay's hovering snippet from this thread: http://osbot.org/forum/topic/54533-hovering-snippet-osbot-2/ Heres what im currently working with, but it only very rarely hovers over fishing spots. NPC Fishing_spot = npcs.closest(FISHING_ID); if(myPlayer().isAnimating()){ int playerX = myPlayer().getPosition().getX() + 2; int playerY = myPlayer().getPosition().getY() + 2; int playerX2 = myPlayer().getPosition().getX() - 2; int playerY2 = myPlayer().getPosition().getY() - 2; Area NearPlayer = new Area(playerX, playerY, playerX2, playerY2); if(Docks1.contains(myPlayer())){ if(Docks1.contains(Fishing_spot)){ if(!NearPlayer.contains(Fishing_spot)){ if(Fishing_spot.isVisible()){ hover(Fishing_spot); } else { camera.toEntity(Fishing_spot); } } } } else if(Docks2.contains(myPlayer())){ if(Docks2.contains(Fishing_spot)){ if(!NearPlayer.contains(Fishing_spot)){ if(Fishing_spot.isVisible()){ hover(Fishing_spot); } else { camera.toEntity(Fishing_spot); } } } } } Link to comment Share on other sites More sharing options...
Joseph Posted December 29, 2014 Share Posted December 29, 2014 you can hover with entity#hover() you can get player area player#getArea(radius); filter entity, using name, if entity not interacting with you, and within your area. base snippet public boolean hoverNextEntity(String name) { RS2Object entity = objects.closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object o) { //filter them out return true; } }); return entity.hover(); } Link to comment Share on other sites More sharing options...
Eliot Posted December 29, 2014 Share Posted December 29, 2014 entity.hover(); Link to comment Share on other sites More sharing options...
Trivial Posted December 29, 2014 Author Share Posted December 29, 2014 Oh crap, got a huge brainfart so I didnt figure that out... Thanks though. Link to comment Share on other sites More sharing options...
Joseph Posted December 30, 2014 Share Posted December 30, 2014 Oh crap, got a huge brainfart so I didnt figure that out... Thanks though. finding the next available entity is he head ache. one you find it. You do entity.hover(); then your done. Link to comment Share on other sites More sharing options...