Difference between revisions of "User:Akerus"
Jump to navigation
Jump to search
(Fix of dust_up_conserve_ingots) |
(Fix in finalize script) |
||
Line 572: | Line 572: | ||
|- | |- | ||
|<syntaxhighlight lang="actionscript"> | |<syntaxhighlight lang="actionscript"> | ||
− | |||
:global int target_dust_tier | :global int target_dust_tier | ||
:global double target_dust_count | :global double target_dust_count | ||
Line 580: | Line 579: | ||
gotoif(99, dust_up_loop_tier != target_dust_tier) | gotoif(99, dust_up_loop_tier != target_dust_tier) | ||
− | dust_up_missing = max(0.0, | + | dust_up_missing = max(0.0, target_dust_count - count("dust", dust_up_loop_tier) - (count("ingot", dust_up_loop_tier) * dust_up_use_ingots)) |
gotoif(99, dust_up_missing < 1.0) | gotoif(99, dust_up_missing < 1.0) | ||
executesync("dust_up_process_lump") | executesync("dust_up_process_lump") | ||
Line 591: | Line 590: | ||
c3RhbnQEAiE9Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBB0YXJnZXRfZHVzdF90aWVyEWdsb2JhbC5k | c3RhbnQEAiE9Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBB0YXJnZXRfZHVzdF90aWVyEWdsb2JhbC5k | ||
b3VibGUuc2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcKZG91YmxlLm1heAhjb25zdGFudAMAAAAA | b3VibGUuc2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcKZG91YmxlLm1heAhjb25zdGFudAMAAAAA | ||
− | + | AAAAABFhcml0aG1ldGljLmRvdWJsZRFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhj | |
− | + | b25zdGFudAQRdGFyZ2V0X2R1c3RfY291bnQIY29uc3RhbnQEAS0TZmFjdG9yeS5pdGVtcy5jb3VudAhj | |
− | + | b25zdGFudAQEZHVzdA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQRZHVzdF91cF9sb29wX3RpZXIIY29u | |
− | + | c3RhbnQEAS0RYXJpdGhtZXRpYy5kb3VibGUTZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQFaW5n | |
− | + | b3QOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyCGNvbnN0YW50BAEqEWds | |
− | + | b2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBJkdXN0X3VwX3VzZV9pbmdvdHMOZ2VuZXJpYy5nb3RvaWYI | |
− | + | Y29uc3RhbnQCYwAAABFjb21wYXJpc29uLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQP | |
− | + | ZHVzdF91cF9taXNzaW5nCGNvbnN0YW50BAE8CGNvbnN0YW50AwAAAAAAAPA/E2dlbmVyaWMuZXhlY3V0 | |
− | + | ZXN5bmMIY29uc3RhbnQEFGR1c3RfdXBfcHJvY2Vzc19sdW1wE2dlbmVyaWMuZXhlY3V0ZXN5bmMIY29u | |
− | + | c3RhbnQEE2R1c3RfdXBfcHJvY2Vzc19vcmU= | |
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Revision as of 08:23, 20 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 |
|
|
4 |
| |||
dust_up_integrated | 14 |
| |||||
dust_count_resources | 10 |
| |||||
dust_calc_needed | 11 |
| |||||
dust_up_process_lump | 11 |
| |||||
dust_up_process_ore | 10 |
| |||||
dust_up_process_ingot | 11 |
| |||||
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 |
14 |
|