Recent topics Log in
Search Profile
Memberlist Usergroups
Log in to check your private messages
Register
Customizing the "fleets_top.js" javascript
Post new topic   Reply to topic
SpaceTrace Forum Forum Index » General Discussion » Customizing the "fleets_top.js" javascript
View previous topic :: View next topic  
Author Message
DavAlan
Admiral
Admiral


Joined: 24 Aug 2004
Posts: 778
Location: Palo Alto, California

 Post Posted: Tue Mar 28, 2006 4:10 pm    Post subject: Customizing the "fleets_top.js" javascript
Reply with quote

Load it up with a text editor to get....

var coordslayer;
var selgo=0;

function setcoords(e){
o=e.options[e.selectedIndex];
if (fc>0 && document.all) {
getfieldnames();
ez.value=Math.round(o.value.substring();
ey.value=Math.round(o.value.substring(4,7));
ex.value=Math.round(o.value.substring(0,3));
}
return false;
}
for (nr=1; nr<=5; nr++) {
eval('if (window.tlayer_'+nr+') coordslayer=window.tlayer_'+nr+';');
if (coordslayer) {
coordslayer.style.height="30px";
selgo=1;
}
coordslayer=false;
}
if (selgo==1){
document.write('<form name="selform"><div style="position:absolute; top:73px;left:'+(document.body.offsetWidth-280)+'px">');
document.write('<select name="playersel" onblur="setcoords(this)" onchange="this.blur()" style="width:250px;background-color:#31475b">');
// change these lines -------
document.write('<option value="500/500/50">500/500/50 - black hole</option>');
document.write('<option value="400/400/40">400/400/40 -
nobody</option>');
// ----- end of coords -------
document.write('</select></div></form>');
}
var scriptloaded=1;

Change the code in the line "document.write('<option value="400/400/40">400/400/40 -
nobody</option>');" to show your name and coords for a start.

Then reload the nav panel by loading another panel there the switching back to the navigation panel.
You should now be able to select your coords from the drop down list box.
So put the cursor into a fleet coordianate x box then select from the list box and the coord will go directly into the input boxes for that fleet.
You can now, after testing for errors, proceed to enter all your common coodinates into the code using the above syntax.

This makes setting desinations alot faster and reduces typing on the keyboard as well as any typo error one may often make.
_________________
"Destruction leads to a very rough road
But it also breeds creation
And earthquakes are to a girl's guitar
They are just another good vibration
And tidal waves couldn't save the world
From Californication"
Red Hot Chili Peppers - Californication
https://www.youtube.com/watch?v=YlUKcNNmywk
___________________________________
https://www.facebook.com/david.brass.524
 Back to top »
View user's profile Send private message Send e-mail
Osiris
Captain
Captain


Joined: 07 Mar 2006
Posts: 135

 Post Posted: Tue Mar 28, 2006 4:27 pm    Post subject:
Reply with quote

David, so much work for such a small thing :p

i just do copy- paste on the first coord box and than i click on the last box

the coords should stand correctly now

try it out
_________________
By suffering comes wisdom
 Back to top »
View user's profile Send private message Send e-mail
DavAlan
Admiral
Admiral


Joined: 24 Aug 2004
Posts: 778
Location: Palo Alto, California

 Post Posted: Tue Mar 28, 2006 4:41 pm    Post subject: Just getting ready for....
Reply with quote

probes.js java script

// this script reads the dsp-data from the probes.php page and calculates possible target coords from them
// its not ready yet

...there is where I put the commands to load my dsp vector calc

...when done I merely click on the "calc" next to the dsp reading and the date gets sent to my VC and the VC will output the results to a js script of my own.

This is not going to take as long as I thought or be as difficult

What may be difficult is making this availible to all st players via research (suggestion: make it an advanced tactics and/or leadership item with 1-2 days research time). Admin?....

LOL...8am pst...off to work we go....brb later
_________________
"Destruction leads to a very rough road
But it also breeds creation
And earthquakes are to a girl's guitar
They are just another good vibration
And tidal waves couldn't save the world
From Californication"
Red Hot Chili Peppers - Californication
https://www.youtube.com/watch?v=YlUKcNNmywk
___________________________________
https://www.facebook.com/david.brass.524


Last edited by DavAlan on Tue Mar 28, 2006 5:01 pm; edited 2 times in total
 Back to top »
View user's profile Send private message Send e-mail
Robert Roy
Vice Admiral
Vice Admiral


Joined: 11 Jan 2006
Posts: 525
Location: Netherlands

 Post Posted: Tue Mar 28, 2006 4:41 pm    Post subject:
Reply with quote

Watch out with that Osiris. I allways double check that one, cause it has fooled me to many times.
_________________
Nulla poena sine lege..
 Back to top »
View user's profile Send private message
admin
Board Admin
Board Admin


Joined: 09 Jan 2002
Posts: 2938

 Post Posted: Wed Mar 29, 2006 2:11 am    Post subject:
Reply with quote

@dev: did you finish that probes-javascript?

@osiris: you got it wrong: the fleets_top.js adds a dropdownbox with all known coords, that you have and you can simply select the user then to add his coords.
you never have to copy and paste coords anymore
 Back to top »
View user's profile Send private message
Osiris
Captain
Captain


Joined: 07 Mar 2006
Posts: 135

 Post Posted: Wed Mar 29, 2006 10:03 am    Post subject:
Reply with quote

oooh!!! like that, well than i'm wrong

sorry
_________________
By suffering comes wisdom
 Back to top »
View user's profile Send private message Send e-mail
DavAlan
Admiral
Admiral


Joined: 24 Aug 2004
Posts: 778
Location: Palo Alto, California

 Post Posted: Wed Mar 29, 2006 4:18 pm    Post subject: Not yet, working on it....
Reply with quote

admin wrote:
@dev: did you finish that probes-javascript?


My vector calculator is a c++ compiled exe. And it is rather memory and processing extensive. It first must extend a vector line in the forward and reverse directions then loop though all points: x = 400 to 540, y = 400 to 540, z = 10 to 90 and sort out any that fall within a certain linearity to that "line".
All this is probably unessecary as the data is already done by the game code but, not accessible by me.

My idea to implement the vector calc into that page is to load the exe with a click on the "calc" label in the probes.php and send the parameters to it and the results get written to a js script by the c++ program.

But this will require the stand alone exe to be present on the players pc in order to work.
_________________
"Destruction leads to a very rough road
But it also breeds creation
And earthquakes are to a girl's guitar
They are just another good vibration
And tidal waves couldn't save the world
From Californication"
Red Hot Chili Peppers - Californication
https://www.youtube.com/watch?v=YlUKcNNmywk
___________________________________
https://www.facebook.com/david.brass.524
 Back to top »
View user's profile Send private message Send e-mail
admin
Board Admin
Board Admin


Joined: 09 Jan 2002
Posts: 2938

 Post Posted: Wed Feb 18, 2009 7:46 pm    Post subject:

we will add the fleets_top.js script as a standard.
you will have all the coords you have in your comlist in your fleets screen to choose from.

it writes the coords in the three fields and you can change them afterwards.

also i think it would be nice to have a + and - button to change the coords for one sector up and down

maybe the dropdown like it is is not so handy:
it would be nice to have a kind of aouto-completion... you write the beginning of a username or the beginning of some coords and it outocompletes it

someone would like to program that javascript for us?

it would help a lot and we would implement it as default for everyone
 Back to top »
View user's profile Send private message
Display posts from previous:   
SpaceTrace Forum Forum Index » General Discussion » Customizing the "fleets_top.js" javascript
Post new topic   Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Solaris phpBB theme/template by Jakob Persson
Copyright © Jakob Persson 2003



Powered by phpBB © 2001, 2002 phpBB Group

Impressum