~login@TTBP



28 october 2018

Small updates to tcoin

tcoin now shows the last 10 messages instead of the last 10 lines of messages.

It does this by ignoring the newline that separates a transaction line from the message line. The algorithm uses newlines to track messages, but counts 0 newlines for "\n" and 1 newline for "\n\n" (where \n means newline). This means that a message accompanying a transaction (which shows up as "\n_\n\n" will be seen by the algorithm as "_\n". This way, even transactions with messages (these span three or more lines) look like a single newline-suffixed lines to the algorithm.

tcoin now breaks down how the number of tildecoins you have was determined.

The number of tildecoin is base_amount + transfers + tildegame_amount + dailyadventure_amount. The base amount is 1000, which is the number of tildecoins that every account begins with. transfers is the net amount of tildecoins received. If more are received than sent, then transfers is positive. If the opposite is true, then it is negative. When both are equal, it is zero. tildegame_amount is the your tilde score in the !tilde game on #bots in the tilde.town irc. This game was created by ~krowbar. dailyadventure_amount is the coins you earn in the daily adventure game. This game is can be played by running da in the terminal. It was created by ~troido.

Those are the only two updates to tcoin. There was also some refactoring done, but the code is still spaghetti bolognese (and not the tasty, melts-in-your-mouth kind).