๐ Replace Lock
script untuk replace Small Lock di setiap world farm kamu! untuk list worldnya bisa diambil lewat tabel world dengan cara Select > Klik Kanan > Export > As script list
- hanya bisa replace Small Lock yang pas diatas White Door! karena ini jadi tidak perlu isi door id
- small lock akan langsung di reapply karena ada command:
execute if-true [{var.foreground}="Blank"] tile @t[index="11"] edit [ignore="true"]execute if-true [{var.tile}!="null",{var.tile.foreground}="Small Lock"] tile @t[index="11"] edit [ignore="true"]- silahkan dihapus kalau tidak mau re apply
- disarankan gunakan 1 bot saja untuk replace Small Lock di setiap 600 world, karena bot akan langsung ambil 200 Small Lock dari storage
# OnLoad - replace lock & re applyโ
setting "delay_after_join" 4
var "storageWorld" store text "STORAGE|ID"
execute as "{script.bots.0}" var "worlds" store list ["MYWORLD"]
execute if-true [{var.worlds}="null"] terminate
loop "{var.worlds}"
execute if-true [{bot.inventory.Small_Lock.amount}=0] var "takeSL" store text "true"
execute if-true [{bot.inventory.Small_Lock.amount}>0] var "takeSL" store text "false"
execute if-true [{var.takeSL}="true"] job schedule [name="collect",search="Small Lock;200;false;false;false;false;{var.storageWorld}",start_world="{var.storageWorld}"]
execute if-true [{var.takeSL}="true"] job wait "collect"
go "{var.loop.value}" await
execute if-true [{var.returnValue.isSuccess}="false"] loop continue
pathfinding @t[foreground="Main Door"]
# ini akan break sekitaran block karena re apply, silahkan cek index nya dan sesuaikan dengan world kamu
tile @t[index="2"] break
tile @t[index="5"] break
tile @t[index="9"] break
tile @t[index="10"] break
tile @t[index="14"] break
tile @t[index="15"] break
tile @t[index="19"] break
tile @t[index="22"] break
var "tile" store entity @t[index="11"]
execute if-true [{var.tile}!="null"] tile @t[index="11"] punch
execute if-true [{var.tile}!="null",{var.tile.foreground}="Small Lock"] tile @t[index="11"] edit [ignore="true"]
var "foreground" store text "{var.tile.foreground}"
execute if-true [{var.foreground}="Blank"] tile @t[index="11"] place "Small Lock"
execute if-true [{var.foreground}="Blank"] tile @t[index="11"] edit [ignore="true"]
execute if-true [{var.foreground}="Blank"] notification raw "lock at {var.loop.value} changed!"
loop end
# OnLoad - replace lock & re apply + world lock & publicโ
bot akan take World Lock 200 di storage, setelah itu place di samping kiri Small Lock karena index 6, ganti kalau misalnya ada jammer disana cek index
setting "delay_after_join" 4
var "storageWorld" store text "STORAGE|ID"
execute as "{script.bots.0}" var "worlds" store list ["MYWORLD"]
execute if-true [{var.worlds}="null"] terminate
loop "{var.worlds}"
execute any-true [{bot.inventory.Small_Lock.amount}=0,{bot.inventory.World_Lock.amount}=0] var "takeLock" store text "true"
execute if-true [{var.takeLock}="true"] job schedule [name="collect",search="Small Lock;200;false;false;false;false;{var.storageWorld},World Lock;200;false;false;false;false;{var.storageWorld}",start_world="{var.storageWorld}"]
execute if-true [{var.takeLock}="true"] job wait "collect"
go "{var.loop.value}" await
execute if-true [{var.returnValue.isSuccess}="false"] loop continue
pathfinding @t[foreground="Main Door"]
# ini akan break sekitaran block karena re apply, silahkan cek index nya dan sesuaikan dengan world kamu
tile @t[index="2"] break
tile @t[index="5"] break
tile @t[index="9"] break
tile @t[index="10"] break
tile @t[index="14"] break
tile @t[index="15"] break
tile @t[index="19"] break
tile @t[index="22"] break
var "tile" store entity @t[index="11"]
execute if-true [{var.tile}!="null"] tile @t[index="11"] punch
execute if-true [{var.tile}!="null",{var.tile.foreground}="Small Lock"] tile @t[index="11"] edit [ignore="true"]
var "foreground" store text "{var.tile.foreground}"
execute if-true [{var.foreground}="Blank"] tile @t[index="11"] place "Small Lock"
execute if-true [{var.foreground}="Blank"] tile @t[index="11"] edit [ignore="true"]
execute if-true [{var.foreground}="Blank"] tile @t[index="6"] break
execute if-true [{var.foreground}="Blank"] tile @t[index="6"] place "World Lock"
execute if-true [{var.foreground}="Blank"] tile @t[index="6"] edit [public="true"]
execute if-true [{var.foreground}="Blank"] notification raw "lock at {var.loop.value} changed!"
loop end
# OnLoad - replace lock & door idโ
bot akan take Small Lock 200 dari storage yang kamu berikan, hanya akan ganti Door ID kalau Small Lock berhasil di replace! pastikan juga format worldnya Small Lock diatas White Door & tanpa re-apply
var "storageWorld" store text "STORAGE|ID"
execute as "{script.bots.0}" var "worlds" store list ["MYWORLD|ID"]
execute if-true [{var.worlds}="null"] terminate
loop "{var.worlds}"
# collect Small Lock
execute if-true [{bot.inventory.Small_Lock.amount}=0] var "takeSL" store text "true"
execute if-true [{bot.inventory.Small_Lock.amount}>0] var "takeSL" store text "false"
execute if-true [{var.takeSL}="true"] job schedule [name="collect",search="Small Lock;200;false;false;false;false;{var.storageWorld}",start_world="{var.storageWorld}"]
execute if-true [{var.takeSL}="true"] job wait "collect"
# go ke world, kalau gagal akan di skip
go "{var.loop.value}" await
execute if-true [{var.returnValue.isSuccess}="false"] loop continue
# coba punch Small Lock sekali, kalau gagal akan di skip
var "tile" store entity @t[foreground="Small Lock"]
tile @t[location="{var.tile.location.xy}"] punch
execute if-true [{var.tile.foreground}="Small Lock"] loop continue
# place Small Lock dan edit Door
tile @t[location="{var.tile.location.xy}"] place "Small Lock"
tile @t[foreground="Door"] edit [label="sudah diganti",id="IDBARU"]
notification raw "{var.loop.value} id & lock changed"
loop end