Ogame Time Until Available

By Oliver Jensen Last update Jul 20, 2009 — Installed 2,759 times.

maybee you can use this (little update;)

in
Subscribe to maybee you can use this (little update;) 21 posts, 4 voices



wisc User

while using your script i noticed some strange things..
the active timer for building is no longer correct (faster)
i.e. the website says .. building xx is finished .. but when you refresh there are some minutes or seconds left.
also i noticed that the timers should be decreased by 1 each time .. but my firefox only managed to update the screen every 6 or 8 seconds.

so i took your script and .. kinda rewrote some parts to my uses

-changed the way the timers where updated (only 1 call for all timers)
-changed the way the times are calculated (timers seemed to be kinda unprecise so i used the date object)
and thanks vess - added the language independence
-added the resources page to the included urls
and at least i added some extra information on what resource we are waiting and how long it would take to produce the resources from 0.

want to have a look?
http://www.warhammer40000.net/rad/ogame_time_un...

 
Oliver Jensen Script's Author

Thanks for helping out! I've had a quick look at your changes and it looks good. Does having a single update call fix the issue of weird timing? I'm going to have to go through your changes in detail before I update the script, but again, thank you very much, and expect to see your changes made in the next couple days =)

 
wisc User

oh yes ^^ i didnt mention it - but having 1 timer instead of 11 or more fixed the timer thing ;)

made a little update .. (same url)
-changed the way the rows where looped thru in the update function .. reused your concept of an array ..
(dont know why it didnt work that way when i first tryed it :)

 
Vess Scriptwright

Folks, don't forget to exclude moons (planet name contains a "(") - otherwise the counters will keep running backwards with the speed at which they should do so on the planet where the moon is.

 
wisc User

since i am noob (lol) in ogame and dont have a (test)moon;
we should exclude planets containing "(" and ")" on the building pages or on the resources page? ( i dont think moons have resouces page, just asking to be sure )

p.s. updated the script to NOT use cookies
p.p.s. ups i broke it ^^ *fixing*
p.p.p.s. think i fixed it

 
Vess Scriptwright

wisc, yes, moons have "(" in their name, while planets can't have that - this is a language-independent way of determining whether the currently selected planet is a moon. Since no resources are produced on moons, you shouldn't have a countdown for "time to be available" on moons.

Moons do have a Resources page - just like any planet.

I don't see how you can do this without cookies. You have to remember somewhere what the resource production rate for each resource is for each planet, once you leave the Resources page.

 
Oliver Jensen Script's Author

Excellent idea replacing the cookies with GM_setValue. I should do that for my other scripts too

 
wisc User

Ok Vess ^^

i fixed a version for you ;D
Moons should be excluded from all script actions.

Now testing is up to you
still download URL in post#1

26.05. changed the time format because foxgame showing weird progess bar
added useroptions to enable/disable the total production time for the ressources

 
Oliver Jensen Script's Author

Hey guys,
sorry I've let this stagnate a bit... I just graduated and I've been trying to get my life together, which is a surprising amount of work. I'm in a bit of a lull now so I guess it's time to get to work on this ;)
oli

 
Oliver Jensen Script's Author

OK, I've finally updated this thing as follows:
-added language independence
-now has one timer - you're right wisc, that is better :)
-ignores moons
Things I didn't do:
-replacing cookies with GM specific options - lets keep this compatible
-use date objects etc - seemed like overkill
-display what resource we're waiting for - it seems to me you could just look to see that
-make the build link appear when resources have been generated - i might do this at some point...
-fix the universe issue - i'll do this soon but it doesn't seem terribly urgent... it seems unlikely that someone'll have planets in the exact same locations in multiple universes anyway.

 
Vess Scriptwright

Oliver, congratulations about your graduation! :-)

However, I'm not convinced that using GM_setValue instead of cookies is a good idea. GM_* are GreaseMonkey-specific APIs. Yes, they are convenient - but without them, chances are that your script will work for Opera too (it has built-in support for page-specific scripts - essentially something like GreaseMonkey - without the GM-specific APIs, of course).

 
wisc User

ok ok but please include this line in your script so the resouces will be parsed ;)
// @include http://uni*.ogame.*/game/index.php?page=resources*

you dont like the GM_value stuff ^^ and i dont like storing data in a place where the server can read it .. (i am not sure if using this script is allowed :D and i dont want my account to be banned)

yes i must agree - its a bit of an overkill using date and timestamps for the counters ..but setinterval can be a bit unprecise if cpu usage is high (as far as i have noticed)..and i wanted it to be as good as possible (i had seen something like this in an ogame script btw;)

at the "what ressource we are waiting" : we have the information - why not display it then ;) - "you could just look" would also apply to the entire "available to build" thing *excuse my sarcasm*
we dont want to look - we want to know
thats my point and thats why i like(d) your script

keep on

p.s.
the universe thing:
why not try this:

var universe = document.location.host.substr(0,document.location.host.indexOf('\.'));

var coords = universe+'['+dropdown.getElementsByTagName('option')[dropdown.selectedIndex].innerHTML.split('[')[1];

 
Oliver Jensen Script's Author

Vess:
Thanks for your well wishes! I think you may have misread me though - I said I -didn't- do the GM_setValue thingie. And wisc regarding the server reading the cookie, even if this script is illegal because it closely mirrors a Commander function, the cookie is exactly the same as I use for the resource tickers, which isn't illegal, so I can't see that being an issue

wisc:
Great idea on the universe thing - no need to actually figure out the universe, we can just do it by subdomain :) And you make a good point about which resource we're waiting on - I'll include it in the next version. Oh did I forget to include the resources page so that the cookie'd get set? Silly me =P I just never noticed it not working because my other scripts set the identical cookie and do include that page ;) I'll fix that right now... I can't believe nobody noticed that yet ehehehe

 
Drew Dupont User

Why does your script screw up the progress bar on a construction? When it is disabled, it displays correctly. When your script is enabled, it is waaaaaay off.

 
Oliver Jensen Script's Author

You have progress bars on construction?
What script or extension creates these?

 
Vess Scriptwright

While on the subject of fixing @includes, please note the following:

1) Would be nice to @exclude uni6.ogame.de and uni42.ogame.org - these are the "new design" universes and your script won't work there. (There is another script for this purpose, which is made specially for them.)

2) Your @include for the buildings page will work only on the org universes. ;-) Fix it, please. (Hint: look at the pattern for the other @include - it is correct.)

3) The Polish universes are special. Instead of uniNN.ogame.COUNTRY or uniNN.COUNTRY.ogame.org, they use sNN.ogame.onet.pl. You might want to add a couple of additional @include lines for them.

 
Drew Dupont User

The FoxGame plugin adds some niceties.

Wish it would get updated ... maybe I will have a go at the plugin sometime.

 
wisc User

the foxgame progress bar:
i mentioned it somewhere in this thread ^^

foxgame reads times from the < t d > we are injection our stuff
and then gets confused by our values

changing the output format of the waiting time i.e. from 1h 23m 54s to 1:23:54
solves that issue
(you can see this in my version - i allready applyed this on 26.05)

 
Oliver Jensen Script's Author

I don't have foxgame so i'll have to take your word for it. I don't like your time format wisc, as it's not consistent with the rest of the page, but I changed my spaces to & nbsp;s so hopefully that'll fix it. If not, I'll try using other separation unicode chars (I'm assuming foxgame breaks the td on spaces, which is why using :s works?). I also added which resource you're waiting for, and fixed the include url's

 
Vess Scriptwright

Ahem. :-) You "fixed" the @includes (added @excludes, actually) - but forgot to @include the Resources page. ;-)

 
wisc User

yes Mr. Jensen - using & nbsp; seems to fix the progress bar problem too - nice (i also didn't like the time format .. ;)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel