Does a "Repeat last chat command" API exist?

1515785782
keithcurtis
Roll20 Mod Team
In other words, is there an API script that will send the last message sent to chat, again? It would be useful for multi attacks, or repeated actions where it is impractical to trigger the event a second time. Basically, something the equivalent of clicking in the chat input, pressing the up arrow, and then Enter.
1515786101
The Aaron
Pro
API Scripter
From the point of view of the API, that would technically be the second to last, the one before the one that triggers it to send it. I'm not aware of any API script for that, but it probably wouldn't be TOO hard to do.  It would probably need to track based on the player id, so it could be the last message from the same player?
1515787112
The Aaron
Pro
API Scripter
The biggest problem would be the parameters.  This could be repeated easily enough: &{template:default}{{name=test}}{{foo=[[1d20+8]]}} This could not: &{template:default}{{name=test}}{{foo=[[1d20+8+[[1d4]] [bless] ]]}}
1515789032
keithcurtis
Roll20 Mod Team
Yeah, I think by player would be the best way to handle it. Il'll pretend I understood the parameter statement, nod my head sagely, and say, "ah, yes, of course..." Is it because it only "remembers" things in their resolved state?
1515789431

Edited 1515789558
The Aaron
Pro
API Scripter
HAHAHAHA.  Ok, breaking it down... Take this command as an example: !! foo [[1d20+7]] [[ [[1d4]] t[Gobbies] [gobs] ]] Keep an eye on the bolded part, here is what the API sees from that: {    "content": "!! foo $[[0]] $[[2]]",    "inlinerolls": [       {          "expression": "1d20+7",          "results": {             "resultType": "sum",             "rolls": [                {                   "dice": 1,                   "results": [                      {                         "v": 1                      }                   ],                   "rollid": "-L2fw69dKbmPZiq2C7e6",                   "sides": 20,                   "type": "R"                },                {                   "expr": "+7",                   "type": "M"                }             ],             "total": 8,             "type": "V"          },          "rollid": "-L2fw69dKbmPZiq2C7e6",          "signature": "4019c8bc671b6afa9277a9a27d093ec9382e36e273855169983613ce05221f2e57722ecc2b25ba0b5cd88085c4e39ef77300081dac94bf7315ce5b399f81ad79",          "tdseed": 3535414006810126000       },       {          "expression": "1d4",          "results": {             "resultType": "sum",             "rolls": [                {                   "dice": 1,                   "results": [                      {                         "v": 4                      }                   ],                   "rollid": "-L2fw69dKbmPZiq2C7e7",                   "sides": 4,                   "type": "R"                }             ],             "total": 4,             "type": "V"          },          "rollid": "-L2fw69dKbmPZiq2C7e7",          "signature": "97c056d72a1da60c7f637a376c3299cee356298fa017500e2f12b4eab0622db1ea95fe6dfb8cdc3aba62a072df1bce82d05fc5844cccd3a5de0995faa0771196",          "tdseed": 7013477067002149000       },       {          "expression": "4t[Gobbies] [gobs]",          "results": {             "resultType": "sum",             "rolls": [                {                   "dice": 4,                   "results": [                      {                         "tableItem": {                            "avatar": "https://s3.amazonaws.com/files.d20.io/marketplace/139014/mMfj4LAvILM3Go7sC8D2sw/max.png?1464737459",                            "id": "-KdW1kzWEQeOH8ixqS-c",                            "name": "Pokey",                            "weight": 1                         },                         "tableidx": 2,                         "v": 0                      },                      {                         "tableItem": {                            "avatar": "https://s3.amazonaws.com/files.d20.io/marketplace/139014/mMfj4LAvILM3Go7sC8D2sw/max.png?1464737459",                            "id": "-KdW1kzWEQeOH8ixqS-c",                            "name": "Pokey",                            "weight": 1                         },                         "tableidx": 2,                         "v": 0                      },                      {                         "tableItem": {                            "avatar": "https://s3.amazonaws.com/files.d20.io/marketplace/139006/3wP19ASjb9e7N0KFzZqGwA/max.png?1464737435",                            "id": "-KdW1bHNmP7zrSkDZxu1",                            "name": "Bitey",                            "weight": 1                         },                         "tableidx": 0,                         "v": 0                      },                      {                         "tableItem": {                            "avatar": "https://s3.amazonaws.com/files.d20.io/marketplace/139006/3wP19ASjb9e7N0KFzZqGwA/max.png?1464737435",                            "id": "-KdW1bHNmP7zrSkDZxu1",                            "name": "Bitey",                            "weight": 1                         },                         "tableidx": 0,                         "v": 0                      }                   ],                   "sides": 3,                   "table": "Gobbies",                   "type": "R"                },                {                   "text": "gobs",                   "type": "L"                }             ],             "total": 0,             "type": "V"          },          "signature": false       }    ],    "playerid": "-JS3qKxIUPHLzSbK24ve",    "type": "api",    "who": "The Aaron (GM)" } The API knows where rolls were based on the $[[###]] markers.  You can see $[[0]] in the content property for the 1d20+7 roll, and you can see $[[2]] for the [[1d4]]t[Gobbies] [gobs] ]] roll, but nowhere will you find the $[[1]] that corresponds to the [[1d4]] nested inline roll.  In fact, if you look at the inline rolls entry 2 expression, you'll see it has: "expression": "4t[Gobbies] [gobs]", instead of something more useful like:  "expression": "$[[1]]t[Gobbies] [gobs]", That's why the API wouldn't be able to reconstruct the message perfectly.  If it issued this roll again, you'd always get the 4 results from the Gobbies table, rather than 1-4.  (Of course, it could do some analysis and make a best guess as to where that 4 would get inserted, but you couldn't guarantee correctness, so I'd rather not go down that path.)
1515790135
keithcurtis
Roll20 Mod Team
Ah well, it was just a passing fancy to see if such a thing existed. My need is not high. I like the gobbie names, BTW.
1515792631
Ravenknight
KS Backer
"Breaking it down" he said... it would be easier to understand he said...
1515794603
The Aaron
Pro
API Scripter
Well, technically I never said it would be EASIER to understand. =D
1515794753
Ravenknight
KS Backer
The Aaron said: Well, technically I never said it would be EASIER to understand. =D Touché!
1515794895
keithcurtis
Roll20 Mod Team
For a given value of EASIER...