Script Hook Failed To Detect Game Version

 Posted admin
Script Hook Failed To Detect Game Version Average ratng: 6,3/10 2933 votes

Okay so basically I want to have a bit of javascript on a page that somehow attaches some kind of global event listener that can detect and do something if an ajax request is made (without directly calling it from the call), regardless of how the ajax call is made.

I figured out how to do this with jquery - if the ajax request is being done by jquery. Here is an example code for this:

Nov 17, 2018 - i wanted to get native trainer and play in multiplayer but when i pressed play it displayed my profile as me playing gta 4 when there actually. INFO GTA IV Script Hook 0.5.1 - (C) 2009, Aru - Initialized INFO Process base address: 0x1090000 INFO Auto detecting game version FATAL Failed to detect game version logs from 2009 ARU Script Hook. Don't know if its just a simple change or what.

With this code, regardless of where/how I call $.post(..), the global event listener will trigger. It also works if I use $.get or $.ajax (any jquery ajax methods), regardless of how/when I call it (attached as an onclick, on page load, whatever).

However, I want to be able to extend this listener to trigger regardless of what js framework is used, or even if no framework is used. So for instance if I were to also have on a page the following code (generic ajax code from w3schools):

And then I have on some random link an onclick call to that function, my global ajax event listener should be able to also detect this request. Well I added that code to my page and attached it to a random link's onclick (yes, the code itself works), but the jquery 'global event listener' code above failed to detect that call.

Script Hook Failed To Detect Game Version Free

I did some more digging and I know I can basically save the object to a temp object and overwrite the current object with a 'wrapper' object that will call a specified function and then call the temp function, but this requires me to know ahead of time the original object being created/used. But I won't always know that ahead of time...

So...is this possible? Is there some way to detect an ajax get/post request was made, regardless of whether it was done with a generic object or from xyz framework? Or am I just going to have to make duplicate code to handle each framework and also know ahead of time the ajax object(s) being created/used?

edit:

I forgot to mention that it is not enough to detect that a request occurred. I also need to capture the data being sent in the request. The link provided in the comments below will help figure out if 'a' request was made, but not get the data sent. p.s. - the answer provided in the link below is not very clear, at least to me anyways.

Crayon Violent
Crayon ViolentCrayon Violent
27.9k3 gold badges44 silver badges71 bronze badges

2 Answers

Okay this is what I have come up with so far:

DIRECTIONS:

Scripthook failed to detect game version

Just c/p this onto your page or include it in a .js file or whatever. This will create an object called s_ajaxListener. Whenever an AJAX GET or POST request is made, s_ajaxListener.callback() is called, and the following properties are available:

s_ajaxListener.method : The ajax method used. This should be either GET or POST. NOTE: the value may not always be uppercase, it depends on how the specific request was coded. I'm debating the wisdom of automatically upper-casing it or leaving it to something else to toLowerCase() for a case-insensitive comparison.

s_ajaxListener.url : The url of the requested script (including query string, if any) (urlencoded). I have noticed, depending on how the data is sent and from which browser/framework, for example this value could end up being as ' ' or '+' or '%20'. I am debating the wisdom of decoding it here or leave it to something else.

s_ajaxListener.data : the data sent, if any ex: foo=bar&a=b (same 'issue' as .url with it being url-encoded)

NOTES:

As it stands, this is not IE6 compatible. this solution is not quite good enough for me, as I want it to be IE6 compatible. But since a lot of other people don't care about IE6, I decided to post my solution in its current state, as it should work for you if you don't care about IE6.

I have tested this in (as of this posted date): Current Safari, Current Chrome, Current FireFox, IE8, IE8 (IE7 Compatible). It doesn't currently work with IE6 because IE6 uses an ActiveX object, while virtually everything else uses XMLHttpRequest.

Right now I don't have any clue how to, well basically prototype/extend/overload (?) ActiveXObject('Microsoft.XMLHTTP'). This is what I am currently researching...does anybody know offhand?

Version

Under each of the browsers I tested above, this works with AJAX requests from a generic object, and also from the jquery and prototype frameworks. I know there are other frameworks out there, but IMO these 2 are the major ones. I might possibly QA MooTools, but other than that, I'm fine with only testing those.

If Anybody wants to contribute by testing and posting results about other browsers and/or frameworks, it would be appreciated :)

Crayon ViolentCrayon ViolentScript Hook Failed To Detect Game Version
27.9k3 gold badges44 silver badges71 bronze badges
Sébastien BrodeurSébastien Brodeur

Not the answer you're looking for? Browse other questions tagged javascriptajax or ask your own question.