Coding AJAX-compatible GM scripts

Archival storage to keep things organized and uncluttered. Can't find what you need? Search for old topics here.

Moderators: Tech Team, Global Moderators

Forum rules
Please read the Community Guidelines before posting.

Postby yeti_c on Fri Oct 12, 2007 7:45 am

Ishiro wrote:Yep, it stops the map, and I have no idea why.

It does work if I strip the colors out of the map inspect and just have it load once to show attack paths but don't update it for changes. I think the browser may just not like the slew of updates and either kills it or is just really slow... I've never tried waiting to see if it catches up.


Bugger!!

The colours eh?! which bit?

The initialisation bit?

Or all the magicmap stuff?

At the mo my "magicmap" div can't be found - so I've commented it all out...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby Ishiro on Fri Oct 12, 2007 8:08 am

The main thing you have to change in the script is that "inner-map" used to be a DIV, its not anymore, so most of the code that uses "inner-map" is broken.
Image
User avatar
Corporal 1st Class Ishiro
 
Posts: 324
Joined: Mon Jul 17, 2006 5:53 pm
Location: Under the Rainbow
Medals: 10
Standard Achievement (2) Doubles Achievement (1) Triples Achievement (1) Terminator Achievement (1) Assassin Achievement (1)
Cross-Map Achievement (1) Ratings Achievement (1) General Contribution (2)

Postby yeti_c on Fri Oct 12, 2007 8:19 am

Ishiro wrote:The main thing you have to change in the script is that "inner-map" used to be a DIV, its not anymore, so most of the code that uses "inner-map" is broken.


Yeah - at the mo I've dropped any innermap stuff... but I'll have a check!!

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Fri Oct 12, 2007 8:38 am

Right - I've disabled anything running on the refresh and it still doesn't work...

I reckon it must be the inital script that kills the map then...

Like you say - no div stuff now... I wonder if the div's added for the stats and map inspect etc stop the AJAX from working!?

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby Ishiro on Fri Oct 12, 2007 12:01 pm

It shouldn't... lack is referring to everything by name. But I know some of the stuff in BOB was doing things by type and counting them, I had to redo a bunch of that. I'd give you a copy but that PC is currently dead and I haven't had time to work on it.
Image
User avatar
Corporal 1st Class Ishiro
 
Posts: 324
Joined: Mon Jul 17, 2006 5:53 pm
Location: Under the Rainbow
Medals: 10
Standard Achievement (2) Doubles Achievement (1) Triples Achievement (1) Terminator Achievement (1) Assassin Achievement (1)
Cross-Map Achievement (1) Ratings Achievement (1) General Contribution (2)

Postby yeti_c on Mon Oct 15, 2007 3:01 am

I've had a thought - I suspect that this problem is security based...

The browser might be stopping the script from reaccessing the objects that are in the main page correctly...

I will run a couple of tests to see if this is truly the case...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Mon Oct 15, 2007 3:06 am

I was wrong...

It's definitely something in the initialisation of the script that breaks the map...

To test this
I first stopped my refreshGMScript() doing anything... map still broken...
Then I stopped my refreshGMScript() function redefining itself - and the map is still broken...

So this can't be any security issue... their must be something that stops the map from refreshing in the init... I'll continue to work on this...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Mon Oct 15, 2007 9:55 am

Righto - I've narrowed it down to the Card Redemption DIV...

I will attempt to recode this bit into something that doesn't break the map!!

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Mon Oct 15, 2007 10:15 am

Righto...

I think I have an AJAX compatible BOB...

Not all of the features are in yet...

and things like <required> for continents aren't finished yet...

BUT it's a start...

I will send latest to LACK and get him to host for now... expect updates throughout this week to get it working...

Also feel free to post any errors/bugs in it into this thread...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby Rocketry on Mon Oct 15, 2007 10:18 am

good work so far lol. If i had a clue how to help, i would....

Rocketry
User avatar
Lieutenant Rocketry
 
Posts: 1467
Joined: Wed May 16, 2007 5:33 pm
Location: Westminster
Medals: 23
Standard Achievement (3) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Freestyle Achievement (1)
Fog of War Achievement (2) Speed Achievement (2) Cross-Map Achievement (1) Ratings Achievement (3) Tournament Achievement (1)
General Achievement (1) Clan Achievement (3)

Postby yeti_c on Mon Oct 15, 2007 10:24 am

Known bugs in current version...

Next card Redemption value no longer shown. (Escalating only)
Map Inspect/Hover type stuff no longer shown.
Strength calculation = NaN.
Terminator Summary keeps getting added to the log.
New XML features aren't calculated yet.
Confirm Buttons are a bit screwy!!

Please reply here once you have the new script in and if you find anything else...

C.

PS Also the new script DOESN'T work with AJAX off... because I couldn't be bothered to make it backwards compatible (as Lack will be disabling the nonajax feature anyway - I decided that was the way to go)!!
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby RobinJ on Mon Oct 15, 2007 5:02 pm

Bravo guys. I haven't got much of a clue what you're talking about but I've gathered that you've found something that works.

How much free premium did lack offer you? ... it should be more!

=D>
nmhunate wrote:Speak English... It is the language that God wrote the bible in.


Highest Score: 2437
Highest Place: 84
User avatar
Sergeant 1st Class RobinJ
 
Posts: 1901
Joined: Mon Aug 21, 2006 1:56 pm
Location: Northern Ireland
Medals: 13
Standard Achievement (3) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (1) Terminator Achievement (2)
Cross-Map Achievement (2) Ratings Achievement (1)

Postby yeti_c on Tue Oct 16, 2007 2:28 am

Hi Robin,

He doesn't offer anything and I don't expect anything... I did it for the challenge!!

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Tue Oct 16, 2007 3:18 am

OK - early work this morning has gleaned the following...

Map Fade now works (renamed to Map Opacity as it works the opposite way to before!)

Strength Calculation now works.

Redemption Div now appears and works.

TODO:

(Actually host the file somewhere - expect that later this arvo)
Map Inspect. <- thinking about how to do this easily!!
Log tweaking. <- thinking about how to do this easily.
New XML features aren't calculated yet. <- I've worked out my logic for this - just need to code.
Confirm Buttons are a bit screwy!! <- I know why now too!!

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby Aerial Attack on Tue Oct 16, 2007 4:00 am

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 :mrgreen:


* Main contributor(s) will get 12 months, secondary contributors according to their contribution :)

** Colourblind feature is now core, no need to replace that


Actually, yeti_c - lack did offer.
User avatar
Sergeant Aerial Attack
 
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan
Medals: 4
Tournament Achievement (2) Tournament Contribution (1) General Contribution (1)

Postby yeti_c on Tue Oct 16, 2007 4:02 am

Oh yeah - I forgot about that!!!

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Tue Oct 16, 2007 8:48 am

OK new bit of work...

Textmap now works...

TODO:

(Actually host the file somewhere - expect that later this arvo)
Map Inspect. <- thinking about how to do this easily!!
Log tweaking. <- thinking about how to do this easily.
New XML features aren't calculated yet. <- I've worked out my logic for this - just need to code.
Confirm Buttons are a bit screwy!! <- I know why now too!!
Right hand side doesn't update properly...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby Aerial Attack on Tue Oct 16, 2007 11:13 am

yeti_c wrote:OK new bit of work...

Textmap now works...

TODO:

(Actually host the file somewhere - expect that later this arvo)
Map Inspect. <- thinking about how to do this easily!!
Log tweaking. <- thinking about how to do this easily.
New XML features aren't calculated yet. <- I've worked out my logic for this - just need to code.
Confirm Buttons are a bit screwy!! <- I know why now too!!
Right hand side doesn't update properly...

C.

What does arvo stand for?

Log tweaking? What does BOB currently do the Log? Or are you going to add in features for us?

Right hand side doesn't update properly? I assume you mean the turn count-down timer (clock)?

As for places to host the code - you could try File Den or Send Space
User avatar
Sergeant Aerial Attack
 
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan
Medals: 4
Tournament Achievement (2) Tournament Contribution (1) General Contribution (1)

Postby Tyrion81 on Tue Oct 16, 2007 5:17 pm

Aerial Attack wrote:What does arvo stand for?


Afternoon :D

UK/Aussie lingo.
Corporal 1st Class Tyrion81
 
Posts: 14
Joined: Thu Mar 22, 2007 8:29 pm
Location: Sydney, Australia
Medals: 1
Standard Achievement (1)

Postby Tyrion81 on Tue Oct 16, 2007 5:19 pm

yeti_c wrote:TODO:

(Actually host the file somewhere - expect that later this arvo)


How about http://userscripts.org/ seeing as its a GreaseMonkey script?
Corporal 1st Class Tyrion81
 
Posts: 14
Joined: Thu Mar 22, 2007 8:29 pm
Location: Sydney, Australia
Medals: 1
Standard Achievement (1)

Postby yeti_c on Wed Oct 17, 2007 2:46 am

Aerial Attack wrote:
yeti_c wrote:OK new bit of work...

Textmap now works...

TODO:

(Actually host the file somewhere - expect that later this arvo)
Map Inspect. <- thinking about how to do this easily!!
Log tweaking. <- thinking about how to do this easily.
New XML features aren't calculated yet. <- I've worked out my logic for this - just need to code.
Confirm Buttons are a bit screwy!! <- I know why now too!!
Right hand side doesn't update properly...

C.

What does arvo stand for?

Log tweaking? What does BOB currently do the Log? Or are you going to add in features for us?

Right hand side doesn't update properly? I assume you mean the turn count-down timer (clock)?

As for places to host the code - you could try File Den or Send Space


Log Tweaking -> At the moment the Terminator Summary gets printed out each time the log is refreshed...

Right hand side -> Actually the Clock works fine but the traffic lights don't update correctly -> Probably something similar to why the Map 'was' failing to update.

C.

PS Arvo = Afternoon.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby yeti_c on Wed Oct 17, 2007 2:55 am

Tyrion81 wrote:
yeti_c wrote:TODO:

(Actually host the file somewhere - expect that later this arvo)


How about http://userscripts.org/ seeing as its a GreaseMonkey script?


Good plan...

GET AJAX BOB

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

Postby Elwar on Wed Oct 17, 2007 3:09 am

Neither the graphic map nor the army map (?) will appear when this is installed. Well, they appear for half a second (upon refresh), along with the BOB army count info, then it disappears.
Lieutenant Elwar
 
Posts: 135
Joined: Tue Jun 12, 2007 1:22 am
Medals: 9
Standard Achievement (2) Terminator Achievement (1) Assassin Achievement (1) Freestyle Achievement (2) Fog of War Achievement (1)
Speed Achievement (1) Cross-Map Achievement (1)

Postby Iliad on Wed Oct 17, 2007 3:11 am

Elwar wrote:Neither the graphic map nor the army map (?) will appear when this is installed. Well, they appear for half a second (upon refresh), along with the BOB army count info, then it disappears.

Yeah. It appears around halfway during refreshment then the map turns blank
User avatar
Private 1st Class Iliad
 
Posts: 10439
Joined: Mon Mar 05, 2007 12:48 am
Medals: 1
Standard Achievement (1)

Postby yeti_c on Wed Oct 17, 2007 3:18 am

You may need to turn your "Map Opacity" up...

I believe the default is 30% (inherited from previous script)

Now it works the opposite way round to Map Fade... so the bigger the number the easeir the map will be to see...

When the Map Inspect code is back -> the numbers should not be faded.

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9670
Joined: Thu Jan 04, 2007 9:02 am
Medals: 46
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (1) Fog of War Achievement (3) Cross-Map Achievement (3) Ratings Achievement (3)
General Achievement (1) Map Contribution (13) Tournament Contribution (1) General Contribution (10)

PreviousNext

Return to Tool Archives

Who is online

Users browsing this forum: No registered users

Login