saturn Posted August 2, 2021 Share Posted August 2, 2021 (edited) Use this simple snippet to hover over any game object like an NPC, SceneObject, GroundItem and Players: import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.entity.GameEntity; public class Hover { public static boolean hover(APIContext ctx, GameEntity ge){ if(!isHovering(ctx, ge)){ return ge.hover(); } return true; } private static boolean isHovering(APIContext ctx, GameEntity ge){ return ge.contains(ctx.mouse().getLocation()); } } How to use this snippet: In your project, save the above snippet in a file called Hover.java In your script, when you want to hover over something use the snippet like in the example below Example for hovering over a Banker NPC: APIContext ctx = getAPIContext(); Npc banker = ctx.npcs().query() .named("Banker") .actions("Bank") .results() .nearest(); if(banker != null){ boolean hovering = Hover.hover(ctx, banker); //Use the hovering variable however you see fit, or ignore it if it's unnecessary } Edited August 2, 2021 by saturn 1 Quote Link to comment Share on other sites More sharing options...
Sellout Posted August 2, 2021 Share Posted August 2, 2021 Nice snippet 😄 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.