Autolog Example Page

Here is an example of how you can use autolog.js to automate your activity logs for Colors TCG! I use it on my main page which you can see here!

Get the code here! Save it and link it at the BOTTOM of your HTML page (you can look at the code of this page for an example!)

The overall set-up and way you organize your page and your log dates don't matter, as long as the whole log is contained inside one <p> tag with the id "logpara". For each entry, however, you have to use certain keywords for the tool to count things accurately. The 'keywords' are listed below, and are CASE SENSITIVE, so you have to type them exactly as they appear. The tool checks what is BETWEEN the keywords in order to do its math, so if either keyword is missing, it will get confused and have an inaccurate count.

TRADES
Traded [cardname, cardname, cardname] to [username].
Keywords Traded and to. Trade entries assume that you're doing 1:1 trades, so they don't affect your card count in any way. If it's not a 1:1 trade, you will probably have to use a gift or received entry to balance it out.

GIFTS
Gifted [cardname] to [username].
Keywords Gifted and to. Gift entries remove the # of cards you typed out from your total card count and also add that # to your number of trades. This is only for actual gifts given to other players, because these count as trades for your sketchpads.

RECEIVED
Received [cardname, cardname] from [game].
Keywords Received and from. Received entries add the # of cards you typed out to your total card count.

DONATED
Donated [cardname, cardname];.
Keywords Donated and ; (a semi-colon). Donated entries remove the # of cards you typed out from your total card count. You can use this for cards you lose in games.

EXCLUDING ITEMS FROM CARD COUNT
Received *1 red crayon from [game].
Keyword * (an asterisk). If you want to EXCLUDE an item from your card count, you can place an * (an asterisk) directly before the item.

EXAMPLE LOG (ALL WITHIN <p id="logpara"> TAG)

Read from bottom to top. Technically you can do top-bottom or bottom-top since the numbers will still be the same. An entirely empty log will claim that you have 1 card, but as soon as you add an entry it will show the correct count. Then notes in parentheses are just for the sake of explaining what the tool is doing with each entry.

10/6/22
- Received *1 red crayon from Game. (no change, since it's marked with an asterisk; 10 cards)
- Gifted card to Someone (-1, 10 cards, +1 trade, 4 trades)

10/5/22
- Traded card, card to Someone for card, card (+2 trades, 3 total)
- Donated card to Game; (-1, total 11)
- Received card, card, card from Game. (+3, total 12)
- Received card, card, card from Game. (+3, total 9)

10/2/22
- Received card, card from Game. (+2, total 6)
- Traded card to Someone for card2. (Still 4, +1 trades)
- Received card, card, card, card from Game. (+4)

EXAMPLE COUNT

These numbers are collected automatically from the log to the left! You must have each of the following sections in a separate <p> with the following ids: totalcards, totaltrades, totalsketchpadscompleted, currentsketchpadvalue