Code: Select all
from datetime import datetime as dt
bad_points = []
pickaxe = 0x143C
def FindTiles(center_x, center_y, radius):
min_x, min_y = center_x-radius, center_y-radius
max_x, max_y = center_x+radius, center_y+radius
tiles_coords = []
for tile in range(1339,1359):
tiles_coords += GetStaticTilesArray(min_x,min_y,max_x,max_y,WorldNum(),tile)
return tiles_coords
while True:
for t,x,y,z in FindTiles(GetX(Self()),GetY(Self()), 7):
if ([x,y] not in bad_points) and newMoveXY(x,y,True,1,False):
now = dt.now()
CancelWaitTarget()
CancelTarget()
UseType(pickaxe,-1)
WaitJournalLine(now,'Select a place to mine.',60000)
WaitTargetTile(t,x,y,0)
WaitJournalLine(now,'there is no more ore here to mine.|You cannot see that|You cannot mine here.',80000)
if InJournalBetweenTimes('You cannot see that|You cannot mine here.', now, dt.now()) >=0:
if [x,y] not in bad_points:
bad_points.append([x,y])