Difference between revisions of "User:Akerus"
Jump to navigation
Jump to search
(Initialization finished) |
(Added integration example) |
||
Line 85: | Line 85: | ||
*key 1 | *key 1 | ||
| | | | ||
− | * | + | *factory screen open |
|15 | |15 | ||
| | | | ||
Line 148: | Line 148: | ||
|} | |} | ||
|- | |- | ||
− | |dust_up_integrated | + | |dust_up_integrated |
| | | | ||
|<br /> | |<br /> | ||
Line 205: | Line 205: | ||
|} | |} | ||
|- | |- | ||
− | |dust_count_resources | + | |dust_count_resources |
| | | | ||
− | |||
| | | | ||
|10 | |10 | ||
Line 325: | Line 324: | ||
|} | |} | ||
|- | |- | ||
− | |dust_calc_needed | + | |dust_calc_needed |
| | | | ||
| | | | ||
Line 381: | Line 380: | ||
|} | |} | ||
|- | |- | ||
− | |dust_up_process_lump | + | |dust_up_process_lump |
| | | | ||
Line 537: | Line 536: | ||
− | |||
| | | | ||
|9 | |9 | ||
Line 621: | Line 619: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
− | |}<br /> | + | |} |
+ | |||
+ | === Examples of integrating the Dust Up scripts === | ||
+ | <br /> | ||
+ | {| class="wikitable" | ||
+ | !Name | ||
+ | !Impulses | ||
+ | !Conditions | ||
+ | !Lines | ||
+ | !Code | ||
+ | |- | ||
+ | |Troylaurin's crafting scripts: | ||
+ | "craft ingot" | ||
+ | |||
+ | as of 2021-01-19 | ||
+ | | | ||
+ | | | ||
+ | |13 | ||
+ | | | ||
+ | {| class="wikitable mw-collapsible mw-collapsed" | ||
+ | ! | ||
+ | |- | ||
+ | |<syntaxhighlight lang="actionscript"> | ||
+ | :global double craft_require_count | ||
+ | :global int craft_require_tier | ||
+ | :global int craft_status | ||
+ | :global double resources_needed_tier_1 | ||
+ | :global int target_dust_tier | ||
+ | :global double target_dust_count | ||
+ | |||
+ | gotoif(99, (((global.int.get("craft_tier:ingot") < 1) | (global.int.get("craft_tier:ingot") > 10)) | (global.double.get("craft_count:ingot") <= 0.0)) | (craft_status > 199)) | ||
+ | |||
+ | gotoif(99, global.double.get("craft_count:ingot") <= count("ingot", global.int.get("craft_tier:ingot"))) | ||
+ | |||
+ | target_dust_tier = global.int.get("craft_tier:ingot") | ||
+ | target_dust_count = max(0.0, global.double.get("craft_count:ingot") - ((count("ingot", global.int.get("craft_tier:ingot")) + count("dust", global.int.get("craft_tier:ingot"))) - 1.0)) | ||
+ | executesync("dust_up_integrated") | ||
+ | gotoif(bad, resources_needed_tier_1 > 0.0) | ||
+ | |||
+ | waitwhile(active("oven")) | ||
+ | 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", global.int.get("craft_tier:ingot")) >= global.double.get("craft_count:ingot")) | ||
+ | goto(99) | ||
+ | bad: craft_require_tier = global.int.get("craft_tier:ingot") | ||
+ | craft_require_count = global.double.get("craft_count:ingot") | ||
+ | craft_status = 412 | ||
+ | </syntaxhighlight> | ||
+ | |- | ||
+ | |<syntaxhighlight lang="text"> | ||
+ | C2NyYWZ0IGluZ290AAAAAAAAAAANAAAADmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMAAAAPY29tcGF | ||
+ | yaXNvbi5ib29sD2NvbXBhcmlzb24uYm9vbA9jb21wYXJpc29uLmJvb2wOY29tcGFyaXNvbi5pbnQOZ2 | ||
+ | xvYmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29uc3RhbnQEATwIY29uc3Rhb | ||
+ | nQCAQAAAAhjb25zdGFudAQBfA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQQ | ||
+ | Y3JhZnRfdGllcjppbmdvdAhjb25zdGFudAQBPghjb25zdGFudAIKAAAACGNvbnN0YW50BAF8EWNvbXB | ||
+ | hcmlzb24uZG91YmxlEWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBFjcmFmdF9jb3VudDppbmdvdA | ||
+ | hjb25zdGFudAQCPD0IY29uc3RhbnQDAAAAAAAAAAAIY29uc3RhbnQEAXwOY29tcGFyaXNvbi5pbnQOZ | ||
+ | 2xvYmFsLmludC5nZXQIY29uc3RhbnQEDGNyYWZ0X3N0YXR1cwhjb25zdGFudAQBPghjb25zdGFudALH | ||
+ | AAAADmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMAAAARY29tcGFyaXNvbi5kb3VibGURZ2xvYmFsLmR | ||
+ | vdWJsZS5nZXQIY29uc3RhbnQEEWNyYWZ0X2NvdW50OmluZ290CGNvbnN0YW50BAI8PRNmYWN0b3J5Lm | ||
+ | l0ZW1zLmNvdW50CGNvbnN0YW50BAVpbmdvdA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQQY3JhZnRfd | ||
+ | GllcjppbmdvdA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQQdGFyZ2V0X2R1c3RfdGllcg5nbG9iYWwu | ||
+ | aW50LmdldAhjb25zdGFudAQQY3JhZnRfdGllcjppbmdvdBFnbG9iYWwuZG91YmxlLnNldAhjb25zdGF | ||
+ | udAQRdGFyZ2V0X2R1c3RfY291bnQKZG91YmxlLm1heAhjb25zdGFudAMAAAAAAAAAABFhcml0aG1ldG | ||
+ | ljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQRY3JhZnRfY291bnQ6aW5nb3QIY29uc | ||
+ | 3RhbnQEAS0RYXJpdGhtZXRpYy5kb3VibGURYXJpdGhtZXRpYy5kb3VibGUTZmFjdG9yeS5pdGVtcy5j | ||
+ | b3VudAhjb25zdGFudAQFaW5nb3QOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5 | ||
+ | nb3QIY29uc3RhbnQEASsTZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQEZHVzdA5nbG9iYWwuaW | ||
+ | 50LmdldAhjb25zdGFudAQQY3JhZnRfdGllcjppbmdvdAhjb25zdGFudAQBLQhjb25zdGFudAM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lcXVpcmVfdGllcg5nbG9iYWwuaW50LmdldAhjb25zdGFudAQQY3JhZnRfdGll | ||
+ | cjppbmdvdBFnbG9iYWwuZG91YmxlLnNldAhjb25zdGFudAQTY3JhZnRfcmVxdWlyZV9jb3VudBFnbG9 | ||
+ | iYWwuZG91YmxlLmdldAhjb25zdGFudAQRY3JhZnRfY291bnQ6aW5nb3QOZ2xvYmFsLmludC5zZXQIY2 | ||
+ | 9uc3RhbnQEDGNyYWZ0X3N0YXR1cwhjb25zdGFudAKcAQAA | ||
+ | </syntaxhighlight> | ||
+ | |} | ||
+ | |} |
Revision as of 08:47, 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 |
|
9 |
| ||||
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 |
|