Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Spell/Attack triggered callback?


Best Answer sikaka , 13 September 2018 - 10:18

Nope - you have to query stuff because gos passively scans memory instead of hooking game functions.  

 

Any callbacks that you see listed in APIs (official and unofficial) are done through polling the memory state and trying to re-create the data you might expect from such events (buy/sell, buff add/remove, spell cast, etc).  

 

Lots of spells cannot be handled properly by GOS but any that has a channel time associated can be pulled from active spell and checking current activespell vs previous one will give an onCast event. This will miss probably 30% of skills in the game that are just.... different. Some spells can be tracked by seeing a buff be added to a character, some can be seen by a dash happening... some are nearly impossible to touch.  

 

Alpha is a mess but it will give you an idea some of the ways you could be notified of spells happening. The core querying system is actually not that bad in terms of performance impact so might be worth giving a try. Subscribing to events like onIncomingCC are much more difficult because they need to track spells after they've been fired (mostly through missile collision checks)  

 

Again please excuse the mess of code - it works though every time the GOS Api is :D

http://gamingonstero...ction-and-more/

Go to the full post »


  • Please log in to reply
6 replies to this topic

#1
LastLuaBender

LastLuaBender

    Newbie

  • Members
  • 7 posts

I've been wondering if there is some kind of event or callback that triggers when a game object casts a spell or attacks etc. Or would I have to watch the game objects for updates on each tick?

I couldn't find anything of that sort in the api here.

 

EDIT: I'm guessing this means no?


  • 0

#2
sikaka

sikaka

    Advanced Member

  • Trial Developer
  • 594 posts
✓  Best Answer

Nope - you have to query stuff because gos passively scans memory instead of hooking game functions.  

 

Any callbacks that you see listed in APIs (official and unofficial) are done through polling the memory state and trying to re-create the data you might expect from such events (buy/sell, buff add/remove, spell cast, etc).  

 

Lots of spells cannot be handled properly by GOS but any that has a channel time associated can be pulled from active spell and checking current activespell vs previous one will give an onCast event. This will miss probably 30% of skills in the game that are just.... different. Some spells can be tracked by seeing a buff be added to a character, some can be seen by a dash happening... some are nearly impossible to touch.  

 

Alpha is a mess but it will give you an idea some of the ways you could be notified of spells happening. The core querying system is actually not that bad in terms of performance impact so might be worth giving a try. Subscribing to events like onIncomingCC are much more difficult because they need to track spells after they've been fired (mostly through missile collision checks)  

 

Again please excuse the mess of code - it works though every time the GOS Api is :D

http://gamingonstero...ction-and-more/


  • 2

#3
RMAN

RMAN

    Advanced Member

  • Contributor
  • 523 posts

sikaka, on 13 Sept 2018 - 10:18 PM, said:

 

Just wow. That's a pretty good explanation!
+1


  • 0

#4
LastLuaBender

LastLuaBender

    Newbie

  • Members
  • 7 posts

I see, thanks. But wouldn't a native solution still be of value? Not only should it be a performance improvement, since we would only poll the data once and inform the scripts via callbacks, instead of having every script polling the data seperatly. But would also result in clearer, more intuitive code IMO.

 

EDIT: I took a look at your lib and noticed you already tackled the performance issue by mutating the global namespace, which is definitely a good start, but is there no way to contribute to the lua api itself?


  • 0

#5
sikaka

sikaka

    Advanced Member

  • Trial Developer
  • 594 posts

LastLuaBender, on 14 Sept 2018 - 10:23 AM, said:

I see, thanks. But wouldn't a native solution still be of value? Not only should it be a performance improvement, since we would only poll the data once and inform the scripts via callbacks, instead of having every script polling the data seperatly. But would also result in clearer, more intuitive code IMO.

 

EDIT: I took a look at your lib and noticed you already tackled the performance issue by mutating the global namespace, which is definitely a good start, but is there no way to contribute to the lua api itself?

 

 

The only way to do it 'properly' is to hook those client side functions responsible for the actions you want to be informed of... Hooking into the client is the exact opposite of how external works so will not be happening.  

 

As you said Alpha is intended to be that API extension for scripts that care about certain difficult to track events. It's not complete but it does a pretty good job and is open to contributions from users. As for submitting to the core GOS api, no that's not done but if Alpha were cleaned up and considered 'complete' it's possible it could be added to the default/official scripts included in the bot which would be pretty much the same thing in terms of script development.  


  • 0

#6
DamnedNooB

DamnedNooB

    Advanced Member

  • Scripts Developer
  • 929 posts

sikaka, on 14 Sept 2018 - 3:11 PM, said:

The only way to do it 'properly' is to hook those client side functions responsible for the actions you want to be informed of... Hooking into the client is the exact opposite of how external works so will not be happening.  

 

As you said Alpha is intended to be that API extension for scripts that care about certain difficult to track events. It's not complete but it does a pretty good job and is open to contributions from users. As for submitting to the core GOS api, no that's not done but if Alpha were cleaned up and considered 'complete' it's possible it could be added to the default/official scripts included in the bot which would be pretty much the same thing in terms of script development.  

When trial dev?  :grumpycat:


  • 0

#7
sikaka

sikaka

    Advanced Member

  • Trial Developer
  • 594 posts

DamnedNooB, on 14 Sept 2018 - 3:52 PM, said:

When trial dev?  :grumpycat:

 

BabyRage


  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users