Difference between revisions of "User:Troylaurin"
Jump to navigation
Jump to search
Troylaurin (talk | contribs) m |
Troylaurin (talk | contribs) (Reduce lines for "craft ingot") |
||
Line 625: | Line 625: | ||
| | | | ||
| | | | ||
− | | | + | |12 |
| | | | ||
{| class="wikitable mw-collapsible mw-collapsed" | {| class="wikitable mw-collapsible mw-collapsed" | ||
Line 631: | Line 631: | ||
|- | |- | ||
|<syntaxhighlight lang="actionscript"> | |<syntaxhighlight lang="actionscript"> | ||
− | + | ; tier = global.int.get("craft_tier:ingot") | |
− | + | ; count = global.double.get("craft_count:ingot") | |
− | + | ; verify_mode = global.int.get("craft_verify:ingot") | |
− | |||
− | tier = global.int.get("craft_tier:ingot") | ||
− | count = global.double.get("craft_count:ingot") | ||
− | verify_mode = global.int.get("craft_verify:ingot") | ||
global.int.set("craft_verify:ingot", 0) | global.int.set("craft_verify:ingot", 0) | ||
− | gotoif(99, | + | gotoif(99, global.int.get("craft_tier:ingot") < 1 | global.int.get("craft_tier:ingot") > 10 | global.double.get("craft_count:ingot") <= 0.0 | global.int.get("craft_status") > 199) |
− | gotoif(99, | + | gotoif(99, global.double.get("craft_count:ingot") <= count("ingot", global.int.get("craft_tier:ingot"))) |
− | gotoif(bad, | + | gotoif(bad, global.double.get("craft_count:ingot") > count("ingot", global.int.get("craft_tier:ingot")) + count("dust", global.int.get("craft_tier:ingot")) - 1.0) |
− | gotoif(99, | + | gotoif(99, global.int.get("craft_verify:ingot") > 0) |
waitwhile(active("oven")) | waitwhile(active("oven")) | ||
− | produce("dust", | + | produce("dust", global.int.get("craft_tier:ingot"), ceil(global.double.get("craft_count:ingot") - count("ingot", global.int.get("craft_tier:ingot"))), "oven") |
− | waituntil(count("ingot", | + | waituntil(count("ingot", global.int.get("craft_tier:ingot")) >= global.double.get("craft_count:ingot")) |
goto(99) ; ok | goto(99) ; ok | ||
− | bad: global.int.set("craft_require_tier", | + | bad: global.int.set("craft_require_tier", global.int.get("craft_tier:ingot")) |
− | global.double.set("craft_require_count", | + | global.double.set("craft_require_count", global.double.get("craft_count:ingot")) |
global.int.set("craft_status", 412) | global.int.set("craft_status", 412) | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|<syntaxhighlight lang="text"> | |<syntaxhighlight lang="text"> | ||
− | + | C2NyYWZ0IGluZ290AAAAAAAAAAAMAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BBJjcmFmdF92ZXJp | |
− | + | Znk6aW5nb3QIY29uc3RhbnQCAAAAAA5nZW5lcmljLmdvdG9pZghjb25zdGFudAJjAAAAD2NvbXBhcmlz | |
− | + | b24uYm9vbA9jb21wYXJpc29uLmJvb2wPY29tcGFyaXNvbi5ib29sDmNvbXBhcmlzb24uaW50Dmdsb2Jh | |
− | + | bC5pbnQuZ2V0CGNvbnN0YW50BBBjcmFmdF90aWVyOmluZ290CGNvbnN0YW50BAE8CGNvbnN0YW50AgEA | |
− | + | AAAIY29uc3RhbnQEAXwOY29tcGFyaXNvbi5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0 | |
− | + | X3RpZXI6aW5nb3QIY29uc3RhbnQEAT4IY29uc3RhbnQCCgAAAAhjb25zdGFudAQBfBFjb21wYXJpc29u | |
− | + | LmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQRY3JhZnRfY291bnQ6aW5nb3QIY29uc3Rh | |
− | + | bnQEAjw9CGNvbnN0YW50AwAAAAAAAAAACGNvbnN0YW50BAF8DmNvbXBhcmlzb24uaW50Dmdsb2JhbC5p | |
− | + | bnQuZ2V0CGNvbnN0YW50BAxjcmFmdF9zdGF0dXMIY29uc3RhbnQEAT4IY29uc3RhbnQCxwAAAA5nZW5l | |
− | + | cmljLmdvdG9pZghjb25zdGFudAJjAAAAEWNvbXBhcmlzb24uZG91YmxlEWdsb2JhbC5kb3VibGUuZ2V0 | |
− | + | CGNvbnN0YW50BBFjcmFmdF9jb3VudDppbmdvdAhjb25zdGFudAQCPD0TZmFjdG9yeS5pdGVtcy5jb3Vu | |
− | + | dAhjb25zdGFudAQFaW5nb3QOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QO | |
− | + | Z2VuZXJpYy5nb3RvaWYIY29uc3RhbnQCCgAAABFjb21wYXJpc29uLmRvdWJsZRFnbG9iYWwuZG91Ymxl | |
− | + | LmdldAhjb25zdGFudAQRY3JhZnRfY291bnQ6aW5nb3QIY29uc3RhbnQEAT4RYXJpdGhtZXRpYy5kb3Vi | |
− | + | bGURYXJpdGhtZXRpYy5kb3VibGUTZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQFaW5nb3QOZ2xv | |
− | + | YmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29uc3RhbnQEASsTZmFjdG9yeS5p | |
− | + | dGVtcy5jb3VudAhjb25zdGFudAQEZHVzdA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQQY3JhZnRfdGll | |
− | + | cjppbmdvdAhjb25zdGFudAQBLQhjb25zdGFudAMAAAAAAADwPw5nZW5lcmljLmdvdG9pZghjb25zdGFu | |
− | + | dAJjAAAADmNvbXBhcmlzb24uaW50Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBJjcmFmdF92ZXJpZnk6 | |
− | + | aW5nb3QIY29uc3RhbnQEAT4IY29uc3RhbnQCAAAAABFnZW5lcmljLndhaXR3aGlsZRZmYWN0b3J5Lm1h | |
− | + | Y2hpbmUuYWN0aXZlCGNvbnN0YW50BARvdmVuD2ZhY3RvcnkucHJvZHVjZQhjb25zdGFudAQEZHVzdA5n | |
− | + | bG9iYWwuaW50LmdldAhjb25zdGFudAQQY3JhZnRfdGllcjppbmdvdAtkb3VibGUuY2VpbBFhcml0aG1l | |
− | + | dGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQRY3JhZnRfY291bnQ6aW5nb3QIY29u | |
− | + | c3RhbnQEAS0TZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQFaW5nb3QOZ2xvYmFsLmludC5nZXQI | |
− | + | Y29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29uc3RhbnQEBG92ZW4RZ2VuZXJpYy53YWl0dW50aWwR | |
− | + | Y29tcGFyaXNvbi5kb3VibGUTZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQFaW5nb3QOZ2xvYmFs | |
− | + | LmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29uc3RhbnQEAj49EWdsb2JhbC5kb3Vi | |
− | + | bGUuZ2V0CGNvbnN0YW50BBFjcmFmdF9jb3VudDppbmdvdAxnZW5lcmljLmdvdG8IY29uc3RhbnQCYwAA | |
− | + | AA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQSY3JhZnRfcmVxdWlyZV90aWVyDmdsb2JhbC5pbnQuZ2V0 | |
− | + | CGNvbnN0YW50BBBjcmFmdF90aWVyOmluZ290EWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BBNjcmFm | |
− | + | dF9yZXF1aXJlX2NvdW50EWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBFjcmFmdF9jb3VudDppbmdv | |
− | + | dA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQMY3JhZnRfc3RhdHVzCGNvbnN0YW50ApwBAAA= | |
− | + | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Revision as of 07:29, 19 January 2021
A bunch of scripts to craft stuff.
Click to copy (tamperscript) |
---|
// ==UserScript==
// @name Click to copy on <pre> tags
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add click to copy buttons to <pre> tags
// @author Troy.Laurin@gmail.com
// @match https://www.perfecttower2.com/wiki/*
// @grant GM_addStyle
// @require https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js
// @require http://code.jquery.com/jquery-3.5.1.slim.min.js
// ==/UserScript==
(function() {
'use strict';
// ------------------------------------------
// CSS part injected in the page
GM_addStyle(" \
.precontainer { \
position: relative; \
} \
.copy-btn { \
background: #DDD; \
font-family: monospace; \
font-weight: bolder; \
margin: 0; \
opacity: 0; \
padding: 4px; \
position: absolute; \
right: 1px; \
top: 1px; \
cursor: pointer; \
-webkit-transition: opacity 0.3s ease-in-out; \
-o-transition: opacity 0.3s ease-in-out; \
transition: opacity 0.3s ease-in-out; \
} \
.precontainer:hover >.copy-btn { \
opacity: 1; \
} \
table { width: 100% } \
");
$('pre').wrap('<div class="precontainer"></div>');
$('pre').before($('<span class="copy-btn"></></span>'));
new ClipboardJS('.copy-btn', {
text: function(trigger) {
return $(trigger.nextElementSibling).text();
}
})
.on('success',function (e) {
$(e.trigger).html("<copied/>")
setTimeout(function() {
$(e.trigger).html("</>");
}, 3000);
})
.on('error',function (e) {
$(e.trigger).html("Error!")
setTimeout(function() {
$(e.trigger).html("</>");
}, 3000);
});
})();
|
IN DEVELOPMENT. USE AT YOUR OWN RISK.
General scripts
Script | Impulses | Conditions | Lines | Source | |||
---|---|---|---|---|---|---|---|
craft init |
|
9 |
| ||||
craft GO |
|
|
12 |
| |||
craft tier up |
|
|
1 |
| |||
craft mode up |
|
|
2 |
| |||
craft output up | 1 impulse
1 condition
2 actions |
|
2 |
| |||
craft count up | 1 impulse
1 condition
5 actions |
|
5 |
| |||
craft count down | 1 impulse
1 condition
5 actions |
|
5 |
| |||
craft inventory use |
|
|
1 |
| |||
craft script check | 3 |
| |||||
craft producer set (pg1) |
|
|
14 |
| |||
craft producer set (pg2) |
|
|
13 |
| |||
craft machine set |
|
|
4 |
| |||
craft ingot | 12 |
|
Parts scripts
Output | Part | Scripts | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | chips |
| |||||||||||||||||||||||||||
2 | plates |
| |||||||||||||||||||||||||||
3 | dense plates |
| |||||||||||||||||||||||||||
4 | blocks |
| |||||||||||||||||||||||||||
5 | cables |
| |||||||||||||||||||||||||||
6 | insulated cables |
| |||||||||||||||||||||||||||
7 | rods |
| |||||||||||||||||||||||||||
8 | motors |
| |||||||||||||||||||||||||||
9 | pumps |
|
Producer scripts
Machine scripts
Name | Lines | Code | |||
---|---|---|---|---|---|
x | x |
|