Difference between revisions of "User:Akerus"
(Fix in finalize script) |
(Added a summary) |
||
Line 72: | Line 72: | ||
|} | |} | ||
+ | == Summary == | ||
+ | These scripts will upgrade your dusts to your specified tier and number of that tier. It will process ores, lums and (if set so) ingots. It will make sure that you've got enough resources to even reach your goal and will leave you with at least 1 resource of each tier, so that you never run out of a tier. | ||
+ | |||
+ | To use it, you have to set the global variables "target_dust_tier", "target_dust_count" and "dust_up_use_ingots" to your need. Either you set it in the "dust_up" script, tu run it manually or you set those values in one of your scripts and execute "dust_up_integrated". | ||
==Dust Up Scripts== | ==Dust Up Scripts== |
Revision as of 10:11, 22 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);
});
})();
|
Summary
These scripts will upgrade your dusts to your specified tier and number of that tier. It will process ores, lums and (if set so) ingots. It will make sure that you've got enough resources to even reach your goal and will leave you with at least 1 resource of each tier, so that you never run out of a tier.
To use it, you have to set the global variables "target_dust_tier", "target_dust_count" and "dust_up_use_ingots" to your need. Either you set it in the "dust_up" script, tu run it manually or you set those values in one of your scripts and execute "dust_up_integrated".
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 |
|