Pinned OGame version check for tools & scripts

  • OGame version check for tools & scripts

    Dear tool developer,

    Each userscript and addon/extension have to include the oGameVersionCheck to show users all installed OGame scripts and if they are tested with the current Ogame version or not.

    See news ... for more details


    Include:

    - Add to your metadata block: (for Firefox with GM/Scriptish and Chrome with TM)

    Source Code

    1. // @require http://userscripts.org/scripts/source/118453.user.js


    - Or include the minified code (see appended ZIP file) to your script when you want to support Chrome without TM or Opera.

    - Or use jQuery getScript to load and run the version check from Ogame server

    Source Code

    1. $.getScript( '/cdn/js/greasemonkey/version-check.js', function() {
    2. (unsafeWindow || window).oGameVersionCheck('AntiGame Origin', scriptOgame, 'http://antigame.de/home.php?page=home');
    3. } );


    - Or create your own function with same behavoir.


    Usage:

    - Call oGameVersionCheck(scriptName, testedOgameVersion, scriptUrl) at the beginning of your script
    - document.readyState must be 'interactive' or 'complete' - you have to care about it in extensions or when you use @run-at document-start in userscripts
    - scriptName: name of your script / addon
    - testedOgameVersion: current Ogame version , e.g 5.1.0
    - scriptUrl: URL to your script page, e.g on userscripts.org


    Regards, Francolino
    Files
  • <Asiman>hi
    <Francolino>ah, qry )
    <Francolino>hello :)
    <Asiman>I have problems with oGameVersionCheck
    <Francolino>explain
    <Francolino>but ... check out other tools who are using it
    <Asiman>it does not work :)
    <Asiman>other tools too
    <Francolino>userscripts.org/scripts/review/136116
    <Francolino>hmm
    <Asiman>only antigame
    <Francolino>it's included in AGO and galaxytool
    <Asiman>not work in Find Player Details (by Eleria)
    <Asiman>oGameVersionCheck('Find Player Details (by Eleria)','5.6.3.99','http://userscripts.org/scripts/show/136116');
    <Asiman>version ogame 5.7.0
    <Francolino>yes, i see
    <Francolino>i'll fix it next week
    <Asiman>ty
    <Francolino>thanks for info :)
    <Asiman>np :)
  • Source Code

    1. var coms = {
    2. ae: {domain: 'AE.OGAME', text: 'Scripts'},
    3. ar: {domain: 'AR.OGAME', text: 'Scripts'},
    4. ba: {domain: 'BA.OGAME', text: 'Skripte'},
    5. br: {domain: 'BR.OGAME', text: 'Scripts'},
    6. cz: {domain: 'CZ.OGAME', text: 'Skripty'},
    7. de: {domain: 'DE.OGAME', text: 'Scripts'},
    8. dk: {domain: 'DK.OGAME', text: 'Scripts'},
    9. es: {domain: 'ES.OGAME', text: 'Scripts'},
    10. fi: {domain: 'FI.OGAME', text: 'Scripts'},
    11. fr: {domain: 'FR.OGAME', text: 'Scripts'},
    12. gr: {domain: 'GR.OGAME', text: 'Σενάρια'},
    13. hr: {domain: 'HR.OGAME', text: 'Skripte'},
    14. hu: {domain: 'HU.OGAME', text: 'Szkriptek'},
    15. it: {domain: 'IT.OGAME', text: 'Script'},
    16. jp: {domain: 'JP.OGAME', text: 'スクリプト'},
    17. mx: {domain: 'MX.OGAME', text: 'Scripts'},
    18. nl: {domain: 'NL.OGAME', text: 'Scripts'},
    19. no: {domain: 'NO.OGAME', text: 'Skript'},
    20. pl: {domain: 'PL.OGAME', text: 'Skrypty'},
    21. pt: {domain: 'PT.OGAME', text: 'Scripts'},
    22. ro: {domain: 'RO.OGAME', text: 'Scripturi'},
    23. ru: {domain: 'RU.OGAME', text: 'Скрипты'},
    24. se: {domain: 'SE.OGAME', text: 'Skript'},
    25. si: {domain: 'SI.OGAME', text: 'Skripti'},
    26. sk: {domain: 'SK.OGAME', text: 'Skripty'},
    27. tr: {domain: 'TR.OGAME', text: 'Scriptler'},
    28. tw: {domain: 'TW.OGAME', text: '脚本'},
    29. us: {domain: 'US.OGAME', text: 'Scripts'},
    30. // MUST stay at the end to avoid matching on AR FI .....
    31. org:{domain: 'EN.OGAME', text: 'Scripts'}
    32. };
    33. var domain = document.location.hostname.toUpperCase(),
    34. server = '',
    35. titleText= '';
    36. for (var c in coms) {
    37. if ((coms[code=c].domain !== '') && (domain.search(new RegExp(coms[code=c].domain)) > -1)) {
    38. server= c;
    39. titleText = coms[code=c].text;
    40. break;
    41. }
    42. }
    Display All

    ;)
  • Hi,

    The current versionCheck script is hosted on the gameforge server.
    <meta name="ogame-version-check-url" content="http://gf2.geo.gfsrv.net/cdna5/4388e60776bc4dd590d41be942c195.js">

    Wouldn't it be easier if ogame just included the script directly. For example in the HTML head.
    I know they'll probably answer that they won't do it as not all users use an extension.
    No offence to gameforge but it'd be even less work for the browser than including the MMO bar.

    Script developers wouldn't have to fetch the script themselves anymore.
    Which reduces the amount of calls to the script within 1 page load.
    Much more script developers would use it, as it would be much simpler to use.
    It would also reduce the changes of misuse.

    Grtz,
    Warsaalk