Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Silvyre's full-sized avatar
👨‍💻

Rafi Ungar Silvyre

👨‍💻
View GitHub Profile
@Silvyre
Silvyre / ACCio.dat
Last active July 4, 2022 20:43
🧙🐑 AutoControl for Colonist.io (ACCio): play Colonist.io using your keyboard! Setup instructions in comments below.
{"customEntities":{"script":[["1",{"name":"wall.js","value":{"mdTime":1641400238352,"srcCode":"await ACCio(_ => {\n socketGameSend.buildCityWall();\n selectNextAfterDelay();\n});"}}],["2",{"name":"setup.js","value":{"mdTime":1656815986599,"srcCode":" try {\n return ACCio(_ => console.log(\"ACCio is already enabled! Try refreshing if you're having trouble.\"));\n }\n catch (e) { console.error(e) }\n\n try {\n await ACtl.runInPageCtx('https://cdn.jsdelivr.net/gh/CoeJoder/waitForKeyElements.js@v1.2/waitForKeyElements.js');\n }\n catch {\n return ACtl.runInPageCtx(_ => console.error('ACCio failed to load all required libraries.'));\n }\n\n ACCio = new Proxy(ACtl.runInPageCtx, {\n apply: (target, thisArg, argumentsList) => {\n if (['INPUT', 'TEXTAREA'].includes(document.activeElement.tagName)) {\n return;\n }\n\n try { return target(...argumentsList); }\n catch (e) { console.error(e) }\n }\n });\n\n await ACtl.runInPageCtx(_ => waitForKeyElements('canvas[style*
@Silvyre
Silvyre / [Tampermonkey] dominion.games Automated Table Setup
Last active July 27, 2020 08:20
Automates Dominion Online table configuration. To be used via Tampermonkey. Please see: https://greasyfork.org/en/scripts/407793-dominion-games-automated-table-setup
// ==UserScript==
// @name dominion.games Automated Table Setup
// @description Click on the 'New Table' button to trigger the script
// @version 0.2
// @author Rafi_
// @match https://dominion.games/
// @namespace http://tampermonkey.net/
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
// @require https://greasyfork.org/scripts/6250-waitforkeyelements/code/waitForKeyElements.js?version=23756
// @grant GM_addStyle
[[ [[floor({?{Level|1+1} - 3, 0}kh1 / 10)]]d20! + 1d[[(({?{Level}, 1}kh1 - 3 + 2 * [[{abs((?{Level} - 10) % 10 - 4.5) + {1/2}, {3} }<2]]) % 4 + 3) * 2 + [[{abs((?{Level} - 5) % 10 - 4.5) + {1/2}, {4} }<3]] * ((floor(({?{Level}, 1}kh1 - 7) / 10) % 2 * 4 - 2 * floor(({?{Level}, 1}kh1 - 7) % 10 / 2)) * (1 - 2 * (1 - floor(({?{Level}, 1}kh1 - 7) / 2) % 2)) * (1 - floor(({?{Level}, 1}kh1 - 7) / 10) % 2 * 2))]]! + [[{abs((?{Level} - 5) % 10 - 4.5) + {1/2}, {4} }<3]]d[[{(floor(({?{Level}, 1}kh1 - 7) % 10 / 2) + 4) * 2, {12} }kl1]]! ]]
Attacker's Weapon Class roll: [[ 1d20>[[20 - {3,10,10,11,14,14,16,16}<?{AWC} - 4 * {4,5,7,13}=?{AWC} - 3 * {6,0}=?{AWC} - 2 * {5,0}=?{AWC} - {1,2,3,7,8,9,10}=?{AWC} * ?{DAC} - {1,9,16}=?{AWC} * {2, 11 - [[{16,0}=?{AWC}]]}<?{DAC} - {2,0}=?{AWC} * {3,4,11}<?{DAC} - {4,5,6,13}=?{AWC} * {2, 3 + 4 * [[{7,0}=?{AWC}]], 3 + 4 * [[{7,0}=?{AWC}]], 10 - 7 * [[{13,0}=?{AWC}]]}<?{DAC} - 6 * {9,11}<?{DAC} * {6,0}=?{AWC} + 7 * {4,0}=?{DAC} * {16,0}=?{AWC} - {2,5,6,6,6,7,8,9,9,10}<?{DAC} * {11,0}=?{AWC} - {2,7,7,7,7,8,8,9,9,9,10}<?{DAC} * {12,0}=?{AWC} - {2,3,4,6,8,9}<?{DAC} * {14,0}=?{AWC} - {2,9,9,9,9,9}<?{DAC} * {15,0}=?{AWC}]] ]]
Attacker's Hit Dice roll: [[ 1d20>[[21 - ?{DAC} - {6,11}<?{DAC} - {2,4,6,9,11,15}<?{AHD}]] ]]
Attacker's Mental Strength roll: [[ 1d20>[[{10 + ?{DMS} - ?{AMS}, 1}kh1]] ]]
To hit: [[ 3 + {@{ws}, @{ws} * 2 + 1}<@{target|ws} ]]
To wound: [[ 2 + {{@{target|tns} - @{str} + 2, 0}kh1, {4}}kl1 ]]
[[ 1d6cs0cf<[[ {1e2 - 6 + {1e3,105}<@{selected|SPD} + 5 * {115,265}<@{selected|SPD} - 1e2 * {1,3,57}=[[floor(@{selected|SPD} / 10 + 1/2) * 2 - 1]], 1e2 - 4 + 3 * {85,235}<@{selected|SPD} + 2 * {235,275}<@{selected|SPD} - 1e2 * {1,3,5,7,11,15,45,51}=[[floor(@{selected|SPD} / 10 + 1/2) * 2 - 1]], 1e2 - 6 + {35,95}<@{selected|SPD} + 2 * {145,275}<@{selected|SPD} + 3 * {145,295}<@{selected|SPD} - 1e2 * {1,3,9,11,15,21,27}=[[floor(@{selected|SPD} / 10 + 1/2) * 2 - 1]], 1e2 - 3 + 5 * {1e3,175}<@{selected|SPD} - 1e2 * {1,3,5,7,9,13,33}=[[floor(@{selected|SPD} / 10 + 1/2) * 2 - 1]], 1e2 - 3 + 5 * {1e3,205}<@{selected|SPD} - 1e2 * {1,3,5,7,9,39}=[[floor(@{selected|SPD} / 10 + 1/2) * 2 - 1]], 1e2 - 6 + floor(@{selected|SPD} / 30 - 1/2) - 1e2 * {1,2}=[[(floor(@{selected|SPD} / 10 + 1/2) * 2 - 1) % 3]], 1e2 - 5 + floor(@{selected|SPD} / 30) + {-1e3,0}=[[(floor(@{selected|SPD} / 10 + 1/2) * 2 - 1) % 3]] - {-1e3,24}>@{selected|SPD}}>[[@{selected|HC} + (?{HC mods|0}) + 1e2]] ]] ]]
&{template:5e-shaped} {{title=Animate Objects}} {{subheader=*?{Size|Tiny, [Tiny](-2)|Small, [Small](0)|Medium, [Medium](1)|Large, [Large](2)|Huge, [Huge](4)} objects attack!*
}} {{[1](#).=[[ ?{Roll|Normal, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1} + [[abs(?{Size} - 1) + 5]] + {0} ]] vs. AC for [[ [[1 + ceil(?{Size} / 4)]]d[[floor((?{Size} - 2 * {0, 3}=[[2 + ?{Size}]]) / 2) * 2 + 8]] + [[abs(?{Size} - 1) + 1]] ]] damage (if crit, +[[ [[1 + ceil(?{Size} / 4)]]d[[floor((?{Size} - 2 * {0, 3}=[[2 + ?{Size}]]) / 2) * 2 + 8]] ]])
}} {{[[[{?{Number of attacks|1|2|3|4|5|6|7|8|9|10}, 2}kl1]]](#).=[[ ?{Roll} + [[abs(?{Size} - 1) + 5]] + {0} ]] vs. AC for [[ [[1 + ceil(?{Size} / 4)]]d[[floor((?{Size} - 2 * {0, 3}=[[2 + ?{Size}]]) / 2) * 2 + 8]] + [[abs(?{Size} - 1) + 1]] ]] damage (if crit, +[[ [[1 + ceil(?{Size} / 4)]]d[[floor((?{Size} - 2 * {0, 3}=[[2 + ?{Size}]]) / 2) * 2 + 8]] ]])
}} {{[[[{?{Number of attacks}, 3}kl1]]](#).=[[ ?{Roll} + [[abs(?{Size} - 1) + 5]] + {0} ]] vs. AC for [[ [[1 + ceil(?{Size} / 4)]]d[[
/em rolls ?{d|1|2|3}d vs. Ability ?{A|1|2|3|4|5|6|7|8|9|10|11|12}:
/r {[[ d12cs?{A}cf>[[?{A}+1]] % (?{A}+11) % (?{A}+10) % (?{A}+9) % (?{A}+8) % (?{A}+7) % (?{A}+6) % (?{A}+5) % (?{A}+4) % (?{A}+3) % (?{A}+2) % (?{A}+1) ]], [[ (?{d}/4)d12cs?{A}cf>[[?{A}+1]] % (?{A}+11) % (?{A}+10) % (?{A}+9) % (?{A}+8) % (?{A}+7) % (?{A}+6) % (?{A}+5) % (?{A}+4) % (?{A}+3) % (?{A}+2) % (?{A}+1) ]], [[ (?{d}/6)d12cs?{A}cf>[[?{A}+1]] % (?{A}+11) % (?{A}+10) % (?{A}+9) % (?{A}+8) % (?{A}+7) % (?{A}+6) % (?{A}+5) % (?{A}+4) % (?{A}+3) % (?{A}+2) % (?{A}+1) ]]}kh1
@Silvyre
Silvyre / [Earthdawn] Step Calculator
Last active February 16, 2017 20:27
Supports 100+ Steps.
Step [[?{Step|5+4+3}]] ⇒ [[ [[{1e3, 14}<[[{?{Step}, 0}kh1 % 22]] + floor(([[{?{Step}, 0}kh1]]) / 22)]]d20! + [[{0, 1, 1, 2, 6, 10}=[[{?{Step}, 0}kh1 % 11]] - {-1, 1}=[[{?{Step}, 0}kh1]] + floor(([[{?{Step}, 0}kh1]] - 3) / 22)]]d10! + [[{0, 5, 9}=[[{?{Step}, 0}kh1 % 11]] + {1, 2}=[[{?{Step}, 0}kh1]] + floor(([[{?{Step}, 0}kh1]] - 3) / 22)]]d8! + [[{-1, 8}=[[{?{Step}, 0}kh1 % 11]] - {0, 1, 5, 6}=[[{?{Step}, 0}kh1 % 11]] + {-1, 1}=[[{?{Step}, 0}kh1]] + 1]]d[[4 + 2 * {4, 8, 9, 10}=[[{?{Step}, 0}kh1 % 11]] + 8 * ({2, 7}=[[{?{Step}, 0}kh1 % 11]] * (1 - {-1, 2}=[[{?{Step}, 0}kh1]]))]]! - [[{1, 2}=[[{?{Step}, 0}kh1]] * (3 - [[{?{Step}, 0}kh1]])]] ]]
&{template:default} {{Results
[[ d20cf<?{Attribute|11}cf>[[?{Ability|3}*2 + ?{Attribute} + 1]]cs<[[?{Ability} + ?{Attribute}]] ]] [[ d20cf<?{Attribute}cf>[[?{Ability}*2 + ?{Attribute} + 1]]cs<[[?{Ability} + ?{Attribute}]] ]] [[ d20cf<?{Attribute}cf>[[?{Ability}*2 + ?{Attribute} + 1]]cs<[[?{Ability} + ?{Attribute}]] ]]
= *Attribute ?{Attribute}*
*Ability ?{Ability}*
}} {{Reference
``L M H``
``[[d0cf0]] S S S``
``[[d0]] F * S``
``[[d0cs1cf1]] F F *``
``[[d0cs1cf0]] F F F`` =