Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1]

Author Topic: The Bot  (Read 7559 times)

0 Members and 1 Guest are viewing this topic.

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
The Bot
« on: November 11, 2012, 05:11:50 am »
+2

Think it is a good idea to summarize the tasks the bot does regularly (where regularly means at some random times when my PC is up). Complain here if it does something stupid, because my assumptions where to optimistic, or request/discuss global replacements.

Fetch every* page that was modified since last run, and:
  • Standardize the apostrophes in Worker's Village, Phil'ers Stone, K'sC and F'sG.  Especially because I don't want to fetch 3 different possibilities in other replacements.
  • Standardize the {{Card|}} {Coin|}} and {{Cost|}} template to first letter capitelized. Also mainly to make work for other scripts easier.
  • Try to get every mention of $ and P that seems to mean Coin and Potion transformed into their templates
  • transform template {{Coin|}}->{{Cost|}}
  • transform internal links of cards [[$Card]] into {{Card|$Card}} template
  • Standardize lists to have a space after the '*'s.  Also mainly as revenge because it once broke a script. Now also supports headlines.

* Main namespace, no redirects, and nothing that was changed by a bot.


Code is on github
« Last Edit: November 16, 2012, 02:24:12 am by DStu »
Logged

TwiNight

  • Spy
  • ****
  • Offline Offline
  • Posts: 85
  • Respect: +45
    • View Profile
Re: The Bot
« Reply #1 on: November 11, 2012, 05:45:16 am »
0

Caught a mis-transfrom "coins" -> coin icon in Prosperity flavor text

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways
« Last Edit: November 11, 2012, 05:51:30 am by TwiNight »
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #2 on: November 11, 2012, 05:55:03 am »
0

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways

OK, can exclude Infoboxes [:e2 done]. But it would be better (don't know if possible), if the card does not leave the page anyway.  There are also some in the text that you can't see.

edit:
Quote
Caught a mis-transfrom "coins" -> coin icon in Prosperity flavor text
Don't see this. Which revision?
« Last Edit: November 11, 2012, 06:07:44 am by DStu »
Logged

TwiNight

  • Spy
  • ****
  • Offline Offline
  • Posts: 85
  • Respect: +45
    • View Profile
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #4 on: November 11, 2012, 06:36:06 am »
0

Don't see this. Which revision?

http://wiki.dominionstrategy.com/index.php?title=Prosperity&diff=4732&oldid=4440

Thanks.  That should not be the standard replacement, but was a one-time script when the {{coin|}} template was introduced.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #5 on: November 11, 2012, 10:35:07 am »
0

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways
But it would be better (don't know if possible), if the card does not leave the page anyway.  There are also some in the text that you can't see.
... in particular, you have the problem with expanded Navbox Cards on every page of a card.
Logged

ftl

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2056
  • Shuffle iT Username: ftl
  • Respect: +1345
    • View Profile
Re: The Bot
« Reply #6 on: November 11, 2012, 03:38:44 pm »
0

oh hey, does the bot mean that I can just use [[Card]] and it'll get fixed automagically? It's quicker to type when linkifying large numbers of things in "synergies/antisynergies"
Logged

greatexpectations

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1097
  • Respect: +1067
    • View Profile
Re: The Bot
« Reply #7 on: November 11, 2012, 03:44:02 pm »
0

minor bot complaint: the bot broke some bulleted formatting on the duchy page. i linked the revision below.

http://wiki.dominionstrategy.com/index.php?title=Duchy&oldid=5514#Cards_Which_Interact_With_Duchy

it is the only place i can remember seeing the bot do this. let me know if there is something i should pay attention to with my formatting.
Logged
momomoto: ...I looked at the tableau and went "Mountebank? That's for jerks."
rrenaud: Jerks win.

TwiNight

  • Spy
  • ****
  • Offline Offline
  • Posts: 85
  • Respect: +45
    • View Profile
Re: The Bot
« Reply #8 on: November 11, 2012, 03:58:56 pm »
0

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways
But it would be better (don't know if possible), if the card does not leave the page anyway.  There are also some in the text that you can't see.
... in particular, you have the problem with expanded Navbox Cards on every page of a card.
That goes off the bottom so not a big deal. The page is supposed to be scrolled vertically anyway.
But going off the right is another thing
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #9 on: November 11, 2012, 05:22:54 pm »
+1

minor bot complaint: the bot broke some bulleted formatting on the duchy page. i linked the revision below.

http://wiki.dominionstrategy.com/index.php?title=Duchy&oldid=5514#Cards_Which_Interact_With_Duchy

it is the only place i can remember seeing the bot do this. let me know if there is something i should pay attention to with my formatting.

That is the headings-version of
Quote
Standardize lists to have a space after the '*'s.  Also mainly as revenge because it once broke a script. Now also supports headlines.
I tried to capture expressions like XYZ[[$Card]] to transform that into {{Card|$Card|XYZ$Card}}, and assumed that everything that is not a space should get merged. Forgot about something like =,* and linebreaks. But the expression is more carefull now, should not happen again.

edit: Anyway, I don't think that it is a good idea to expect that someone pays attention on formatting, because not everyone will. I will just a) try to not take assumptions that are not given, and on the same time b) enforce the assumptions by reformatting with the bot.
« Last Edit: November 11, 2012, 05:27:42 pm by DStu »
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #10 on: November 11, 2012, 05:24:40 pm »
0

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways
But it would be better (don't know if possible), if the card does not leave the page anyway.  There are also some in the text that you can't see.
... in particular, you have the problem with expanded Navbox Cards on every page of a card.
That goes off the bottom so not a big deal. The page is supposed to be scrolled vertically anyway.
But going off the right is another thing
But they also go off to the right if you expand the Navbox, as there are lots of cards that are on the right of the screen already. Can also happen in "standard" text, but hard to link because depends on browser and resolution. But if you resize your window until you get a {{Card|}}-link to the right of it, you should see it.
Logged

TwiNight

  • Spy
  • ****
  • Offline Offline
  • Posts: 85
  • Respect: +45
    • View Profile
Re: The Bot
« Reply #11 on: November 11, 2012, 05:38:22 pm »
0

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways
But it would be better (don't know if possible), if the card does not leave the page anyway.  There are also some in the text that you can't see.
... in particular, you have the problem with expanded Navbox Cards on every page of a card.
That goes off the bottom so not a big deal. The page is supposed to be scrolled vertically anyway.
But going off the right is another thing
But they also go off to the right if you expand the Navbox, as there are lots of cards that are on the right of the screen already. Can also happen in "standard" text, but hard to link because depends on browser and resolution. But if you resize your window until you get a {{Card|}}-link to the right of it, you should see it.
But mysteriously enough, those does not allow the horizontal scrolling but those in Infoboxes do...... at least in Chrome
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #12 on: November 12, 2012, 03:09:07 am »
0

And, you might not want to replace EVERY card internal link to the template. I intentionally not use the template in the expansion infoboxes because the card image, despite hidden, will go off the right edge and make the page (undesirably) horizontally scrollable. There is a card list right beside anyways
But it would be better (don't know if possible), if the card does not leave the page anyway.  There are also some in the text that you can't see.
... in particular, you have the problem with expanded Navbox Cards on every page of a card.
That goes off the bottom so not a big deal. The page is supposed to be scrolled vertically anyway.
But going off the right is another thing
But they also go off to the right if you expand the Navbox, as there are lots of cards that are on the right of the screen already. Can also happen in "standard" text, but hard to link because depends on browser and resolution. But if you resize your window until you get a {{Card|}}-link to the right of it, you should see it.
But mysteriously enough, those does not allow the horizontal scrolling but those in Infoboxes do...... at least in Chrome
Firefox does, [edit: but Chrome doesn't, I can reproduce that]
« Last Edit: November 12, 2012, 03:10:45 am by DStu »
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #13 on: November 12, 2012, 03:11:51 am »
0

oh hey, does the bot mean that I can just use [[Card]] and it'll get fixed automagically? It's quicker to type when linkifying large numbers of things in "synergies/antisynergies"
yes
Logged

TwiNight

  • Spy
  • ****
  • Offline Offline
  • Posts: 85
  • Respect: +45
    • View Profile
Re: The Bot
« Reply #14 on: November 12, 2012, 03:59:42 am »
+1

Firefox does, [edit: but Chrome doesn't, I can reproduce that]
Enough as a reason not to anyway
Caught another $ -> Cost mis-transform on Goko page
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #15 on: November 12, 2012, 04:03:25 am »
+1

Firefox does, [edit: but Chrome doesn't, I can reproduce that]
Enough as a reason not to anyway
Caught another $ -> Cost mis-transform on Goko page
Quote
They are at a point where they are [http://forum.dominionstrategy.com/index.php?topic=4738.msg110614#msg110614 accepting] money for the purchase of expansions, with the prices significantly reduced (from ~$6 to ~$4 per half set) from the previous release. 
That's unfair.
Logged

Schneau

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1174
  • Shuffle iT Username: Schneau
  • Respect: +1461
    • View Profile
    • Rainwave
Re: The Bot
« Reply #16 on: November 12, 2012, 09:46:31 am »
0

Firefox does, [edit: but Chrome doesn't, I can reproduce that]
Enough as a reason not to anyway
Caught another $ -> Cost mis-transform on Goko page
Quote
They are at a point where they are [http://forum.dominionstrategy.com/index.php?topic=4738.msg110614#msg110614 accepting] money for the purchase of expansions, with the prices significantly reduced (from ~$6 to ~$4 per half set) from the previous release. 
That's unfair.

LOL. Goko should have their prices in Dominion coins.

(we could change it to "about six dollars to four dollars")
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #17 on: November 12, 2012, 11:37:58 am »
0

Firefox does, [edit: but Chrome doesn't, I can reproduce that]
Enough as a reason not to anyway
Caught another $ -> Cost mis-transform on Goko page
Quote
They are at a point where they are [http://forum.dominionstrategy.com/index.php?topic=4738.msg110614#msg110614 accepting] money for the purchase of expansions, with the prices significantly reduced (from ~$6 to ~$4 per half set) from the previous release. 
That's unfair.

LOL. Goko should have their prices in Dominion coins.

(we could change it to "about six dollars to four dollars")
Don't worry, I will just exclude [[Goko]] from this script, I don't think there will be much need to transform $s to {{Cost|}} on this page anyway. The command does some more things at the moment, but I could split that up.  But at the moment I don't see much need for the other things either, so just -excepttitle:"Goko"
Logged

TwiNight

  • Spy
  • ****
  • Offline Offline
  • Posts: 85
  • Respect: +45
    • View Profile
Re: The Bot
« Reply #18 on: November 13, 2012, 05:16:23 am »
0

May be you want to also exclude Help:Discussion now
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #19 on: November 13, 2012, 05:20:56 am »
0

May be you want to also exclude Help:Discussion now

seems to not be included anyway. Probably not in main namespace.  Guess that everything that has a : in the name is some other namespace?
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #20 on: November 15, 2012, 02:13:44 pm »
0

Put the code on the github, see OP.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: The Bot
« Reply #21 on: November 22, 2012, 02:23:58 pm »
0

Replaced some CR.com links with isotropic, if the isotropic still exists. Every gamelog that links still to CR should not exist on iso either.

Not sure what to do with these...
Logged
Pages: [1]
 

Page created in 0.057 seconds with 21 queries.