AsBakedAsCake 202 Share Posted January 31, 2018 I finally got some spare time again and decided I would try to make another tiny script, anyways.. I have two problems with this: https://pastebin.com/nN7XZ70z #1: It still tries to attack seagulls that are already in combat. (I tried checking for the health bar but maybe I did this incorrectly?) #2: Every time it levels up and the seagull moves away, it stops attacking. I followed Rickk's tutorial to make the script, I'm almost certain I followed it 100%. Can someone point out what I need to add/did wrong here? Thanks Link to comment Share on other sites More sharing options...
Scorpius 144 Share Posted January 31, 2018 isInCombat() isInteractedWith() isStandingStill() Link to comment Share on other sites More sharing options...
Xephy 237 Share Posted January 31, 2018 You may want to add a check on the NPC's combat status in the filter. Or to be even more stringent, you may add something along the lines of the npc not being interacted with by any other players to your filter instead. I believe that the isInCombat method returns true only if both Characters are interacting with eachother. As for the level up issue, why not check for dialogue and either continue it or attack the seagull again if dialogue is present. Mind you, the framework and general structure of your script isn't particularly favored, but those should fix up your issues without you having to change things around too much. I would recommend you look at either implementing states and a switch statement that allows you to easily read what you're doing if you want to keep it in the same AbstractScript framework, or investigate the TaskScript framework, which should make everything much nicer overall. @iamreyne had a great example of a taskscript framework on one of his local scripts if I remember correctly. Link to comment Share on other sites More sharing options...
dQw4w9WgXcQ 184 Share Posted January 31, 2018 it doesnt Link to comment Share on other sites More sharing options...
Tweeboy 17 Share Posted January 31, 2018 #1: It still tries to attack seagulls that are already in combat. (I tried checking for the health bar but maybe I did this incorrectly?) #2: Every time it levels up and the seagull moves away, it stops attacking. 1) Try checking for npc.getInteractingCharacter = null instead of checking for health bar, that may possibly fix that issue. I'm unaware of how IsInCombat returns if you check for that. 2) This is something that just happens with level up message. You're referring to the seagull retreating once it gets low hp yes? Unless seagull is attacking you, the level up message will always interrupt combat. Could have it check for if it canContinue, then clickContinue and re-attack the seagull. Unless clicking continue resumes combat, you'd have to check that Link to comment Share on other sites More sharing options...
AsBakedAsCake 202 Author Share Posted January 31, 2018 You may want to add a check on the NPC's combat status in the filter. Or to be even more stringent, you may add something along the lines of the npc not being interacted with by any other players to your filter instead. I believe that the isInCombat method returns true only if both Characters are interacting with eachother. As for the level up issue, why not check for dialogue and either continue it or attack the seagull again if dialogue is present. Mind you, the framework and general structure of your script isn't particularly favored, but those should fix up your issues without you having to change things around too much. I would recommend you look at either implementing states and a switch statement that allows you to easily read what you're doing if you want to keep it in the same AbstractScript framework, or investigate the TaskScript framework, which should make everything much nicer overall. @iamreyne had a great example of a taskscript framework on one of his local scripts if I remember correctly. 1) Try checking for npc.getInteractingCharacter = null instead of checking for health bar, that may possibly fix that issue. I'm unaware of how IsInCombat returns if you check for that. 2) This is something that just happens with level up message. You're referring to the seagull retreating once it gets low hp yes? Unless seagull is attacking you, the level up message will always interrupt combat. Could have it check for if it canContinue, then clickContinue and re-attack the seagull. Unless clicking continue resumes combat, you'd have to check that Thanks for the replies boys, I'll get back on it tomorrow. Clicking to continue does resume combat. (My main problem was that if it this happened it will just afk until that seagull is dead or it logs out.) Yes I was referring to the seagull retreating when its about to die I'll try some of the suggestions above either tn or tomorrow when I feel like frustrating myself a little more I'll be damned if I cant complete a simple script. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.