AI Craftapalooza CNC

From The Perfect Tower II
Revision as of 00:58, 22 January 2021 by Troylaurin (talk | contribs)
Jump to navigation Jump to search

Command scripts

Script Lines Notes Source
craft init 9 Impulse on wake
CmNyYWZ0IGluaXQBAAAABndha2V1cAAAAAAJAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BApjcmFm
dF9idXN5CGNvbnN0YW50AgAAAAAOZ2xvYmFsLmludC5zZXQIY29uc3RhbnQEDGNyYWZ0X3N0YXR1cwhj
b25zdGFudALIAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BBJjcmFmdF9yZXF1aXJlX3RpZXIIY29u
c3RhbnQCAAAAABFnbG9iYWwuZG91YmxlLnNldAhjb25zdGFudAQTY3JhZnRfcmVxdWlyZV9jb3VudAhj
b25zdGFudAMAAAAAAAAAAA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQKY3JhZnRfdGllcghjb25zdGFu
dAIBAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BApjcmFmdF9tb2RlCGNvbnN0YW50AgEAAAAOZ2xv
YmFsLmludC5zZXQIY29uc3RhbnQEDGNyYWZ0X291dHB1dAhjb25zdGFudAIBAAAAEWdsb2JhbC5kb3Vi
bGUuc2V0CGNvbnN0YW50BAtjcmFmdF9jb3VudAhjb25zdGFudAMAAAAAAADwPxFnbG9iYWwuZG91Ymxl
LnNldAhjb25zdGFudAQPY3JhZnRfaW52ZW50b3J5CGNvbnN0YW50AwAAAAAAAPA/
wakeup()

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)


craft GO 13 Impulse on 0
  • while in the factory
CGNyYWZ0IEdPAQAAAAVrZXkuMAEAAAAPY29tcGFyaXNvbi5ib29sDmNvbXBhcmlzb24uaW50Dmdsb2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GNoZWNrDGdlbmVyaWMuc3RvcAZjb25jYXQGY29uY2F0BmNvbmNh
dAhjb25zdGFudAQGY3JhZnQgA2kycw5nbG9iYWwuaW50LmdldAhjb25zdGFudAQKY3JhZnRfbW9kZQhj
b25zdGFudAQBOgNpMnMOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEDGNyYWZ0X291dHB1dBNnZW5lcmlj
LmV4ZWN1dGVzeW5jBmNvbmNhdAZjb25jYXQGY29uY2F0CGNvbnN0YW50BAZjcmFmdCADaTJzDmdsb2Jh
bC5pbnQuZ2V0CGNvbnN0YW50BApjcmFmdF9tb2RlCGNvbnN0YW50BAE6A2kycw5nbG9iYWwuaW50Lmdl
dAhjb25zdGFudAQMY3JhZnRfb3V0cHV0DmdlbmVyaWMuZ290b2lmCGNvbnN0YW50Ag0AAAAOY29tcGFy
aXNvbi5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEDGNyYWZ0X3N0YXR1cwhjb25zdGFudAQBPghj
b25zdGFudALHAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BAxjcmFmdF9zdGF0dXMIY29uc3RhbnQC
yAAAAA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQKY3JhZnRfYnVzeQhjb25zdGFudAIAAAAA
:global int craft_mode
:global int craft_output
:local int max

key.0()

(global.int.get("craft_busy") == 0 & isopen("factory"))

  global.int.set("craft_busy", 1)
  global.int.set("craft_require_tier", 0)
  global.double.set("craft_require_count", 0.0)
  global.int.set("craft_tier:" . craft_mode . "." . craft_output, global.int.get("craft_tier"))
  global.double.set("craft_count:" . craft_mode . "." . craft_output, global.double.get("craft_count"))
  
  execute("craft script check")
  global.int.set("craft_status", 102) ; Processing
  stop("craft script check")

  stop("craft " . craft_mode . ":" . craft_output)
  executesync("craft " . craft_mode . ":" . craft_output)

; Preserve status if its already in a terminal state
end: gotoif(end2, global.int.get("craft_status") > 199)
  global.int.set("craft_status", 200) ; OK
end2: global.int.set("craft_busy", 0)


craft tier up 1 Impulse on 1
DWNyYWZ0IHRpZXIgdXABAAAABWtleS4xAQAAAA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50LmdldAhj
b25zdGFudAQKY3JhZnRfYnVzeQhjb25zdGFudAQCPT0IY29uc3RhbnQCAAAAAAEAAAAOZ2xvYmFsLmlu
dC5zZXQIY29uc3RhbnQECmNyYWZ0X3RpZXIOYXJpdGhtZXRpYy5pbnQOYXJpdGhtZXRpYy5pbnQOZ2xv
YmFsLmludC5nZXQIY29uc3RhbnQECmNyYWZ0X3RpZXIIY29uc3RhbnQEA21vZAhjb25zdGFudAIKAAAA
CGNvbnN0YW50BAErCGNvbnN0YW50AgEAAAA=
:global int craft_tier

key.1()
(global.int.get("craft_busy") == 0)

craft_tier = (craft_tier % 10) + 1


craft mode up 2 Impulse on 2
DWNyYWZ0IG1vZGUgdXABAAAABWtleS4yAQAAAA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50LmdldAhj
b25zdGFudAQKY3JhZnRfYnVzeQhjb25zdGFudAQCPT0IY29uc3RhbnQCAAAAAAIAAAAOZ2xvYmFsLmlu
dC5zZXQIY29uc3RhbnQECmNyYWZ0X21vZGUOYXJpdGhtZXRpYy5pbnQOYXJpdGhtZXRpYy5pbnQOZ2xv
YmFsLmludC5nZXQIY29uc3RhbnQECmNyYWZ0X21vZGUIY29uc3RhbnQEA21vZAhjb25zdGFudAIDAAAA
CGNvbnN0YW50BAErCGNvbnN0YW50AgEAAAAOZ2xvYmFsLmludC5zZXQIY29uc3RhbnQEDGNyYWZ0X291
dHB1dAhjb25zdGFudAIBAAAA
:global int craft_mode
:global int craft_output

key.2()
(global.int.get("craft_busy") == 0)

craft_mode = (craft_mode % 3) + 1
craft_output = 1


craft output up 2 Impulse on 3
D2NyYWZ0IG91dHB1dCB1cAEAAAAFa2V5LjMBAAAADmNvbXBhcmlzb24uaW50Dmdsb2JhbC5pbnQuZ2V0
CGNvbnN0YW50BApjcmFmdF9idXN5CGNvbnN0YW50BAI9PQhjb25zdGFudAIAAAAAAgAAAA1sb2NhbC5p
bnQuc2V0CGNvbnN0YW50BANtYXgOYXJpdGhtZXRpYy5pbnQOYXJpdGhtZXRpYy5pbnQIY29uc3RhbnQC
9OjHAAhjb25zdGFudAQBLw5hcml0aG1ldGljLmludAhjb25zdGFudAJkAAAACGNvbnN0YW50BANwb3cO
Z2xvYmFsLmludC5nZXQIY29uc3RhbnQECmNyYWZ0X21vZGUIY29uc3RhbnQEA21vZAhjb25zdGFudAJk
AAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BAxjcmFmdF9vdXRwdXQOYXJpdGhtZXRpYy5pbnQOYXJp
dGhtZXRpYy5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEDGNyYWZ0X291dHB1dAhjb25zdGFudAQD
bW9kDWxvY2FsLmludC5nZXQIY29uc3RhbnQEA21heAhjb25zdGFudAQBKwhjb25zdGFudAIBAAAA
:global int craft_mode
:global int craft_output
:local int max

key.3()
(global.int.get("craft_busy") == 0)

max = (13101300 / (100 ^ craft_mode)) % 100
craft_output = (craft_output % max) + 1


craft count up 5 Impulse on 9
DmNyYWZ0IGNvdW50IHVwAQAAAAVrZXkuOQEAAAAOY29tcGFyaXNvbi5pbnQOZ2xvYmFsLmludC5nZXQI
Y29uc3RhbnQECmNyYWZ0X2J1c3kIY29uc3RhbnQEAj09CGNvbnN0YW50AgAAAAAFAAAADmdlbmVyaWMu
Z290b2lmCGNvbnN0YW50AmMAAAARY29tcGFyaXNvbi5kb3VibGURZ2xvYmFsLmRvdWJsZS5nZXQIY29u
c3RhbnQEC2NyYWZ0X2NvdW50CGNvbnN0YW50BAE+CGNvbnN0YW50AwAAAABAdytBDmdlbmVyaWMuZ290
b2lmCGNvbnN0YW50AgQAAAARY29tcGFyaXNvbi5kb3VibGURZ2xvYmFsLmRvdWJsZS5nZXQIY29uc3Rh
bnQEC2NyYWZ0X2NvdW50CGNvbnN0YW50BAE8CGNvbnN0YW50AwAAAAAAAPA/EGxvY2FsLmRvdWJsZS5z
ZXQIY29uc3RhbnQEA3Bvdwxkb3VibGUuZmxvb3IRYXJpdGhtZXRpYy5kb3VibGUIY29uc3RhbnQDexSu
R+F6hD8IY29uc3RhbnQEASsRYXJpdGhtZXRpYy5kb3VibGURZ2xvYmFsLmRvdWJsZS5nZXQIY29uc3Rh
bnQEC2NyYWZ0X2NvdW50CGNvbnN0YW50BANsb2cIY29uc3RhbnQDAAAAAAAAJEAQbG9jYWwuZG91Ymxl
LnNldAhjb25zdGFudAQDaW5jEWFyaXRobWV0aWMuZG91YmxlCGNvbnN0YW50AwAAAAAAACRACGNvbnN0
YW50BANwb3cQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQDcG93EWdsb2JhbC5kb3VibGUuc2V0CGNv
bnN0YW50BAtjcmFmdF9jb3VudBFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25z
dGFudAQLY3JhZnRfY291bnQIY29uc3RhbnQEASsQbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQDaW5j
:global double craft_count
:local double pow
:local double inc

key.9()
(global.int.get("craft_busy") == 0)

   gotoif(99, craft_count > 900000.0)
   gotoif(a, craft_count < 1.0)
   pow = double.floor(0.01 + (craft_count // 10.0))
a: inc = 10.0 ^ pow
   craft_count = craft_count + inc


craft count down 5 Impulse on 8
EGNyYWZ0IGNvdW50IGRvd24BAAAABWtleS44AQAAAA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50Lmdl
dAhjb25zdGFudAQKY3JhZnRfYnVzeQhjb25zdGFudAQCPT0IY29uc3RhbnQCAAAAAAUAAAAOZ2VuZXJp
Yy5nb3RvaWYIY29uc3RhbnQCAwAAABFjb21wYXJpc29uLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhj
b25zdGFudAQLY3JhZnRfY291bnQIY29uc3RhbnQEATwIY29uc3RhbnQDAAAAAAAA8D8QbG9jYWwuZG91
YmxlLnNldAhjb25zdGFudAQDcG93DGRvdWJsZS5mbG9vchFhcml0aG1ldGljLmRvdWJsZQhjb25zdGFu
dAN7FK5H4XqEvwhjb25zdGFudAQBKxFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhj
b25zdGFudAQLY3JhZnRfY291bnQIY29uc3RhbnQEA2xvZwhjb25zdGFudAMAAAAAAAAkQBBsb2NhbC5k
b3VibGUuc2V0CGNvbnN0YW50BANpbmMRYXJpdGhtZXRpYy5kb3VibGUIY29uc3RhbnQDAAAAAAAAJEAI
Y29uc3RhbnQEA3BvdxBsb2NhbC5kb3VibGUuZ2V0CGNvbnN0YW50BANwb3cOZ2VuZXJpYy5nb3RvaWYI
Y29uc3RhbnQCYwAAABFjb21wYXJpc29uLmRvdWJsZRFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91
YmxlLmdldAhjb25zdGFudAQLY3JhZnRfY291bnQIY29uc3RhbnQEAS0QbG9jYWwuZG91YmxlLmdldAhj
b25zdGFudAQDaW5jCGNvbnN0YW50BAE8CGNvbnN0YW50AwAAAAAAAPA/EWdsb2JhbC5kb3VibGUuc2V0
CGNvbnN0YW50BAtjcmFmdF9jb3VudBFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhj
b25zdGFudAQLY3JhZnRfY291bnQIY29uc3RhbnQEAS0QbG9jYWwuZG91YmxlLmdldAhjb25zdGFudAQD
aW5j
:global double craft_count
:local double pow
:local double inc

key.8()
(global.int.get("craft_busy") == 0)

   gotoif(a, craft_count < 1.0)
   pow = double.floor(-0.01 + (craft_count // 10.0))
a: inc = 10.0 ^ pow
   gotoif(99, craft_count - inc < 1.0)
   craft_count = craft_count - inc


craft inventory use 1 Impulse on 5
E2NyYWZ0IGludmVudG9yeSB1c2UBAAAABWtleS41AQAAAA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50
LmdldAhjb25zdGFudAQKY3JhZnRfYnVzeQhjb25zdGFudAQCPT0IY29uc3RhbnQCAAAAAAEAAAARZ2xv
YmFsLmRvdWJsZS5zZXQIY29uc3RhbnQED2NyYWZ0X2ludmVudG9yeRFhcml0aG1ldGljLmRvdWJsZQhj
b25zdGFudAMAAAAAAADwPwhjb25zdGFudAQBLRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQPY3Jh
ZnRfaW52ZW50b3J5
:global double craft_inventory

key.5()
(global.int.get("craft_busy") == 0)

craft_inventory = 1.0 - craft_inventory


craft script check 3
EmNyYWZ0IHNjcmlwdCBjaGVjawAAAAAAAAAAAwAAABNnZW5lcmljLmV4ZWN1dGVzeW5jBmNvbmNhdAZj
b25jYXQGY29uY2F0CGNvbnN0YW50BAZjcmFmdCADaTJzDmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BApj
cmFmdF9tb2RlCGNvbnN0YW50BAE6A2kycw5nbG9iYWwuaW50LmdldAhjb25zdGFudAQMY3JhZnRfb3V0
cHV0Dmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BAxjcmFmdF9zdGF0dXMIY29uc3RhbnQClAEAAAxnZW5l
cmljLmdvdG8IY29uc3RhbnQCAwAAAA==
:global int craft_mode
:global int craft_output

executesync("craft " . craft_mode . ":" . craft_output)
global.int.set("craft_status", 404) ; Script not found
loop: goto(loop)


craft output producer ? Impulse on 4
  • while in town
  • while in producer mode (1)
TODO
craft output machine 4 Impulse on 4
  • while in the factory
  • while in machine mode (2)
FGNyYWZ0IG91dHB1dCBtYWNoaW5lAQAAAAVrZXkuNAEAAAAPY29tcGFyaXNvbi5ib29sD2NvbXBhcmlz
b24uYm9vbA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQKY3JhZnRfYnVzeQhj
b25zdGFudAQCPT0IY29uc3RhbnQCAAAAAAhjb25zdGFudAQBJg5jb21wYXJpc29uLmludA5nbG9iYWwu
aW50LmdldAhjb25zdGFudAQKY3JhZnRfbW9kZQhjb25zdGFudAQCPT0IY29uc3RhbnQCAgAAAAhjb25z
dGFudAQBJh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QCAAAAAAhjb25zdGFudAQBfA5jb21wYXJp
c29uLmludA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQBeQhjb25zdGFudAQBPghjb25zdGFudAIBAAAA
Dmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BAxjcmFmdF9vdXRwdXQOYXJpdGhtZXRpYy5pbnQOZ2xvYmFs
LmludC5nZXQIY29uc3RhbnQEAXgIY29uc3RhbnQEASsOYXJpdGhtZXRpYy5pbnQOZ2xvYmFsLmludC5n
ZXQIY29uc3RhbnQEAXkIY29uc3RhbnQEASoIY29uc3RhbnQCBQAAAA==
:global int craft_output
:global int y
:global int x

key.4()
(global.int.get("craft_busy") == 0 & global.int.get("craft_mode") == 2 & isopen("factory"))

x = d2i(floor(((x(position()) / i2d(width()) - 0.41) / 0.10) + 1.0))
y = d2i(floor(((0.80 - y(position()) / i2d(height())) / 0.214)))

gotoif(99, x<1


craft ingot 13
C2NyYWZ0IGluZ290AAAAAAAAAAANAAAADWxvY2FsLmludC5zZXQIY29uc3RhbnQEC3ZlcmlmeV9tb2Rl
Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BBJjcmFmdF92ZXJpZnk6aW5nb3QOZ2xvYmFsLmludC5zZXQI
Y29uc3RhbnQEEmNyYWZ0X3ZlcmlmeTppbmdvdAhjb25zdGFudAIAAAAADmdlbmVyaWMuZ290b2lmCGNv
bnN0YW50AmMAAAAPY29tcGFyaXNvbi5ib29sD2NvbXBhcmlzb24uYm9vbA9jb21wYXJpc29uLmJvb2wO
Y29tcGFyaXNvbi5pbnQOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29u
c3RhbnQEATwIY29uc3RhbnQCAQAAAAhjb25zdGFudAQBfA5jb21wYXJpc29uLmludA5nbG9iYWwuaW50
LmdldAhjb25zdGFudAQQY3JhZnRfdGllcjppbmdvdAhjb25zdGFudAQBPghjb25zdGFudAIKAAAACGNv
bnN0YW50BAF8EWNvbX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ABFnZW5lcmljLndhaXR3aGls
ZRZmYWN0b3J5Lm1hY2hpbmUuYWN0aXZlCGNvbnN0YW50BARvdmVuD2ZhY3RvcnkucHJvZHVjZQhjb25z
dGFudAQEZHVzdA5nbG9iYWwuaW50LmdldAhjb25zdGFudAQQY3JhZnRfdGllcjppbmdvdAtkb3VibGUu
Y2VpbBFhcml0aG1ldGljLmRvdWJsZRFnbG9iYWwuZG91YmxlLmdldAhjb25zdGFudAQRY3JhZnRfY291
bnQ6aW5nb3QIY29uc3RhbnQEAS0TZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQFaW5nb3QOZ2xv
YmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29uc3RhbnQEBG92ZW4RZ2VuZXJp
Yy53YWl0dW50aWwRY29tcGFyaXNvbi5kb3VibGUTZmFjdG9yeS5pdGVtcy5jb3VudAhjb25zdGFudAQF
aW5nb3QOZ2xvYmFsLmludC5nZXQIY29uc3RhbnQEEGNyYWZ0X3RpZXI6aW5nb3QIY29uc3RhbnQEAj49
EWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBFjcmFmdF9jb3VudDppbmdvdAxnZW5lcmljLmdvdG8I
Y29uc3RhbnQCYwAAAA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQSY3JhZnRfcmVxdWlyZV90aWVyDmds
b2JhbC5pbnQuZ2V0CGNvbnN0YW50BBBjcmFmdF90aWVyOmluZ290EWdsb2JhbC5kb3VibGUuc2V0CGNv
bnN0YW50BBNjcmFmdF9yZXF1aXJlX2NvdW50EWdsb2JhbC5kb3VibGUuZ2V0CGNvbnN0YW50BBFjcmFm
dF9jb3VudDppbmdvdA5nbG9iYWwuaW50LnNldAhjb25zdGFudAQMY3JhZnRfc3RhdHVzCGNvbnN0YW50
ApwBAAA=
:local int verify_mode

; tier = global.int.get("craft_tier:ingot")
; count = global.double.get("craft_count:ingot")
verify_mode = global.int.get("craft_verify:ingot")
global.int.set("craft_verify:ingot", 0)
gotoif(99, global.int.get("craft_tier:ingot") < 1 | global.int.get("craft_tier:ingot") > 10 | global.double.get("craft_count:ingot") <= 0.0 | global.int.get("craft_status") > 199)

gotoif(99, global.double.get("craft_count:ingot") <= count("ingot", global.int.get("craft_tier:ingot")))
gotoif(bad, global.double.get("craft_count:ingot") > count("ingot", global.int.get("craft_tier:ingot")) + count("dust", global.int.get("craft_tier:ingot")) - 1.0)
gotoif(99, verify_mode > 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) ; ok

bad: global.int.set("craft_require_tier", global.int.get("craft_tier:ingot"))
  global.double.set("craft_require_count", global.double.get("craft_count:ingot"))
  global.int.set("craft_status", 412)