Pseudo 179 Share Posted February 8, 2018 Im about to see if this works pseudo, that is exactly what I was looking for. so if that doesn't work for whatever reason and I want to add more checks to the filter do I just separate by &&? I really appreciate it bro Pretty much, let me know if you run into any problems. And no problem. Link to comment Share on other sites More sharing options...
AsBakedAsCake 202 Share Posted February 8, 2018 Pretty much, let me know if you run into any problems. And no problem. I'm glad you're willing to help. So here is my current line: public static final Filter<NPC> SEAGULL_FILTER = npc -> npc != null && npc.getName().equals(SEAGULL) && !npc.isHealthBarVisible() && !npc.isInCombat() && !npc.isInteractedWith() && !npc.isAnimating(); It's still attacking NPC's in combat with what I have above. Any ideas of what else I can do? if I write it the way you posted with the extra parentheses the last bit says ; is expected even though I already have it there : NPC npc = getNpcs().closest(o -> o != null && o.getName().contains("name") && !o.isInCombat() && !o.isInteractedWith()); Link to comment Share on other sites More sharing options...
sr24 25 Share Posted February 8, 2018 I'm glad you're willing to help. So here is my current line: public static final Filter<NPC> SEAGULL_FILTER = npc -> npc != null && npc.getName().equals(SEAGULL) && !npc.isHealthBarVisible() && !npc.isInCombat() && !npc.isInteractedWith() && !npc.isAnimating(); It's still attacking NPC's in combat with what I have above. Any ideas of what else I can do? if I write it the way you posted with the extra parentheses the last bit says ; is expected even though I already have it there : NPC npc = getNpcs().closest(o -> o != null && o.getName().contains("name") && !o.isInCombat() && !o.isInteractedWith()); try running it with an if statement i'm not at home to look at it correctly but i think you can use an if and be okay Link to comment Share on other sites More sharing options...
AsBakedAsCake 202 Share Posted February 8, 2018 try running it with an if statement i'm not at home to look at it correctly but i think you can use an if and be okay I'll try it and let you know if it works, Ill take any help I can get. Thanks guys. Link to comment Share on other sites More sharing options...
Xephy 237 Share Posted February 9, 2018 There could very well be multiple things going on here. You could be getting the NPC before it's in combat and then trying to attack it after the fact. I think we'd need to see things in action and run through it piece by piece to truly see where the problem lies. You should also do the same. Make sure you're getting the NPC directly before you try to attack it so that you're not trying to attack an outdated NPC. Try running logs or paint info that highlights the current tile of the NPC and outputs whether or not that NPC is in combat, interacted with, health bar visible, etc etc etc. Link to comment Share on other sites More sharing options...
AsBakedAsCake 202 Share Posted February 9, 2018 the tutorial wasn't very clear on this aspect: You're supposed to attack/interact with the cow filter, not the actual cow. (How are you going to use the filter if you're interacting with the cow and not the filter?) ^^if you're trying to use the filter from Rickk's video. Fixed 90 percent of my problems. #CreditToHashTagForMakingMeLookLikeAnAss Now to get through this level up message with the right line, Npc retreats and leaves my guy hanging after leveling up sometimes Link to comment Share on other sites More sharing options...
Pengu 23 Share Posted February 9, 2018 Now to get through this level up message with the right line, Npc retreats and leaves my guy hanging after leveling up sometimes You could fix that by checking: if (getDialogues().canContinue()) { getDialogues().clickContinue(); Link to comment Share on other sites More sharing options...
AsBakedAsCake 202 Share Posted February 9, 2018 You could fix that by checking: if (getDialogues().canContinue()) { getDialogues().clickContinue(); Trying now, thanks G. I tried this but it didn't work: }else{ WidgetChild clickTOcontinueWidg = getWidgets().getWidgetChild(233, 2); if(clickTOcontinueWidg != null && clickTOcontinueWidg.isVisible()){ clickTOcontinueWidg.interact("Click here to continue"); Link to comment Share on other sites More sharing options...
Pengu 23 Share Posted February 9, 2018 Trying now, thanks G. I tried this but it didn't work: }else{ WidgetChild clickTOcontinueWidg = getWidgets().getWidgetChild(233, 2); if(clickTOcontinueWidg != null && clickTOcontinueWidg.isVisible()){ clickTOcontinueWidg.interact("Click here to continue"); u dont need to use widgets for it https://dreambot.org/javadocs/org/dreambot/api/methods/dialogues/Dialogues.html Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.