Comments by Johan Sundström on scripts

229 comments

Comment on:
IkaResourceSort

Oct 2, 2008

Your "Breafuios - based on Wiisley's script" script logic seems to bug out for sawmills of level 21; the iteration first goes above the length of the array indices (trying to index undefined with 0); surrounding that part up to the return with a try{ ... }catch(e){} block at least prevents it from killing script execution.

Also, the script seems to break on islands you have more than one city on.

(Friendly tip: instead of cut&paste:ing the ugly unreadable document.evaluate DOM API code a dozen+ times, @require http://ecmanaut.googlecode.com/svn/trunk/lib/gm/$x$X.js and use $X(xpath) for picking out a single node or $x(xpath) for an array of nodes. Supply an additional node parameter if you want to find something with a relative xpath expression instead. Tons more readable code, for free.)

Comment on:
OkCupid personality awards sorter

Sep 30, 2008

Added a GM 0.8 compat hack. Dang; we really should get a 0.8.1 release out soon; that stuff shouldn't have to bother people.

Comment on:
OkCupid personality awards sorter

Sep 30, 2008

1: Nope.
2: I much prefer UI:s that work live, and where I browse; profile pages, in this case.
3: Top/center/bottom, but the rightmost 67% of the image doesn't capture those clicks.

Comment on:
Kronos Utils 0.6

Sep 27, 2008

The remotely hosted version hasn't been updated to 0.2.8 in full yet, though Motley fixed the most crucial ones some day or days ago while I've been busy irl, so it already kind of works again.

Comment on:
Kronos Overview

Sep 27, 2008

Kronos Utils (which this script relies on for the data) is not quite up to speed with 0.2.8 yet, but it got better with some fixes from Motley.

Thanks for fixing both misfeatures; sloppy of me to miss the * for the group in the @include section. :-) Script properly updated now.

Comment on:
AutoPagerize

Sep 17, 2008

I'd suggest tagging this script with the "pagination" tag -- which will link to lots of other little microformat producer scripts that add the <link rel="next" href="..."> microformat to web pages in tons of places.

(You might also want to handle the additional microformat used by this generic unpagination script, though it might not feel worth the work.)

In part for not knowing about the other one (my search skills also wouldn't have figured out that Autopagerize removed rather than added paging, though) but first and foremost, this was an experimentative study I had been brewing on for a while, in writing generic cooperating user scripts that meet one another over a micro format (stigmergy), augmenting the microformat in different ways.

This key bindings script augments the same microformat as the unpaginator, but in a different way: instead of pulling in next page's items into this page, it adds keyboard bindings to scroll to the next item on the current page, so you can move up and down the item list by pressing m / p (rather arbitrarily picked, to sit well with how I read online comics, which uses j, k, l and n for related purposes implemented by same script and another), over and over again.

As you'll note, the two scripts run independent of one another, so if you install both, you get both features -- infinite scrolling and keyboard navigation of the items, even to new items that get added as you tap your way through them.

The main beauty of all of it is that all three (or more) parts can be maintained, developed, improved, added or removed independently of one another: any scriptwright can add a new site to the system, without communicating with me or anyone else, anyone that has a use for the properties these microformat consumers use can make new scripts using them for whichever purposes, and you don't have to opt in to all features making use of the data, only those you like.

(Based on the data items Autopageresize adds, it does not do precision cutting of only the item nodes from the pages it unpaginates, as my variant does, but if all one wants is something to undo pagination that system might be the better pick, given its large user base.)

Comment on:
Kronos Utils 0.6

Sep 11, 2008

@silent_gamer: I think you misinterpreted me there; it was a good question - follow the link for more info on inadvisable ways of conduct that *will* get you banned - and some clear reasoning about how it all works. No derogatory remark intended; sorry if I was overly terse.

@camel: Thanks; included in remotely hosted version. (I'll try to get some time to update the version here too at some time.)

@daiei27: Sorry; see feedback section above for bug reporting; I don't do bug tracking for this script here.

@Nick Rosier: Nope; I was hoping subversion keyword expansion would be performed on google code's svn server, but those unfortunately only work if you check out the code with subversion and install from local files. I think more recent versions have dropped the revision number bit.

Comment on:
Kronos Overview

Aug 19, 2008

Oh; the version hosted here was actually buggy that way -- thanks for mentioning it. Updated from the repository now. As a side bonus, you can toggle the display on and off now in v11 on the left pillar base.

Comment on:
Ikariam Attack Counter

Aug 15, 2008

If you can stand the tons of other features, I'd recommend using Kronos Utils instead for this purpose -- which keeps different counters for different towns named Polis, for instance (but requires you to read the report once to know which city it was about).

Comment on:
Kronos Overview

Aug 12, 2008

It's possible that Greasemonkey has UTF-8 issues on win32 Firefoxen, but I only have anecdotal evidence, and haven't dug into it myself, as I don't really have a setup like that at the moment.

Comment on:
Kronos Overview

Aug 11, 2008

Won't do it in ever-present table form, but may do it in a fashion similar to the click-small-wood-icon view for the city column. Would probably look more like the IK+ building overview than ikariam overview table's take, though.

But don't hold your breath; that's a minimum priority feature for me, as I prefer Kronos' take on it.

(The revision numbers will probably go away; they apparently don't work when installing from the repository itself; only when you check it out using subversion, and install and update from there.)

Comment on:
Wikipedia undelete

Aug 10, 2008

Nope, it's an E4X XML literal. Your Firefox handles that since a few months or years, but no other browsers grok the syntax yet.

Comment on:
Kronos Overview

Aug 5, 2008

Unlikely, but in case not already known to you, Kronos Utils shows the latter info for the current town of reference in the top portion of the screen where your population indicator is; "202 (1,324:10h)", for instance, means 202 free citizens of 1324 total and that you should start upgrading this town hall within the next ten hours, if you don't want to miss any population growth.

A negative time reading, similarly, means that you might want to train some troops, may distribute less wine, or similar, if you don't want to miss population growth time when it does fill up.

The Kronos code that calculates that stuff is rather tightly bound to the current city at the moment, and I'm too lazy to do refactor it, for now, so it won't show up in the table overview anytime soon.

Comment on:
Kronos Overview

Aug 2, 2008

Pax0707: Nah; I'm settling for the subset I liked myself, plus the additions I missed in that one.

la faucille: Unlikely; that was the kind of bloat I did not like in Andras Suller's version (which he gracefully let us who didn't like it disable -- I'm sure you could run that one with only those bits turned on if you liked them).

ordan: Now the initial plans have all been fulfilled, including that one.

Comment on:
Kronos Overview

Jul 31, 2008

It didn't handle auto-updating Really Old Kronos Utils versions. Now it probably does.

It also sports a military units table now, which hopefully works fairly well.

Comment on:
ikariam alarm and overview table

Jul 29, 2008

A less featureful but likely also less prone to breakage script doing similar things with a bit more elegance is available here: http://userscripts.org/scripts/show/30750

Comment on:
ikariam alarm and overview table

Jul 29, 2008

Okay; I've finally made my own variant of this script's table, Kronos Overview. It isn't as full of options and features as this hack, and it never will be either, but it won't break as often under ikariam layout changes as this one does.

Comment on:
Kronos Utils 0.6

Jul 24, 2008

@silent_gamer: Yes. In particular, if you are unintelligent about it. In practice, it will not happen unless you cause Gameforge grief, costs or trouble over it.

(I am well known in that community as the script's maintainer, yet have not been banned over it yet.)

Comment on:
Ikariam Solarium 2.1

Jul 1, 2008

Ah! Glad to see you back again -- we have missed you. :-)

Comment on:
ikariam alarm and overview table

Jun 27, 2008

Advice to whomever might fix this next time: Instead of the brittle XPath expression to look up the name of the current building, use the value of document.body.id to determine that. The indices of this object are the id:s, value are the building numbers:

var buildingIDs = {
  townHall: 0, port: 3, academy: 4, shipyard: 5, barracks: 6,
  warehouse: 7, wall: 8, tavern: 9, museum: 10, palace: 11, embassy: 12,
  branchOffice: 13, workshop: 15, "workshop-army": 15, "workshop-fleet": 15,
  safehouse: 16, palaceColony: 17
};

This works stably across any page layout changes Gameforge ever does, and is what Kronos Utils does without ever encountering any trouble (track record back to 0.1.8, or thereabouts, when I think I started hacking on Kronos).

I think the site css changed after your script was created; I made one of my own here, adding a spacer between pages too. (And if you're avoiding @require to let GM 0.7 users run the script too, I wouldn't bother now that GM 0.8 has gone public.)

Fun, isn't it? :-)

For it to do anything, one needs to read, understand and follow the docs above; all four sentences of it.