Q&D: ScriptAPI

DeletedUser

Guest
Good documentation about ScriptAPI? As I can't find nearly anything about it, just few lines...
Currently most descriptive seems to be DevBlog Script API, which is outdated now...

  • Why I should use it?
  • How it's meant to be used?
  • What it can offer to script makers and users?
  • All API functions explained with every parameter
  • Other things...

Also seems it doesn't work in .net worlds with version 8.3, but it does work here on beta :)
 

fp0815

Staemme in my heart <3
Reaction score
19
Why I should use it?
It helps to reduce the work in the ticket system because bugs related to scripts are not reported further on.

How it's meant to be used?
var api = typeof unsafeWindow != 'undefined' ? unsafeWindow.ScriptAPI : window.ScriptAPI;
api.register( 'Beispielscript', [8.3], 'Max Mustermann', 'max.mustermann@innogames.de' );

Should be self-explaining.

What it can offer to script makers and users?
Scripts are deactivated automatically if they are not compatible.

All API functions explained with every parameter
String: Script Name (descriptive name, please)
Float: Compatible Version
String: Author Name
String: Author’s Email

Should be self explaining as well in combination with the explanations in the dev blog.
 

DeletedUser

Guest
well, I was looking for more info, as this isn't anything new for me... I hoped there are more things, not just this, because script can do his own error checking to see if TW haven't changed and there still are same fields, elements...
for example script that just fills rally point troops/coords using register will need to be changed for every version to add 1 more number and I really doubt if something will change there in near future
and every script maker could just use
Code:
if ($("#inputx").length && $("#inputy").length)
{
$("#inputx")[0].value='123';
$("#inputy")[0].value='321';
} else {
UI.InfoMessage("ERROR! TW have changed, script not working...",3000,true);
}
I mean own error checking, like I've always been doing so and like I said currently api.register doesn't work on any tribalwars.net world...
 
Top