#function autocompressor

1 messages · Page 1 of 1 (latest)

fading flaxBOT
#

Please do not crosspost @worldly rain. We have multiple channels to make sure that everyone's questions can be seen. Please pick one channel to ask your question in and then wait for someone to assist you.

worldly rain
worldly rain
#

this is what I have now, no syntax errors but it doesn't work 😢

#

on load:
set {oakLog} to oak log
set (name of {oakLog}) to "&fOak Log"
set {compOakLog} to of oak log with all item flags
set (name of {compOakLog}) to "&fCompressed Oak Log"
enchant {compOakLog} with mending
set {oakCompressor} to of dispenser
set (name of {oakCompressor}) to "&fOak Compressor"

function compress(compressing:item, compressor:item, amountNeeded:number, compressingTo:item, p:player):
wait 1 tick
if {_p} is holding {_compressor} in off-hand:
if {_p} has {_compressing} in inventory:
set {_a} to amount of {_compressing} in inventory of {_p}
set {_b} to {_a} / {_amountNeeded}
set {_b} to floor({_b})
set {_c} to {_b} * {_amountNeeded}
remove {_c} of {_compressing} from {_p}
give {_b} of {_compressingTo} to {_p}

on break of oak log:
cancel drops
give player 8 of {oakLog}
compress({oakLog}, {oakCompressor}, 32, {compOakLog}, player)

#

wait

#

what