* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that
Moderator: Tech Team
Interesting...lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX
* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that

I think it's because he doesn't want to do it all and make it part of the actual site. But hey, whatever works.lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX
* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that
Actually - I'll make a deal with you...lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX
* Main contributor(s) will get 12 months, secondary contributors according to their contribution
** Colourblind feature is now core, no need to replace that

Nice work buddy - I'll leave it to you then...Ishiro wrote:While some things need to wait for turns to test... here is a hint, posting a chat message to yourself in a non-team game goes through the ajax routines to update the chat log.
Starting over reworking the script from the ground up, I've got the clock and player stats working. Text map and map inspect are halfway there.

Well, I think you understand what I say before.Ishiro wrote:While some things need to wait for turns to test... here is a hint, posting a chat message to yourself in a non-team game goes through the ajax routines to update the chat log.
Starting over reworking the script from the ground up, I've got the clock and player stats working. Text map and map inspect are halfway there.
Code: Select all
(you need to talk to whoever wrote the XML for the Italy Map OR Pearl Harbor Map for the new XML)Code: Select all
(this is only an approximation - not the exact code)
<bonuses>
<bonus:+1>
<territory:Napoli>
<territory:Palermo>
</bonus>
<bonus:+1>
<territory:Napoli>
<territory:Roma>
</bonus>
<bonus:+1>
<territory:Napoli>
<territory:Torino>
</bonus>
<bonus:+1>
<territory:Napoli>
<territory:Venezia>
</bonus>
<bonus:+1>
<territory:Palermo>
<territory:Roma>
</bonus>
<bonus:+1>
<territory:Palermo>
<territory:Torino>
</bonus>
<bonus:+1>
<territory:Palermo>
<territory:Venezia>
</bonus>
<bonus:+1>
<territory:Roma>
<territory:Torino>
</bonus>
<bonus:+1>
<territory:Roma>
<territory:Venezia>
</bonus>
<bonus:+1>
<territory:Torino>
<territory:Venezia>
</bonus>
// negative because of overlap with 3 terrs
<bonus:-1>
<territory:Napoli>
<territory:Palermo>
<territory:Roma>
</bonus>
<bonus:-1>
<territory:Napoli>
<territory:Palermo>
<territory:Torino>
</bonus>
<bonus:-1>
<territory:Napoli>
<territory:Palermo>
<territory:Venezia>
</bonus>
<bonus:-1>
<territory:Napoli>
<territory:Roma>
<territory:Torino>
</bonus>
<bonus:-1>
<territory:Napoli>
<territory:Roma>
<territory:Venezia>
</bonus>
<bonus:-1>
<territory:Napoli>
<territory:Torino>
<territory:Venezia>
</bonus>
<bonus:-1>
<territory:Palermo>
<territory:Roma>
<territory:Torino>
</bonus>
<bonus:-1>
<territory:Palermo>
<territory:Roma>
<territory:Venezia>
</bonus>
<bonus:-1>
<territory:Palermo>
<territory:Torino>
<territory:Venezia>
</bonus>
<bonus:-1>
<territory:Roma>
<territory:Torino>
<territory:Venezia>
</bonus>
// back to positive because of dual overlap with 4 or 5 terrs
<bonus:+1>
<territory:Napoli>
<territory:Palermo>
<territory:Roma>
<territory:Torino>
</bonus>
<bonus:+1>
<territory:Napoli>
<territory:Palermo>
<territory:Roma>
<territory:Venezia>
</bonus>
<bonus:+1>
<territory:Napoli>
<territory:Palermo>
<territory:Torino>
<territory:Venezia>
</bonus>
<bonus:+1>
<territory:Palermo>
<territory:Roma>
<territory:Torino>
<territory:Venezia>
</bonus>
Code: Select all
//function dave()
//{
// alert("dave");
//}
//
//var newHandleResponse = unsafeWindow.handleResponse;
//var contents = ""+newHandleResponse;
//alert(newHandleResponse);
//start = contents.substring(0,28);
//middle = "dave();";
//end = contents.substring(28, contents.length);
//alert(start);
//alert(middle);
//alert(end);


Code: Select all
var newhandleResponse = unsafeWindow.handleResponse;
unsafeWindow.handleResponse = function() {
//put all your new code here
return newhandleResponse();
}Ah yes - that's a nice way of doing it - nice work Ishiro...Ishiro wrote:A dummy function would be great, especially if lack coded it to always be called last as a clean up once he's done all his stuff.
If you want to override lack's handleResponse, you can either:
a) copy his entire function and make the changes you need to it (this is what I'm currently working on).
pros: lets you place new code exactly where it is needed.
cons: it replaces lack's function and so if he makes changes to that function you will be ignoring it until you update your script.
b) make a copy of his function and throw in your own code like this:pros: doesn't replace lack's code, so when he makes changes you won't be ignoring his new code.Code: Select all
var newhandleResponse = unsafeWindow.handleResponse; unsafeWindow.handleResponse = function() { //put all your new code here return newhandleResponse(); }
cons: as I've mentioned before, the handleResponse function is called 4 or 5 times per action, so BOB executes 4 or 5 times making it slow and actually breaking the map (it "freezes", stops updating with the AJAX).
