Google Form Vote Counter

This forum is for discussion related to the game.
User avatar
Kagami
Kagami
Jack of All Trades
User avatar
User avatar
Kagami
Jack of All Trades
Jack of All Trades
Posts: 7065
Joined: November 5, 2013

Post Post #3 (isolation #0) » Wed Jan 18, 2017 4:43 am

Post by Kagami »

Make a vb function that writes "hammer" to an arbitrary cell. Mod deletes the message on new day
User avatar
Kagami
Kagami
Jack of All Trades
User avatar
User avatar
Kagami
Jack of All Trades
Jack of All Trades
Posts: 7065
Joined: November 5, 2013

Post Post #4 (isolation #1) » Wed Jan 18, 2017 4:46 am

Post by Kagami »

2 can be done with straightforward string manipulation functions
User avatar
Kagami
Kagami
Jack of All Trades
User avatar
User avatar
Kagami
Jack of All Trades
Jack of All Trades
Posts: 7065
Joined: November 5, 2013

Post Post #7 (isolation #2) » Wed Jan 18, 2017 5:41 am

Post by Kagami »

Doing 1 with a typical formula is impossible (I think), because excel wants doesn't want to have its current state be dictated by anything other than what it currently is. The solution is to write a VBA formula that says something like "If <cell> > <threshold> Then <hardcoded cell index> = "HAMMER!".

If I understand 2, it can be done with string formulas. It's just going to end up being a giant set of &s, ifs, and maybe some string trimming.
User avatar
Kagami
Kagami
Jack of All Trades
User avatar
User avatar
Kagami
Jack of All Trades
Jack of All Trades
Posts: 7065
Joined: November 5, 2013

Post Post #9 (isolation #3) » Wed Jan 18, 2017 5:47 am

Post by Kagami »

Aa, I see what you're saying, you want to keep a snapshot of all the VCs as they occur.

One solution is very similar to 1, you'll need to write a VBA function that looks for a specific range of cells, finds where the historical VCs end, pushes them all down, then writes the current VC to the top.
User avatar
Kagami
Kagami
Jack of All Trades
User avatar
User avatar
Kagami
Jack of All Trades
Jack of All Trades
Posts: 7065
Joined: November 5, 2013

Post Post #10 (isolation #4) » Wed Jan 18, 2017 5:51 am

Post by Kagami »

I'm thinking in excel, btw. I just realized we're talking about sheet, and I'm not really sure how scripting works there.
User avatar
Kagami
Kagami
Jack of All Trades
User avatar
User avatar
Kagami
Jack of All Trades
Jack of All Trades
Posts: 7065
Joined: November 5, 2013

Post Post #11 (isolation #5) » Wed Jan 18, 2017 5:58 am

Post by Kagami »

function writeToMagicCell() {
SpreadsheetApp.getActiveSheet().getRange('K6').setValue('o hi there');
}

^ this is the kind of thing you'll have to do.

Return to “Mafia Discussion”