Difference between revisions of "User:Akerus"
Jump to navigation
Jump to search
(Updated count resources script) |
(Fix in dust_up_mixer) |
||
Line 529: | Line 529: | ||
| | | | ||
− | | | + | |10 |
| | | | ||
{| class="wikitable mw-collapsible mw-collapsed" | {| class="wikitable mw-collapsible mw-collapsed" | ||
Line 542: | Line 542: | ||
waitwhile(active("mixer")) | waitwhile(active("mixer")) | ||
mix_left = global.double.get("resources_needed_tier_" . i2s(dust_up_loop_tier + 1)) | mix_left = global.double.get("resources_needed_tier_" . i2s(dust_up_loop_tier + 1)) | ||
− | loop: gotoif( | + | loop: gotoif(finish, mix_left < 1.0) |
mix_now = min(mix_left, count("dust", dust_up_loop_tier + 1)) | mix_now = min(mix_left, count("dust", dust_up_loop_tier + 1)) | ||
craft("lump", dust_up_loop_tier, mix_now) | craft("lump", dust_up_loop_tier, mix_now) | ||
Line 548: | Line 548: | ||
mix_left = mix_left - mix_now | mix_left = mix_left - mix_now | ||
goto(loop) | goto(loop) | ||
+ | finish: waitwhile(active("mixer")) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|<syntaxhighlight lang="text"> | |<syntaxhighlight lang="text"> | ||
− | + | C2R1c3RfdXBfbWl4AAAAAAAAAAAKAAAADmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMAAAAOY29tcGFy | |
− | + | aXNvbi5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyCGNvbnN0YW50 | |
− | + | BAI+PQhjb25zdGFudAIKAAAAEWdlbmVyaWMud2FpdHdoaWxlFmZhY3RvcnkubWFjaGluZS5hY3RpdmUI | |
− | + | Y29uc3RhbnQEBW1peGVyEGxvY2FsLmRvdWJsZS5zZXQIY29uc3RhbnQECG1peF9sZWZ0EWdsb2JhbC5k | |
− | + | b3VibGUuZ2V0BmNvbmNhdAhjb25zdGFudAQWcmVzb3VyY2VzX25lZWRlZF90aWVyXwNpMnMOYXJpdGht | |
− | + | ZXRpYy5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyCGNvbnN0YW50 | |
− | + | BAErCGNvbnN0YW50AgEAAAAOZ2VuZXJpYy5nb3RvaWYIY29uc3RhbnQCCgAAABFjb21wYXJpc29uLmRv | |
− | + | dWJsZRBsb2NhbC5kb3VibGUuZ2V0CGNvbnN0YW50BAhtaXhfbGVmdAhjb25zdGFudAQBPAhjb25zdGFu | |
− | + | dAMAAAAAAADwPxBsb2NhbC5kb3VibGUuc2V0CGNvbnN0YW50BAdtaXhfbm93CmRvdWJsZS5taW4QbG9j | |
− | + | YWwuZG91YmxlLmdldAhjb25zdGFudAQIbWl4X2xlZnQTZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFu | |
− | + | dAQEZHVzdA5hcml0aG1ldGljLmludA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQRZHVzdF91cF9sb29w | |
− | + | X3RpZXIIY29uc3RhbnQEASsIY29uc3RhbnQCAQAAAA1mYWN0b3J5LmNyYWZ0CGNvbnN0YW50BARsdW1w | |
− | + | Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllchBsb2NhbC5kb3VibGUuZ2V0 | |
− | + | CGNvbnN0YW50BAdtaXhfbm93D2ZhY3RvcnkucHJvZHVjZQhjb25zdGFudAQEbHVtcA5nbG9iYWwuaW50 | |
− | + | LmdldAhjb25zdGFudAQRZHVzdF91cF9sb29wX3RpZXIQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQH | |
− | + | bWl4X25vdwhjb25zdGFudAQFbWl4ZXIQbG9jYWwuZG91YmxlLnNldAhjb25zdGFudAQIbWl4X2xlZnQR | |
− | + | YXJpdGhtZXRpYy5kb3VibGUQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQIbWl4X2xlZnQIY29uc3Rh | |
− | + | bnQEAS0QbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQHbWl4X25vdwxnZW5lcmljLmdvdG8IY29uc3Rh | |
− | + | bnQCBAAAABFnZW5lcmljLndhaXR3aGlsZRZmYWN0b3J5Lm1hY2hpbmUuYWN0aXZlCGNvbnN0YW50BAVt | |
+ | aXhlcg== | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Revision as of 12:56, 19 January 2021
A collection of helpful scripts This page structure (and the tamperscript) is copied directly from user Troylaurin https://www.perfecttower2.com/wiki/index.php?title=User:Troylaurin
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);
});
})();
|
Dust Up Scripts
Script | Impulses | Conditions | Lines | Source | |||
---|---|---|---|---|---|---|---|
dust_up |
|
|
15 |
| |||
dust_up_integrated | 13 |
| |||||
dust_count_resources | 10 |
| |||||
dust_calc_needed | 11 |
| |||||
dust_up_process_lump | 11 |
| |||||
dust_up_process_ore | 10 |
| |||||
dust_up_process_ingot | 10 |
| |||||
dust_up_mix | 10 |
| |||||
dust_up_finalize | 5 |
|
Examples of integrating the Dust Up scripts
Name | Impulses | Conditions | Lines | Code | |||
---|---|---|---|---|---|---|---|
Troylaurin's crafting scripts:
"craft ingot" as of 2021-01-19 |
13 |
|