Difference between revisions of "User:Troylaurin"

From The Perfect Tower II
Jump to navigation Jump to search
(sprite table)
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
Just testing something, nothing much to see here
+
I like scripting!
<br />
+
 
{| class="wikitable"
+
{| class="wikitable mw-collapsible mw-collapsed"
|+
+
!Click to copy (tamperscript)
!Script
 
!Info
 
!Source
 
 
|-
 
|-
|craft init
+
|<syntaxhighlight lang="javascript">
|1 impulse
+
// ==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==
  
* on wake
+
(function() {
 +
    'use strict';
  
0 conditions
+
    // ------------------------------------------
 +
    // 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% } \
 +
");
  
9 actions
+
    $('pre').wrap('<div class="precontainer"></div>');
|
+
    $('pre').before($('<span class="copy-btn">&lt;/&gt;</span>'));
{| class="wikitable mw-collapsible mw-collapsed"
+
 
!
+
    new ClipboardJS('.copy-btn', {
|-
+
        text: function(trigger) {
|<syntaxhighlight lang="actionscript">
+
            return $(trigger.nextElementSibling).text();
wakeup()
+
        }
 +
    })
 +
        .on('success',function (e) {
 +
        $(e.trigger).html("&lt;copied/&gt;")
 +
        setTimeout(function() {
 +
            $(e.trigger).html("&lt;/&gt;");
 +
        }, 3000);
 +
    })
 +
        .on('error',function (e) {
 +
        $(e.trigger).html("Error!")
 +
        setTimeout(function() {
 +
            $(e.trigger).html("&lt;/&gt;");
 +
        }, 3000);
 +
    });
 +
})();
  
global.int.set("craft_busy", 0)
 
global.int.set("craft_status", 200)
 
global.int.set("craft_require_tier", 0)
 
global.double.set("craft_require_count", 0.0)
 
global.int.set("craft_tier", 1)
 
global.int.set("craft_mode", 1)
 
global.int.set("craft_output", 1)
 
global.double.set("craft_count", 1.0)
 
global.double.set("craft_inventory", 1.0)
 
</syntaxhighlight>
 
|-
 
|<syntaxhighlight lang="text">
 
CmNyYWZ0IGluaXQBAAAABndha2V1cAAAAAAJAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BApjcmFm
 
dF9idXN5CGNvbnN0YW50AgAAAAAOZ2xvYmFsLmludC5zZXQIY29uc3RhbnQEDGNyYWZ0X3N0YXR1cwhj
 
b25zdGFudALIAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BBJjcmFmdF9yZXF1aXJlX3RpZXIIY29u
 
c3RhbnQCAAAAABFnbG9iYWwuZG91YmxlLnNldAhjb25zdGFudAQTY3JhZnRfcmVxdWlyZV9jb3VudAhj
 
b25zdGFudAMAAAAAAAAAAA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQKY3JhZnRfdGllcghjb25zdGFu
 
dAIBAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BApjcmFmdF9tb2RlCGNvbnN0YW50AgEAAAAOZ2xv
 
YmFsLmludC5zZXQIY29uc3RhbnQEDGNyYWZ0X291dHB1dAhjb25zdGFudAIBAAAAEWdsb2JhbC5kb3Vi
 
bGUuc2V0CGNvbnN0YW50BAtjcmFmdF9jb3VudAhjb25zdGFudAMAAAAAAADwPxFnbG9iYWwuZG91Ymxl
 
LnNldAhjb25zdGFudAQPY3JhZnRfaW52ZW50b3J5CGNvbnN0YW50AwAAAAAAAPA/
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 
|}
 
|}
|-
 
|craft tier up
 
|1 impulse
 
  
* key 1
+
Factory scripts: https://www.perfecttower2.com/wiki/AI_Craftapalooza
 +
 
  
1 condition
 
  
1 action
+
<br />
 +
{| class="wikitable"
 +
|+Fun sprites
 +
!'''#'''
 +
!
 +
!
 +
!'''#'''
 +
!
 +
!
 +
!
 +
!
 +
!
 +
!'''#'''
 +
!
 +
!
 +
!'''#'''
 +
!
 +
!
 +
!'''#'''
 +
!
 +
|-
 +
|'''1'''
 +
|gems
 +
|
 +
|'''21'''
 +
|''white pyramid''
 +
|
 +
|'''41'''
 +
|
 +
|
 +
|'''61'''
 +
|''memory outline''
 +
|
 +
|'''81'''
 +
|star
 +
|
 +
|'''101'''
 +
|''grey module''
 +
|-
 +
|'''2'''
 +
|hypercube
 +
|
 +
|'''22'''
 +
|''tree logo''
 +
|
 +
|'''42'''
 +
|
 +
|
 +
|'''62'''
 +
|''memory''
 +
|
 +
|
 +
|
 +
|
 +
|'''102'''
 +
|''right click''
 +
|-
 +
|'''3'''
 +
|cogs
 +
|
 +
|'''23'''
 +
|white infinity
 +
|
 +
|'''43'''
 +
|white pencil
 +
|
 +
|'''63'''
 +
|''cpu outline''
 +
|
 +
|
 +
|
 +
|
 +
|'''103'''
 +
|''world''
 +
|-
 +
|'''4'''
 +
|white xp
 +
|
 +
|'''24'''
 +
|hourglass
 +
|
 +
|'''44'''
 +
|''space bar''
 +
|
 +
|'''64'''
 +
|''cpu''
 +
|
 +
|
 +
|
 +
|
 +
|'''104'''
 +
|''white warning''
 +
|-
 +
|'''5'''
 +
|exotic gems
 +
|
 +
|'''25'''
 +
|unlock
 +
|
 +
|'''45'''
 +
|''white 6-pt star''
 +
|
 +
|'''65'''
 +
|''server''
 +
|
 +
|
 +
|
 +
|
 +
|'''105'''
 +
|''grid mode''
 +
|-
 +
|'''6'''
 +
|white help
 +
|
 +
|'''26'''
 +
|white convert shard
 +
|
 +
|'''46'''
 +
|white plus
 +
|
 +
|'''66'''
 +
|''graph / statistics''
 +
|
 +
|
 +
|
 +
|
 +
|'''106'''
 +
|''list mode''
 +
|-
 +
|'''7'''
 +
|blue module
 +
|
 +
|'''27'''
 +
|white mine nothing
 +
|
 +
|'''47'''
 +
|''white blurry circle''
 +
|
 +
|'''67'''
 +
|blue shield
 +
|
 +
|
 +
|
 +
|
 +
|'''107'''
 +
|''save icon''
 +
|-
 +
|'''8'''
 +
|white circle
 +
|
 +
|'''28'''
 +
|white shard per time
 +
|
 +
|'''48'''
 +
|''to craft grid''
 +
|
 +
|'''68'''
 +
|grey shield
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''9'''
 +
|white cube
 +
|
 +
|'''29'''
 +
|white redo arrow
 +
|
 +
|'''49'''
 +
|''from craft grid''
 +
|
 +
|'''69'''
 +
|drill
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''10'''
 +
|''white target''
 +
|
 +
|'''30'''
 +
|
 +
|
 +
|'''50'''
 +
|cloud
 +
|
 +
|'''70'''
 +
|''trashcan''
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''11'''
 +
|Dr Cubos
 +
|
 +
|'''31'''
 +
|
 +
|
 +
|'''51'''
 +
|yellow module
 +
|
 +
|'''71'''
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''12'''
 +
|white tick
 +
|
 +
|'''32'''
 +
|
 +
|
 +
|'''52'''
 +
|red module
 +
|
 +
|'''72'''
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''13'''
 +
|lock
 +
|
 +
|'''33'''
 +
|
 +
|
 +
|'''53'''
 +
|purple module
 +
|
 +
|'''73'''
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''14'''
 +
|white shard
 +
|
 +
|'''34'''
 +
|
 +
|
 +
|'''54'''
 +
|''bomb''
 +
|
 +
|'''74'''
 +
|
 +
|
 +
|'''94'''
 +
|''checkbox''
 +
|
 +
|
 +
|
 +
|-
 +
|'''15'''
 +
|white skull
 +
|
 +
|'''35'''
 +
|
 +
|
 +
|'''55'''
 +
|''flag / impulse''
 +
|
 +
|'''75'''
 +
|
 +
|
 +
|'''95'''
 +
|red gem?!
 +
|
 +
|
 +
|
 +
|-
 +
|'''16'''
 +
|''white square''
 +
|
 +
|'''36'''
 +
|
 +
|
 +
|'''56'''
 +
|''equals / condition''
 +
|
 +
|'''76'''
 +
|fuel can
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
|'''17'''
 +
|white cross
 +
|
 +
|'''37'''
 +
|white arrow right
 +
|
 +
|'''57'''
 +
|''function / action''
 +
|
 +
|'''77'''
 +
|
 +
|
 +
|'''97'''
 +
|''museum stones''
 +
|
 +
|
 
|
 
|
{| class="wikitable mw-collapsible mw-collapsed"
 
!
 
 
|-
 
|-
|<syntaxhighlight lang="actionscript">
+
|'''18'''
:global int craft_tier
+
|health logo
 
+
|
key.1()
+
|'''38'''
(global.int.get("craft_busy") == 0)
+
|''firesword logo''
 
+
|
craft_tier = (craft_tier % 10) + 1
+
|'''58'''
</syntaxhighlight>
+
|''left click''
 +
|
 +
|'''78'''
 +
|
 +
|
 +
|'''98'''
 +
|''white stairs''
 +
|
 +
|
 +
|
 
|-
 
|-
|<syntaxhighlight lang="text">
+
|'''19'''
DWNyYWZ0IHRpZXIgdXABAAAABWtleS4xAQAAAA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50LmdldAhj
+
|damage logo
b25zdGFudAQKY3JhZnRfYnVzeQhjb25zdGFudAQCPT0IY29uc3RhbnQCAAAAAAEAAAAOZ2xvYmFsLmlu
+
|
dC5zZXQIY29uc3RhbnQECmNyYWZ0X3RpZXIOYXJpdGhtZXRpYy5pbnQOYXJpdGhtZXRpYy5pbnQOZ2xv
+
|'''39'''
YmFsLmludC5nZXQIY29uc3RhbnQECmNyYWZ0X3RpZXIIY29uc3RhbnQEA21vZAhjb25zdGFudAIKAAAA
+
|kreds
CGNvbnN0YW50BAErCGNvbnN0YW50AgEAAAA=
+
|
</syntaxhighlight>
+
|'''59'''
|}
+
|''ship''
 +
|
 +
|'''79'''
 +
|
 +
|
 +
|'''99'''
 +
|''shipping box''
 +
|
 +
|
 +
|
 
|-
 
|-
 +
|'''20'''
 +
|wave logo
 +
|
 +
|'''40'''
 +
|
 +
|
 +
|'''60'''
 +
|''circle/orb''
 +
|
 +
|'''80'''
 +
|
 +
|
 +
|'''100'''
 +
|save icon
 
|
 
|
 
|
 
|
 
|
 
|
 
|}
 
|}

Latest revision as of 10:04, 31 January 2021

I like scripting!

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">&lt;/&gt;</span>'));

    new ClipboardJS('.copy-btn', {
        text: function(trigger) {
            return $(trigger.nextElementSibling).text();
        }
    })
        .on('success',function (e) {
        $(e.trigger).html("&lt;copied/&gt;")
        setTimeout(function() {
            $(e.trigger).html("&lt;/&gt;");
        }, 3000);
    })
        .on('error',function (e) {
        $(e.trigger).html("Error!")
        setTimeout(function() {
            $(e.trigger).html("&lt;/&gt;");
        }, 3000);
    });
})();

Factory scripts: https://www.perfecttower2.com/wiki/AI_Craftapalooza



Fun sprites
# # # # #
1 gems 21 white pyramid 41 61 memory outline 81 star 101 grey module
2 hypercube 22 tree logo 42 62 memory 102 right click
3 cogs 23 white infinity 43 white pencil 63 cpu outline 103 world
4 white xp 24 hourglass 44 space bar 64 cpu 104 white warning
5 exotic gems 25 unlock 45 white 6-pt star 65 server 105 grid mode
6 white help 26 white convert shard 46 white plus 66 graph / statistics 106 list mode
7 blue module 27 white mine nothing 47 white blurry circle 67 blue shield 107 save icon
8 white circle 28 white shard per time 48 to craft grid 68 grey shield
9 white cube 29 white redo arrow 49 from craft grid 69 drill
10 white target 30 50 cloud 70 trashcan
11 Dr Cubos 31 51 yellow module 71
12 white tick 32 52 red module 72
13 lock 33 53 purple module 73
14 white shard 34 54 bomb 74 94 checkbox
15 white skull 35 55 flag / impulse 75 95 red gem?!
16 white square 36 56 equals / condition 76 fuel can
17 white cross 37 white arrow right 57 function / action 77 97 museum stones
18 health logo 38 firesword logo 58 left click 78 98 white stairs
19 damage logo 39 kreds 59 ship 79 99 shipping box
20 wave logo 40 60 circle/orb 80 100 save icon