Difference between revisions of "User:Akerus"
(Fix in finalize script) |
(Changed behaviour regarding waiting time for crusher) |
||
(One intermediate revision by the same user not shown) | |||
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== | ||
Line 118: | Line 122: | ||
| | | | ||
|<br /> | |<br /> | ||
− | | | + | |13 |
| | | | ||
{| class="wikitable mw-collapsible mw-collapsed" | {| class="wikitable mw-collapsible mw-collapsed" | ||
Line 139: | Line 143: | ||
executesync("dust_up_process_ore") | executesync("dust_up_process_ore") | ||
executesync("dust_up_process_ingot") | executesync("dust_up_process_ingot") | ||
− | mix: | + | mix: executesync("dust_up_mix") |
− | executesync("dust_up_mix") | ||
dust_up_loop_tier = dust_up_loop_tier + 1 | dust_up_loop_tier = dust_up_loop_tier + 1 | ||
gotoif(loop, dust_up_loop_tier < target_dust_tier) | gotoif(loop, dust_up_loop_tier < target_dust_tier) | ||
Line 147: | Line 150: | ||
|- | |- | ||
|<syntaxhighlight lang="text"> | |<syntaxhighlight lang="text"> | ||
− | + | EmR1c3RfdXBfaW50ZWdyYXRlZAAAAAAAAAAADQAAABNnZW5lcmljLmV4ZWN1dGVzeW5jCGNvbnN0YW50 | |
BBRkdXN0X2NvdW50X3Jlc291cmNlcxNnZW5lcmljLmV4ZWN1dGVzeW5jCGNvbnN0YW50BBBkdXN0X2Nh | BBRkdXN0X2NvdW50X3Jlc291cmNlcxNnZW5lcmljLmV4ZWN1dGVzeW5jCGNvbnN0YW50BBBkdXN0X2Nh | ||
bGNfbmVlZGVkDmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMAAAARY29tcGFyaXNvbi5kb3VibGURZ2xv | bGNfbmVlZGVkDmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMAAAARY29tcGFyaXNvbi5kb3VibGURZ2xv | ||
Line 163: | Line 166: | ||
BBRkdXN0X3VwX3Byb2Nlc3NfbHVtcBNnZW5lcmljLmV4ZWN1dGVzeW5jCGNvbnN0YW50BBNkdXN0X3Vw | BBRkdXN0X3VwX3Byb2Nlc3NfbHVtcBNnZW5lcmljLmV4ZWN1dGVzeW5jCGNvbnN0YW50BBNkdXN0X3Vw | ||
X3Byb2Nlc3Nfb3JlE2dlbmVyaWMuZXhlY3V0ZXN5bmMIY29uc3RhbnQEFWR1c3RfdXBfcHJvY2Vzc19p | X3Byb2Nlc3Nfb3JlE2dlbmVyaWMuZXhlY3V0ZXN5bmMIY29uc3RhbnQEFWR1c3RfdXBfcHJvY2Vzc19p | ||
− | + | bmdvdBNnZW5lcmljLmV4ZWN1dGVzeW5jCGNvbnN0YW50BAtkdXN0X3VwX21peA5nbG9iYWwuaW50LnNl | |
− | + | dAhjb25zdGFudAQRZHVzdF91cF9sb29wX3RpZXIOYXJpdGhtZXRpYy5pbnQOZ2xvYmFsLmludC5nZXQI | |
− | + | Y29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyCGNvbnN0YW50BAErCGNvbnN0YW50AgEAAAAOZ2VuZXJp | |
− | + | Yy5nb3RvaWYIY29uc3RhbnQCBQAAAA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50LmdldAhjb25zdGFu | |
− | + | dAQRZHVzdF91cF9sb29wX3RpZXIIY29uc3RhbnQEATwOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEHRh | |
− | + | cmdldF9kdXN0X3RpZXITZ2VuZXJpYy5leGVjdXRlc3luYwhjb25zdGFudAQQZHVzdF91cF9maW5hbGl6 | |
− | + | ZQ== | |
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Line 361: | Line 363: | ||
| | | | ||
− | | | + | |13 |
| | | | ||
{| class="wikitable mw-collapsible mw-collapsed" | {| class="wikitable mw-collapsible mw-collapsed" | ||
Line 367: | Line 369: | ||
|- | |- | ||
|<syntaxhighlight lang="actionscript"> | |<syntaxhighlight lang="actionscript"> | ||
+ | ; Process lumps into dust | ||
:global int dust_up_loop_tier | :global int dust_up_loop_tier | ||
:global double dust_up_missing | :global double dust_up_missing | ||
Line 375: | Line 378: | ||
number_lumps = count("lump",dust_up_loop_tier - 1) | number_lumps = count("lump",dust_up_loop_tier - 1) | ||
gotoif(processpartially, number_lumps * 2.0 > dust_up_missing) | gotoif(processpartially, number_lumps * 2.0 > dust_up_missing) | ||
+ | gotoif(99, number_lumps < 1.0) | ||
waitwhile(active("mixer")) | waitwhile(active("mixer")) | ||
processall: produce("lump", dust_up_loop_tier - 1, number_lumps, "mixer") | processall: produce("lump", dust_up_loop_tier - 1, number_lumps, "mixer") | ||
dust_up_missing = dust_up_missing - (number_lumps * 2.0) | dust_up_missing = dust_up_missing - (number_lumps * 2.0) | ||
− | goto( | + | goto(end) |
processpartially: number_lump_used = ceil(dust_up_missing / 2.0) | processpartially: number_lump_used = ceil(dust_up_missing / 2.0) | ||
waitwhile(active("mixer")) | waitwhile(active("mixer")) | ||
produce("lump", dust_up_loop_tier - 1, number_lump_used, "mixer") | produce("lump", dust_up_loop_tier - 1, number_lump_used, "mixer") | ||
dust_up_missing = 0.0 | dust_up_missing = 0.0 | ||
+ | end: waitwhile(active("mixer")) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|<syntaxhighlight lang="text"> | |<syntaxhighlight lang="text"> | ||
− | + | FGR1c3RfdXBfcHJvY2Vzc19sdW1wAAAAAAAAAAANAAAADmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMA | |
− | + | AAAOY29tcGFyaXNvbi5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVy | |
− | + | CGNvbnN0YW50BAI9PQhjb25zdGFudAIBAAAAEGxvY2FsLmRvdWJsZS5zZXQIY29uc3RhbnQEDG51bWJl | |
− | + | cl9sdW1wcxNmYWN0b3J5Lml0ZW1zLmNvdW50CGNvbnN0YW50BARsdW1wDmFyaXRobWV0aWMuaW50Dmds | |
− | + | b2JhbC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllcghjb25zdGFudAQBLQhjb25zdGFu | |
− | + | dAIBAAAADmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AgkAAAARY29tcGFyaXNvbi5kb3VibGURYXJpdGht | |
− | + | ZXRpYy5kb3VibGUQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQMbnVtYmVyX2x1bXBzCGNvbnN0YW50 | |
− | + | BAEqCGNvbnN0YW50AwAAAAAAAABACGNvbnN0YW50BAE+EWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50 | |
− | + | BA9kdXN0X3VwX21pc3NpbmcOZ2VuZXJpYy5nb3RvaWYIY29uc3RhbnQCYwAAABFjb21wYXJpc29uLmRv | |
− | + | dWJsZRBsb2NhbC5kb3VibGUuZ2V0CGNvbnN0YW50BAxudW1iZXJfbHVtcHMIY29uc3RhbnQEATwIY29u | |
− | + | c3RhbnQDAAAAAAAA8D8RZ2VuZXJpYy53YWl0d2hpbGUWZmFjdG9yeS5tYWNoaW5lLmFjdGl2ZQhjb25z | |
− | + | dGFudAQFbWl4ZXIPZmFjdG9yeS5wcm9kdWNlCGNvbnN0YW50BARsdW1wDmFyaXRobWV0aWMuaW50Dmds | |
− | + | b2JhbC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllcghjb25zdGFudAQBLQhjb25zdGFu | |
− | + | dAIBAAAAEGxvY2FsLmRvdWJsZS5nZXQIY29uc3RhbnQEDG51bWJlcl9sdW1wcwhjb25zdGFudAQFbWl4 | |
− | + | ZXIRZ2xvYmFsLmRvdWJsZS5zZXQIY29uc3RhbnQED2R1c3RfdXBfbWlzc2luZxFhcml0aG1ldGljLmRv | |
− | + | dWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQPZHVzdF91cF9taXNzaW5nCGNvbnN0YW50BAEt | |
− | + | EWFyaXRobWV0aWMuZG91YmxlEGxvY2FsLmRvdWJsZS5nZXQIY29uc3RhbnQEDG51bWJlcl9sdW1wcwhj | |
− | + | b25zdGFudAQBKghjb25zdGFudAMAAAAAAAAAQAxnZW5lcmljLmdvdG8IY29uc3RhbnQCDQAAABBsb2Nh | |
− | + | bC5kb3VibGUuc2V0CGNvbnN0YW50BBBudW1iZXJfbHVtcF91c2VkC2RvdWJsZS5jZWlsEWFyaXRobWV0 | |
− | + | aWMuZG91YmxlEWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcIY29uc3Rh | |
− | + | bnQEAS8IY29uc3RhbnQDAAAAAAAAAEARZ2VuZXJpYy53YWl0d2hpbGUWZmFjdG9yeS5tYWNoaW5lLmFj | |
− | + | dGl2ZQhjb25zdGFudAQFbWl4ZXIPZmFjdG9yeS5wcm9kdWNlCGNvbnN0YW50BARsdW1wDmFyaXRobWV0 | |
− | + | aWMuaW50Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllcghjb25zdGFudAQB | |
− | + | LQhjb25zdGFudAIBAAAAEGxvY2FsLmRvdWJsZS5nZXQIY29uc3RhbnQEEG51bWJlcl9sdW1wX3VzZWQI | |
+ | Y29uc3RhbnQEBW1peGVyEWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcI | ||
+ | Y29uc3RhbnQDAAAAAAAAAAARZ2VuZXJpYy53YWl0d2hpbGUWZmFjdG9yeS5tYWNoaW5lLmFjdGl2ZQhj | ||
+ | b25zdGFudAQFbWl4ZXI= | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Line 416: | Line 424: | ||
| | | | ||
| | | | ||
− | | | + | |12 |
| | | | ||
{| class="wikitable mw-collapsible mw-collapsed" | {| class="wikitable mw-collapsible mw-collapsed" | ||
Line 422: | Line 430: | ||
|- | |- | ||
|<syntaxhighlight lang="actionscript"> | |<syntaxhighlight lang="actionscript"> | ||
+ | ; Process ore into dust | ||
:global int dust_up_loop_tier | :global int dust_up_loop_tier | ||
:global double dust_up_missing | :global double dust_up_missing | ||
Line 429: | Line 438: | ||
number_ore = count("ore",dust_up_loop_tier) | number_ore = count("ore",dust_up_loop_tier) | ||
gotoif(processpartially, number_ore > dust_up_missing) | gotoif(processpartially, number_ore > dust_up_missing) | ||
+ | gotoif(99, number_ore < 1.0) | ||
waitwhile(active("crusher")) | waitwhile(active("crusher")) | ||
processall: produce("ore", dust_up_loop_tier, number_ore, "crusher") | processall: produce("ore", dust_up_loop_tier, number_ore, "crusher") | ||
dust_up_missing = dust_up_missing - number_ore | dust_up_missing = dust_up_missing - number_ore | ||
− | goto( | + | goto(end) |
processpartially: number_ore_used = dust_up_missing | processpartially: number_ore_used = dust_up_missing | ||
waitwhile(active("crusher")) | waitwhile(active("crusher")) | ||
produce("ore", dust_up_loop_tier, number_ore_used, "crusher") | produce("ore", dust_up_loop_tier, number_ore_used, "crusher") | ||
dust_up_missing = 0.0 | dust_up_missing = 0.0 | ||
+ | end: waitwhile(active("crusher")) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|<syntaxhighlight lang="text"> | |<syntaxhighlight lang="text"> | ||
− | + | E2R1c3RfdXBfcHJvY2Vzc19vcmUAAAAAAAAAAAwAAAAQbG9jYWwuZG91YmxlLnNldAhjb25zdGFudAQK | |
− | + | bnVtYmVyX29yZRNmYWN0b3J5Lml0ZW1zLmNvdW50CGNvbnN0YW50BANvcmUOZ2xvYmFsLmludC5nZXQI | |
− | + | Y29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyDmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AggAAAARY29t | |
− | + | cGFyaXNvbi5kb3VibGUQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQKbnVtYmVyX29yZQhjb25zdGFu | |
− | + | dAQBPhFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQPZHVzdF91cF9taXNzaW5nDmdlbmVyaWMuZ290 | |
− | + | b2lmCGNvbnN0YW50AmMAAAARY29tcGFyaXNvbi5kb3VibGUQbG9jYWwuZG91YmxlLmdldAhjb25zdGFu | |
− | + | dAQKbnVtYmVyX29yZQhjb25zdGFudAQBPAhjb25zdGFudAMAAAAAAADwPxFnZW5lcmljLndhaXR3aGls | |
− | + | ZRZmYWN0b3J5Lm1hY2hpbmUuYWN0aXZlCGNvbnN0YW50BAdjcnVzaGVyD2ZhY3RvcnkucHJvZHVjZQhj | |
− | + | b25zdGFudAQDb3JlDmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllchBsb2Nh | |
− | + | bC5kb3VibGUuZ2V0CGNvbnN0YW50BApudW1iZXJfb3JlCGNvbnN0YW50BAdjcnVzaGVyEWdsb2JhbC5k | |
− | + | b3VibGUuc2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcRYXJpdGhtZXRpYy5kb3VibGURZ2xvYmFs | |
− | + | LmRvdWJsZS5nZXQIY29uc3RhbnQED2R1c3RfdXBfbWlzc2luZwhjb25zdGFudAQBLRBsb2NhbC5kb3Vi | |
− | + | bGUuZ2V0CGNvbnN0YW50BApudW1iZXJfb3JlDGdlbmVyaWMuZ290bwhjb25zdGFudAIMAAAAEGxvY2Fs | |
− | + | LmRvdWJsZS5zZXQIY29uc3RhbnQED251bWJlcl9vcmVfdXNlZBFnbG9iYWwuZG91YmxlLmdldAhjb25z | |
− | + | dGFudAQPZHVzdF91cF9taXNzaW5nEWdlbmVyaWMud2FpdHdoaWxlFmZhY3RvcnkubWFjaGluZS5hY3Rp | |
− | + | dmUIY29uc3RhbnQEB2NydXNoZXIPZmFjdG9yeS5wcm9kdWNlCGNvbnN0YW50BANvcmUOZ2xvYmFsLmlu | |
− | + | dC5nZXQIY29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyEGxvY2FsLmRvdWJsZS5nZXQIY29uc3RhbnQE | |
+ | D251bWJlcl9vcmVfdXNlZAhjb25zdGFudAQHY3J1c2hlchFnbG9iYWwuZG91YmxlLnNldAhjb25zdGFu | ||
+ | dAQPZHVzdF91cF9taXNzaW5nCGNvbnN0YW50AwAAAAAAAAAAEWdlbmVyaWMud2FpdHdoaWxlFmZhY3Rv | ||
+ | cnkubWFjaGluZS5hY3RpdmUIY29uc3RhbnQEB2NydXNoZXI= | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Line 463: | Line 477: | ||
| | | | ||
| | | | ||
− | | | + | |13 |
| | | | ||
{| class="wikitable mw-collapsible mw-collapsed" | {| class="wikitable mw-collapsible mw-collapsed" | ||
Line 479: | Line 493: | ||
number_ingot = count("ingot",dust_up_loop_tier) | number_ingot = count("ingot",dust_up_loop_tier) | ||
gotoif(processpartially, number_ingot > dust_up_missing) | gotoif(processpartially, number_ingot > dust_up_missing) | ||
+ | gotoif(99, number_ingot < 1.0) | ||
waitwhile(active("crusher")) | waitwhile(active("crusher")) | ||
processall: produce("ingot", dust_up_loop_tier, number_ingot, "crusher") | processall: produce("ingot", dust_up_loop_tier, number_ingot, "crusher") | ||
dust_up_missing = dust_up_missing - number_ingot | dust_up_missing = dust_up_missing - number_ingot | ||
− | goto( | + | goto(end) |
processpartially: number_ingot_used = dust_up_missing | processpartially: number_ingot_used = dust_up_missing | ||
waitwhile(active("crusher")) | waitwhile(active("crusher")) | ||
produce("ingot", dust_up_loop_tier, number_ingot_used, "crusher") | produce("ingot", dust_up_loop_tier, number_ingot_used, "crusher") | ||
dust_up_missing = 0.0 | dust_up_missing = 0.0 | ||
+ | end: waitwhile(active("crusher")) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
|<syntaxhighlight lang="text"> | |<syntaxhighlight lang="text"> | ||
− | + | FWR1c3RfdXBfcHJvY2Vzc19pbmdvdAAAAAAAAAAADQAAAA5nZW5lcmljLmdvdG9pZghjb25zdGFudAJj | |
AAAAEWNvbXBhcmlzb24uZG91YmxlEWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBJkdXN0X3VwX3Vz | AAAAEWNvbXBhcmlzb24uZG91YmxlEWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBJkdXN0X3VwX3Vz | ||
ZV9pbmdvdHMIY29uc3RhbnQEATwIY29uc3RhbnQDAAAAAAAA8D8QbG9jYWwuZG91YmxlLnNldAhjb25z | ZV9pbmdvdHMIY29uc3RhbnQEATwIY29uc3RhbnQDAAAAAAAA8D8QbG9jYWwuZG91YmxlLnNldAhjb25z | ||
dGFudAQMbnVtYmVyX2luZ290E2ZhY3RvcnkuaXRlbXMuY291bnQIY29uc3RhbnQEBWluZ290Dmdsb2Jh | dGFudAQMbnVtYmVyX2luZ290E2ZhY3RvcnkuaXRlbXMuY291bnQIY29uc3RhbnQEBWluZ290Dmdsb2Jh | ||
bC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllcg5nZW5lcmljLmdvdG9pZghjb25zdGFu | bC5pbnQuZ2V0CGNvbnN0YW50BBFkdXN0X3VwX2xvb3BfdGllcg5nZW5lcmljLmdvdG9pZghjb25zdGFu | ||
− | + | dAIJAAAAEWNvbXBhcmlzb24uZG91YmxlEGxvY2FsLmRvdWJsZS5nZXQIY29uc3RhbnQEDG51bWJlcl9p | |
bmdvdAhjb25zdGFudAQBPhFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQPZHVzdF91cF9taXNzaW5n | bmdvdAhjb25zdGFudAQBPhFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQPZHVzdF91cF9taXNzaW5n | ||
− | + | DmdlbmVyaWMuZ290b2lmCGNvbnN0YW50AmMAAAARY29tcGFyaXNvbi5kb3VibGUQbG9jYWwuZG91Ymxl | |
− | + | LmdldAhjb25zdGFudAQMbnVtYmVyX2luZ290CGNvbnN0YW50BAE8CGNvbnN0YW50AwAAAAAAAPA/EWdl | |
− | + | bmVyaWMud2FpdHdoaWxlFmZhY3RvcnkubWFjaGluZS5hY3RpdmUIY29uc3RhbnQEB2NydXNoZXIPZmFj | |
− | + | dG9yeS5wcm9kdWNlCGNvbnN0YW50BAVpbmdvdA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQRZHVzdF91 | |
− | + | cF9sb29wX3RpZXIQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQMbnVtYmVyX2luZ290CGNvbnN0YW50 | |
− | + | BAdjcnVzaGVyEWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcRYXJpdGht | |
− | + | ZXRpYy5kb3VibGURZ2xvYmFsLmRvdWJsZS5nZXQIY29uc3RhbnQED2R1c3RfdXBfbWlzc2luZwhjb25z | |
− | + | dGFudAQBLRBsb2NhbC5kb3VibGUuZ2V0CGNvbnN0YW50BAxudW1iZXJfaW5nb3QMZ2VuZXJpYy5nb3Rv | |
− | + | CGNvbnN0YW50Ag0AAAAQbG9jYWwuZG91YmxlLnNldAhjb25zdGFudAQRbnVtYmVyX2luZ290X3VzZWQR | |
− | + | Z2xvYmFsLmRvdWJsZS5nZXQIY29uc3RhbnQED2R1c3RfdXBfbWlzc2luZxFnZW5lcmljLndhaXR3aGls | |
− | + | ZRZmYWN0b3J5Lm1hY2hpbmUuYWN0aXZlCGNvbnN0YW50BAdjcnVzaGVyD2ZhY3RvcnkucHJvZHVjZQhj | |
− | + | b25zdGFudAQFaW5nb3QOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEWR1c3RfdXBfbG9vcF90aWVyEGxv | |
− | + | Y2FsLmRvdWJsZS5nZXQIY29uc3RhbnQEEW51bWJlcl9pbmdvdF91c2VkCGNvbnN0YW50BAdjcnVzaGVy | |
+ | EWdsb2JhbC5kb3VibGUuc2V0CGNvbnN0YW50BA9kdXN0X3VwX21pc3NpbmcIY29uc3RhbnQDAAAAAAAA | ||
+ | AAARZ2VuZXJpYy53YWl0d2hpbGUWZmFjdG9yeS5tYWNoaW5lLmFjdGl2ZQhjb25zdGFudAQHY3J1c2hl | ||
+ | cg== | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Latest revision as of 10:03, 25 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 | 13 |
| |||||
dust_count_resources | 10 |
| |||||
dust_calc_needed | 11 |
| |||||
dust_up_process_lump | 13 |
| |||||
dust_up_process_ore | 12 |
| |||||
dust_up_process_ingot | 13 |
| |||||
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 |
|