• Visit Rebornbuddy
  • [Enemy Spell Logger] Help us log telegraphed attacks!

    Discussion in 'Plugins' started by Neverdyne, Dec 3, 2014.

    1. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Simple plugin that:


      1. Momentarily hides your UI (be sure to have that set up as ScrollLock on your game keybinds) and takes a screenshot of the game whenever an enemy casts a spell.
      2. Saves the screenshot on the /Rebornbuddy/Enemy Spell Loger/ directory.
      3. The screenshot's name is the spell's name and ID number.

      If you use this on your farming and post your pictures it'll help us script the bot to move out of telegraphed attacks.

      Side Notes: It should be robust and efficient, the screen capturing and file saving is done on a separate thread, you shouldn't notice any performance issues. The UI is hidden for around 300ms. It won't take pictures of spells that it already logged during the current session.
       

      Attached Files:

      Last edited: Dec 3, 2014
    2. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Anyway you can make it save .jpgs? .bmps are going to take up a lot of space and would be hard to transmit
       
    3. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Yup, just give me a few minutes.
       
    4. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      There we go, changed it to PNG and lowered the quality, cut the size by about 1/4.
       
    5. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Brilliant. Using it now
       
    6. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      I noticed it's not taking pictures if the same mob casts the same spell? Is that by design or is it just 1 skill per mob?
       
    7. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Yup by design it only takes a picture if it's a spell that hasn't been seen before. It keeps a list of the spells it has logged and checks to see it's not repeated. However, this list is not persistent so if you restart Rebornbuddy the list is reset. In case a screenshot already exists with a given name, it overwrites it.
       
    8. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      You sir, are brilliant. I've leveled every class except bard using this bot. I'd have been running this plugin months ago if we had it.
       
    9. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      I've created a Google Drive account where we can upload the pictures to. I'm sending you a like to the account, Neverdyne, and I'll send a link to anyone else who needs it
       
    10. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Alright, sounds good. It wasn't that much work to be honest, the hard part will be to actually make the bot know how to move depending on the shape and actually move him. I suspect combat routines might get messy when moving like that. The database should be easy to make with this though.
       
    11. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Well, I'm thinking a plugin would probably work best here, that way every CR doesn't have to implement it all, but then again, I'm not much of a programmer myself, so I don't know how easy that would be to do.
       
    12. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Using the google drive like this should help us keep it to one file per spell. It shouldn't let you upload anything that's already in there.
       
    13. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      I'm not sure if a plugin can "take control" from a combat routine. If there's an easy way for the plugin to take control, do something, then return it to the CR then the rest should be fairly easy. As Kaihairder said, you'd only need to classify each spell by its shape which is easy with the pictures, you can do it in one sitting I bet. Then the plugin could implement movement functions for each shape. A shape switch could call the correct move function, and that's that.

      Right now I'm a little busy with another plugin though, so I'll leave that to someone else or once I finish on the other thing.
       
    14. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      Only using a plugin instead of incorporating into crs isn't the best approach for dodging because you would have to halt cr logic/attacks to move by plugin. Unless the cr was designed for compatibility with the plugin.

      Later tonight I can send you hard coded lists for the databases, so you can filter out spells which have been reported.
       
      Last edited: Dec 3, 2014
    15. Zamphire

      Zamphire Member

      Joined:
      May 16, 2013
      Messages:
      349
      Likes Received:
      11
      Trophy Points:
      18
      Well, whatever works! I just want to stop standing in the bad! lol
       
    16. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      also if it was purely plugin then the cr would often run straight back into the aoe area :p
       
    17. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      Yup, didn't think of that. So it probably needs to be in the CR. Though to make it easier for CRs it could be a plugin that offers a simple check. Something like:

      AvoidanceService.IsNeeded

      So that they can simply put it on top of their priority selectors, and whenever IsNeeded returns true, do nothing. The plugin can then independently try to avoid the attack on Pulse(). It would act like a pause for the CR until the plugin finishes moving and sets the IsNeeded flag to false. Of course, if the CR doesn't implement the check there's nothing you could really do.
       
    18. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      You don't need to stop anything in the cr besides movement. It could have a bool for .IsDodging which the cr checks before any of it's movement code. Then the plugin could keep IsDodging true until after the aoe dissipates. In the mean time, the plugin could move to a safe location that's within combat range of another mob and the targeting provider will change your target.

      The plugin would maintain movement control while any aoes are active (or at least supposed to be active based on a timespan created from cast detection.) It would move to combat range of current target if the generated point is safe or move closer to another mob to force targeting provide to target a safe target or just set kill poi to force attack on safe target.

      I have an amateur hour question btw, what's the fastest way to check .contains on sorted ints? Since the data is set at construction and there's no re-sizing, I'm sure arrays would be faster than lists. But doesn't the .contains just iterate over the entire array? I guess with arrays of this size it wouldn't matter. Does anyone have any input on whether System.Array.BinarySearch(System.Array, object) or any alternative should be used over linq contains?
       
      Last edited: Dec 4, 2014
    19. Neverdyne

      Neverdyne Community Developer

      Joined:
      Sep 12, 2014
      Messages:
      644
      Likes Received:
      18
      Trophy Points:
      18
      You're correct about lists and arrays, both of them iterate over the entire list when you call a Contains on them so the operation is O(n) meaning the larger the list the slower. What you want is a HashSet, the Contains operation there is O(1) so it's always constant speed no matter the size, the only thing is that HashSets cannot have repeated items since it hashes them. If you add a new item with the same hash as a previous one the latter will get replaced.

      A Dictionary also hashes the keys you give it, so doing Dictionary.ContainsKey() also is O(1). The fastest way to get the shape of a spell based on its ID would be to use a dictionary with the ID as keys and the shape as values.
       
      Last edited: Dec 4, 2014
    20. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      thanks, I should just do a dictionary since I have so many categories now it would be worth making the enums

      here's v0.3 with the dictionary added

      wish someone had mentioned it didn't compile >_>
       

      Attached Files:

      Last edited: Dec 5, 2014

    Share This Page