剃刀:采矿
Z Endor Revived Wiki
该脚本在五个方向上进行挖掘 - 4 个方向垂直于配置的行走方向,1 个方向位于您的正下方。当这5个矿场被开采完后,脚本会将你按照配置的方向移动一个矿场,将背包中所有配置的矿石倾倒到地面上,并将矿石放在你的角色下方。警告 - 我们会将所有矿石从你的角色周围移走 二 格,因此除非你喜欢戏剧,否则请远离其他玩家。 😊
要求
- 手上有一把铲子或镐,最好在背包里有一些备用件。
- 跑到一个可开采的洞穴。
Skript
// Mining
// version 1.1
//
// Changelog:
// 1.1: added food checking
if listexists 'mine-direction'
removelist 'mine-direction'
endif
createlist 'mine-direction'
if listexists 'mine-orehues'
removelist 'mine-orehues'
endif
createlist 'mine-orehues'
if listexists 'mine-foodtypes'
removelist 'mine-foodtypes'
endif
createlist 'mine-foodtypes'
### start of configuration ###
# change mining direction here
# must be exactly one of these values: West East North South
pushlist 'mine-direction' 'West'
# change which ores you want dropped on ground and dragged behind here
# note that if ore drops to ground due to weight and is not listed here it will be left on the spot
# iron ore
pushlist 'mine-orehues' "0"
# copper ore
pushlist 'mine-orehues' "1118"
# tin ore
pushlist 'mine-orehues' "2401"
# lead ore
pushlist 'mine-orehues' "1045"
# zinc ore
pushlist 'mine-orehues' "2403"
# silver ore
pushlist 'mine-orehues' "2951"
# gold ore
pushlist 'mine-orehues' "2213"
# gorinite ore
pushlist 'mine-orehues' "1645"
# chlorite ore
pushlist 'mine-orehues' "2128"
# hieronite ore
pushlist 'mine-orehues' "2428"
# sangvine ore
pushlist 'mine-orehues' "41"
# arite ore
pushlist 'mine-orehues' "1344"
# change which foods do you want to try to consume from your backpack
# cuts of ribs
pushlist 'mine-foodtypes' 2546
# fish steak
pushlist 'mine-foodtypes' 2427
### end of configuration ###
if listexists 'mine-locations'
removelist 'mine-locations'
endif
createlist 'mine-locations'
pushlist 'mine-locations' -2
pushlist 'mine-locations' -1
pushlist 'mine-locations' 0
pushlist 'mine-locations' 1
pushlist 'mine-locations' 2
# eat
setvar! 'mine-hungry' 1
while varexist! 'mine-hungry'
clearsysmsg
setvar! 'mine-eating' 1
foreach foodtype in 'mine-foodtypes'
if varexist! 'mine-eating' and findtype foodtype 'backpack' as 'food'
dclick 'food'
unsetvar! 'mine-eating'
wait 250
endif
endfor
if varexist! 'mine-eating'
sysmsg 'Warning: no food'
unsetvar! 'mine-hungry'
endif
if insysmsg 'You are too full to eat any more'
unsetvar! 'mine-hungry'
endif
endwhile
# cut gems
@clearignore
while findtype 5031 'backpack' as 'chunk'
if findtype 7868 'backpack' 5 as 'tool'
clearsysmsg
dclick 'tool'
waitfortarget
target 'chunk'
while 1 = 1
if insysmsg 'Your tool broke'
break;
endif
if insysmsg 'You have created a gem'
break;
endif
if insysmsg 'You have failed to create a gem'
break;
endif
wait 50
endwhile
wait 250
else
break
endif
endwhile
# mine locations
foreach loc in 'mine-locations'
if inlist 'mine-direction' 'West' or inlist 'mine-direction' 'East'
sysmsg 'Mining at 0 {{loc}}'
elseif inlist 'mine-direction' 'North' or inlist 'mine-direction' 'south'
sysmsg 'Mining at {{loc}} 0'
else
sysmsg 'Mining direction is misconfigured'
stop
endif
setvar! 'mine_minespot' 1
while varexist 'mine_minespot'
clearsysmsg
// shovel > rhand > pickaxe in bag
if findtype 3897 'backpack' as 'tool'
dclick 'tool'
elseif not rhandempty
hotkey 'use item in hand'
elseif findtype 3718 'backpack' as 'tool' or findtype 3717 'backpack' as 'tool'
dress 'tool'
while rhandempty
wait 50
endwhile
wait 500
dclick 'tool'
else
sysmsg 'No tool found'
stop
endif
waitfortarget
if inlist 'mine-direction' 'West' or inlist 'mine-direction' 'East'
targetrelloc 0 loc
elseif inlist 'mine-direction' 'North' or inlist 'mine-direction' 'south'
targetrelloc loc 0
else
sysmsg 'Mining direction is misconfigured'
stop
endif
setvar! 'mine_wait' 1
while varexist 'mine_wait'
if insysmsg 'You can mine only from cave floor' or insysmsg 'That is too far away' or insysmsg "You cannot see that"
unsetvar! 'mine_wait'
unsetvar! 'mine_minespot'
elseif insysmsg 'there is no more'
unsetvar! 'mine_wait'
unsetvar! 'mine_minespot'
elseif insysmsg 'tool broke'
unsetvar! 'mine_wait'
endif
wait 500
endwhile
endwhile
endfor
# change direction to next spot
foreach step in 'mine-direction'
walk step
endfor
# make step on next spot
foreach step in 'mine-direction'
walk step
endfor
wait 500
# drop ores from backpack
@clearignore
foreach orehue in 'mine-orehues'
while findtype 6585 'backpack' orehue as 'backpackstack'
@ignore 'backpackstack'
while findtype 6585 'backpack' orehue as 'otherstack'
@ignore 'otherstack'
endwhile
lift 'backpackstack' 0
if findtype 6585 true orehue as 'groundstack'
sysmsg 'Dropping {{orehue}} to ground stack'
drop 'groundstack'
else
sysmsg 'Dropping {{orehue}} to ground location'
droprelloc 0 0
endif
wait 150
@clearignore
endwhile
endfor
wait 500
# drag ores under our character
@clearignore
foreach orehue in 'mine-orehues'
// backpack ores should have been dropped already
// but to be sure lets ignore them
while findtype 6585 'backpack' orehue as 'stack'
@ignore 'stack'
endwhile
// first stack
unsetvar! 'minevacuumgroundstack';
while findtype 6585 true orehue as 'stack'
lift 'stack' 0
if varexist! 'minevacuumgroundstack'
drop 'minevacuumgroundstack'
else
droprelloc 0 0
setvar! 'minevacuumgroundstack' 'stack'
endif
wait 150
@ignore 'stack'
endwhile
endfor
wait 500
// pickup all chunks
@clearignore
while findtype 5031 'backpack' as 'chunk'
@ignore 'chunk'
endwhile
while findtype 5031 true as 'chunk'
lift 'chunk' 0
drop 'backpack' -1 -1
wait 150
@ignore 'chunk'
endwhile
// go again
loop