View Categories

Mining

23 min read

Details #

All scripts have been collected over the years and if available will still contain the creators details, these scripts may run well or not.

Scripts #

mining-north south.sc #

sub main() 
var mloop
var walkback
mloop=0 
walkback=0 
start: 

if mloop<=1 then #less than  
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(385,312) 
mloop=mloop+1 
wait(7500) 
end if 

if mloop>=1 then #greater than
UO.Press(33) 
wait(1500) 
mloop=0 
walkback=walkback+1 
end if 

if walkback>=18 then #greater than or equil to
UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(35) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

UO.Press(33) 
UO.Exec('usetype shovel')    
wait(2000)
UO.LClick(417,312) 
wait(8000)

walkback=0 
end if 

GOTO start 
end sub 

mining waittargettile.sc #

sub main()
	var shovel = 0x0F39
	var pickaxe = 0x0E85
	var fishCakes = 0x097B
	
	#removes injection text from the screen
	UO.Set('quiet', 1)
	
	#mine a 10 by 10 square with a pickaxe, eating fish cakes when you get hungry
	mineSquare(pickaxe, fishCakes, 8, 8)
end sub

sub mineSquare(tool, food, xLength, yLength)
	var mapType = 0x14ED

	var startX = UO.GetX()
	var startY = UO.GetY()
	var counter
	var currentY = 0

	var downRight = 34
	var upLeft = 36
	
	While TRUE
		#hidePlayers()
		dropAllOfType(mapType)

		moveTo(startX, startY + currentY)

		For counter = 0 To xLength-1
			UO.Press(downRight)
			mine(tool, food)
		Next

		currentY = currentY + 1
		moveTo(startX + xLength-1, startY + currentY)

		For counter = 0 To xLength-1
			UO.Press(upLeft)
			mine(tool, food)
		Next

		currentY = currentY + 1

		If currentY > yLength - 1 Then
			moveTo(startX, startY)
			currentY = 0
		End If
	Wend
end sub

sub mine(tool, food)
	var x = UO.GetX()
	var y = UO.GetY()
	
	#It looks like the tiles in the crafter mine have the tile graphics 581 to 585
	waitTargetTileBelow(x, y, 581, 585)

	UO.DeleteJournal()
	UO.Usetype(tool)

	journalWait('aborted|finished', 10000)
	
	checkStamina(food)

	UO.DeleteJournal()
	
	hidePlayers()
end sub

sub moveTo(x,y)
	#numpad key codes
	var upRight = 33
	var downRight = 34
	var downLeft = 35
	var upLeft = 36

	var deltaX, deltaY
	
	While UO.GetX() <> x || UO.GetY() <> y
		deltaX = x - UO.GetX()
		deltaY = y - UO.GetY()
		
		If deltaX < 0 Then
			deltaX = deltaX * -1
		End If

		If deltaY < 0 Then
			deltaY = deltaY * -1
		End If
		
		If UO.GetX() > x Then
			arrowKeyPress(upLeft, deltaX)
		Else 
		If UO.GetX() < x Then
			arrowKeyPress(downRight, deltaX)
		Else
		If UO.GetY() > y Then
			arrowKeyPress(upRight, deltaY)
		Else 
		If UO.GetY() < y Then
			arrowKeyPress(downLeft, deltaY)
		End If
		End If
		End If
		End If

		Wait(1000)
	Wend
end sub

sub arrowKeyPress(key, amount)
	var down = 40
	var i

	UO.Press(down)

	For i = 0 To amount
		UO.Press(key)
		Wait(300)
	Next
end sub

sub journalWait(journalPattern, timeout)
	var time = 0

	Repeat
		Wait(50)
		time = time + 50
	Until UO.InJournal(journalPattern) || time > timeout
end sub

sub smelt()
	var oreType = 0x19B9

	Repeat
		UO.FindType(oreType, -1, 'my')
		UO.UseType(oreType)
		Wait(500)
	Until UO.FindCount() < 1
end sub

sub dropAllOfType(type)
	Repeat
		UO.FindType(type, -1, 'my')
		UO.MoveItem('finditem','0','ground')
		Wait(100)	
	Until UO.FindCount() < 2
end sub

sub checkStamina(food)
	If UO.Stamina < 20 Then
		UO.Usetype(food)
		UO.Usetype(food)
		UO.Usetype(food)

		While UO.Stamina < 20
			UO.Print("Stamina too low, waiting...")
			Wait(1000)
		Wend
	End if
end sub

sub waitTargetTileBelow(x, y, firstTileType, lastTileType)
	var g

	For g = firstTileType to lastTileType
		If UO.PrivateGetTile(x, y, 0 , g, g) Then
			UO.WaitTargetTile(g, x, y, 0)

			#We have successfully targeted the tile
			Return
		End If
	Next

	#If we fail, then brute force target the tile
	forceWaitTargetTileBelow(x, y)
end sub

sub forceWaitTargetTileBelow(x, y)
	var g

	For g = 0 to 10000
		If UO.PrivateGetTile(x, y, 0 , g, g) Then
			UO.WaitTargetTile(g, x, y, 0)

			Return
		End If
	Next
end sub

sub hidePlayers()
	var maleType = 0x0190
	var femaleType = 0x0191
	var guardType = 0x03DE
	
	hideFirst(maleType)
	hideFirst(femaleType)
	hideFirst(guardType)	
end sub

sub hideFirst(type)
	UO.WaitTargetGround(type)
	UO.Hide()
end sub

Mining Full Stamina.sc #

sub main()
	var shovel = 0x0F39
	var pickaxe = 0x0E85
	var fishCakeType = 0x097B
	
	#removes injection text from the screen
	UO.Set('quiet', 1)
	
	#mine a 14 by 14 square with a pickaxe, eating fish cakes when you get hungry
	mineSquare(pickaxe, fishCakeType, 14, 14)
end sub

sub mineSquare(tool, foodType, xLength, yLength)
	var mapType = 0x14ED

	var startX = UO.GetX()
	var startY = UO.GetY()
	var counter
	var currentY = 0

	var downRight = 34
	var upLeft = 36
	
	While TRUE
		dropAllOfType(mapType)

		moveTo(startX, startY + currentY, tool)

		For counter = 0 To xLength-1
			UO.Press(downRight)
			mine(tool, foodType)
		Next

		currentY = currentY + 1
		moveTo(startX + xLength-1, startY + currentY, tool)

		For counter = 0 To xLength-1
			UO.Press(upLeft)
			mine(tool, foodType)
		Next

		currentY = currentY + 1

		If currentY > yLength - 1 Then
			moveTo(startX, startY, tool)
			currentY = 0
		End If
	Wend
end sub

sub mine(tool, foodType)
	var x = UO.GetX()
	var y = UO.GetY()
	
	Repeat
		UO.WaitTargetSelf()
		
		UO.Usetype(tool)
		
		journalWait('aborted|finished', 10000)
		
		If UO.Stamina < UO.Dex - 3 Then
			UO.UseType(foodType)
			Wait(200)
		End If
	Until UO.Stamina == UO.Dex
end sub

sub moveTo(x, y, tool)
	#numpad key codes
	var upRight = 33
	var downRight = 34
	var downLeft = 35
	var upLeft = 36

	var deltaX, deltaY
	
	While UO.GetX() <> x || UO.GetY() <> y
		deltaX = x - UO.GetX()
		deltaY = y - UO.GetY()
		
		If deltaX < 0 Then
			deltaX = deltaX * -1
		End If

		If deltaY < 0 Then
			deltaY = deltaY * -1
		End If
		
		If UO.GetX() > x Then
			arrowKeyPress(upLeft, deltaX)
		Else 
		If UO.GetX() < x Then
			arrowKeyPress(downRight, deltaX)
		Else
		If UO.GetY() > y Then
			arrowKeyPress(upRight, deltaY)
		Else 
		If UO.GetY() < y Then
			arrowKeyPress(downLeft, deltaY)
		End If
		End If
		End If
		End If
	Wend
end sub

sub arrowKeyPress(key, amount)
	var down = 40
	var i

	UO.Press(down)

	For i = 0 To amount
		UO.Press(key)
		Wait(300)
	Next
end sub

sub journalWait(journalPattern, timeout)
	UO.DeleteJournal()

	var time = 0

	Repeat
		Wait(200)
		time = time + 200
	Until UO.InJournal(journalPattern) || time > timeout
end sub

sub dropAllOfType(type)
	Repeat
		UO.FindType(type, -1, 'my')
		UO.MoveItem('finditem', 0, 'ground')
		Wait(200)	
	Until UO.FindCount() < 2
end sub

mining2.sc #

sub main()
	var startX = UO.GetX()
	var startY = UO.GetY()
	var counter
	var currY = 0
	var xLength = 7
	var yLength = 6
	
	While TRUE
		moveTo(startX, startY + currY)
		For counter = 0 To xLength-1
			UO.Press(34)
			mine()
		Next
		currY = currY + 1
		moveTo(startX + xLength-1, startY + currY)
		For counter = 0 To xLength-1
			UO.Press(36)
			mine()
		Next
		currY = currY + 1
		If currY > yLength - 1 Then
			moveTo(startX, startY)
			currY = 0
		EndIf
	Wend
end sub

sub mine()
	var time
	
	UO.DeleteJournal()
	
	UO.WaitTargetSelf()
	UO.Usetype(0x0E85)
	time = 0
	Repeat
		Wait(200)
		time = time + 200
	Until UO.InJournal("You stop") || UO.InJournal("no ore") || UO.InJournal("dig anything") || time > 10000 
	If UO.InJournal("Saving World State") Then
		Repeat
			wait(200)
		Until UO.InJournal("World Saved")
	End If
	If UO.InJournal("no ore") || UO.InJournal("dig anything") Then
		wait(1000)
	End If
	If UO.Stamina < 10 Then
		UO.Usetype(0x097B)
		While UO.Stamina < 10
			Wait(200)
		Wend
	End if
	UO.DeleteJournal()
end sub

sub moveTo(x,y)
	var deltaX
	var deltaY
	
	While NOT UO.GetX() == x || NOT UO.GetY() == y
		deltaX = x - UO.GetX()
		deltaY = y - UO.GetY()
		UO.Print(str(deltaX))
		UO.Print(str(deltaY))
		
		If deltaX < 0 Then
			deltaX = deltaX * -1
		End If
		If deltaY < 0 Then
			deltaY = deltaY * -1
		End If
		
		If UO.GetX() > x Then
			keyPress(36, deltaX)
		Else 
		If UO.GetX() < x Then
			keyPress(34, deltaX)
		Else
		If UO.GetY() > y Then
			keyPress(33, deltaY)
		Else 
		If UO.GetY() < y Then
			keyPress(35, deltaY)
		EndIf
		EndIf
		EndIf
		EndIf
		Wait(1000)
	Wend
end sub

sub keyPress(key, amount)
	var i
	UO.Press(40)
	For i = 0 To amount
		UO.Press(key)
		Wait(300)
	Next
end sub

sub smelt()
	Repeat
		UO.FindType(0x19B9, -1, 'my')
		UO.UseType(0x19B9)
		Wait(500)
	Until UO.FindCount() == 0
end sub

mining 3.sc #

#Start at 2572 482
sub main()
	var time
	var x
	var y
	var i
	var xStart = UO.GetX() - 2
	var yStart = UO.GetY() - 2
	var tileNum = 0

	Repeat
		i = 0
		tileNum = tileNum + 1
		For x = xStart To xStart + 4
			For y = yStart To yStart + 4
				UO.DeleteJournal()
				UO.Print("Mining at spot: " + STR(i))
				UO.Print("X: " + STR(x) + " Y: " + STR(y) + " GFX: " + "?")
				UO.WaitTargetTile(1339, x, y, 0)
				i = i + 1
				UO.UseType(0x0E85)
				time = 0
				Repeat
					wait(200)
					time = time + 200
				Until UO.InJournal("no more") OR UO.InJournal("You stop") OR UO.InJournal("tool") OR UO.InJournal("see that") OR time > 100000
				
				UO.FindType(0x19B9, -1, 'my')
				While UO.FindCount() > 0
					UO.WaitTargetObject(0x6AE17633)
					UO.DeleteJournal()
					UO.UseType(0x19B9)
					
					time = 0
					Repeat
						wait(200)
						time = time + 200
					Until UO.InJournal("You create") OR time > 5000
					UO.FindType(0x19B9, -1, 'my')
				Wend
			Next
		Next
		UO.Say("Free ore at my feet!")
	Until FALSE
end sub

mining 4.sc #

sub main()
	var time
	var x
	var y
	var z = UO.GetZ()
	var i
	var xStart = UO.GetX() - 2
	var yStart = UO.GetY() - 2
	var tileNum = 0

	Repeat
		i = 0
		tileNum = tileNum + 1
		For x = xStart To xStart + 4
			For y = yStart To yStart + 4
				UO.DeleteJournal()
				UO.Print("Mining at spot: " + STR(i + 1))
				UO.Print("X: " + STR(x) + " Y: " + STR(y) + " GFX: " + "?")
				UO.WaitTargetTile(1339, x, y, z)
				i = i + 1
				UO.UseType(0x0F39)
				time = 0
				Repeat
					wait(200)
					time = time + 200
				Until UO.InJournal("no more") || UO.InJournal("You stop") || UO.InJournal("tool") || UO.InJournal("see that") || time > 100000
			Next
		Next
	Until FALSE
end sub

mining 6.sc #

sub main()
	var startX = UO.GetX()
	var startY = UO.GetY()
	var counter
	var currY = 0
	var xLength = 6
	var yLength = 6

	#UO.Set("quiet", "1")
	UO.Set("quiet", "0")

	While TRUE
		#dropMaps()
		moveTo(startX, startY + currY)
		For counter = 0 To xLength-1
			UO.Press(34)
			mine()
		Next
		currY = currY + 1
		moveTo(startX + xLength-1, startY + currY)
		For counter = 0 To xLength-1
			UO.Press(36)
			mine()
		Next
		currY = currY + 1
		If currY > yLength - 1 Then
			moveTo(startX, startY)
			currY = 0
		EndIf
	Wend
end sub

sub mine()
	var time, g, x, y
	x = UO.GetX()
	y = UO.GetY()
	
	UO.DeleteJournal()
	For g = 1339 to 1360
		If UO.PrivateGetTile(x, y, 0 , g, g) Then
			UO.WaitTargetTile(g, x, y, 0)
			goto ContinueToMine
		End If
	Next
	ContinueToMine:
	UO.Print("Graphic is " + STR(g))
	
	#UO.WaitTargetSelf()
	UO.Usetype(0x0E85)
	time = 0
	Repeat
		Wait(50)
		time = time + 50
	Until UO.InJournal("Select a") || time > 5000
	time = 0
	Repeat
		Wait(200)
		time = time + 200
	Until UO.InJournal("no more|dig anything|You stop|tool|see that") || time > 10000
	
	If UO.InJournal("no ore|dig anything") Then
		wait(1000)
	End If
	If UO.Stamina < 10 Then
		UO.Usetype(0x097B)
		While UO.Stamina < 10
			UO.Print("Stamina too low, waiting...")
			Wait(1000)
		Wend
	End if
	UO.DeleteJournal()
end sub

sub moveTo(x,y)
	var deltaX
	var deltaY
	
	While NOT UO.GetX() == x || NOT UO.GetY() == y
		deltaX = x - UO.GetX()
		deltaY = y - UO.GetY()
		UO.Print(str(deltaX))
		UO.Print(str(deltaY))
		
		If deltaX < 0 Then
			deltaX = deltaX * -1
		End If
		If deltaY < 0 Then
			deltaY = deltaY * -1
		End If
		
		If UO.GetX() > x Then
			keyPress(36, deltaX)
		Else 
		If UO.GetX() < x Then
			keyPress(34, deltaX)
		Else
		If UO.GetY() > y Then
			keyPress(33, deltaY)
		Else 
		If UO.GetY() < y Then
			keyPress(35, deltaY)
		EndIf
		EndIf
		EndIf
		EndIf
		Wait(1000)
	Wend
end sub

sub keyPress(key, amount)
	var i
	UO.Press(40)
	For i = 0 To amount
		UO.Press(key)
		Wait(300)
	Next
end sub

sub smelt()
	Repeat
		UO.FindType(0x19B9, -1, 'my')
		UO.UseType(0x19B9)
		Wait(500)
	Until UO.FindCount() == 0
end sub

sub dropMaps()
	UO.FindType(0x14ED, -1, 'my')
	While UO.FindCount() > 0
		UO.MoveItem('finditem','0','ground')
		Wait(100)
		UO.FindType(0x14ED, -1, 'my')
	Wend
end sub

mining 10.sc #

sub main() 
var mloop
var walkback 
mloop=0 
walkback=0 
start: 

if mloop<=1 then #less than  
UO.Exec('usetype pick')    
wait(2000)
UO.LClick(380,312) 
mloop=mloop+1 
wait(7500) 
end if 

if mloop>=1 then #greater than
UO.Press(34) 
wait(1500) 
mloop=0 
walkback=walkback+1 
end if 

if walkback>=18 then #greater than or equil to
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500) 
UO.Press(36) 
wait(500)
UO.Press(34) 
wait(500) 
walkback=0 
end if 

GOTO start 
end sub 

mining corsairs.sc #

################################
# corsairs el leeto mining script
# use recordpath to record a MoveArrayX/Y array
# msn [email protected]
# icq 59272943 
# august 2004
###############################
sub main()
var ArraySize=200,MyX,MyY,i
dim MoveArrayX[200]
dim MoveArrayY[200]

MoveArrayX[0]=4307
MoveArrayY[0]=3734
MoveArrayX[1]=4307
MoveArrayY[1]=3733
MoveArrayX[2]=4306
MoveArrayY[2]=3733
MoveArrayX[3]=4306
MoveArrayY[3]=3732
MoveArrayX[4]=4305
MoveArrayY[4]=3732
MoveArrayX[5]=4304
MoveArrayY[5]=3732
MoveArrayX[6]=4303
MoveArrayY[6]=3732
MoveArrayX[7]=4302
MoveArrayY[7]=3732
MoveArrayX[8]=4301
MoveArrayY[8]=3732
MoveArrayX[9]=4300
MoveArrayY[9]=3732
MoveArrayX[10]=4299
MoveArrayY[10]=3732
MoveArrayX[11]=4298
MoveArrayY[11]=3732
MoveArrayX[12]=4297
MoveArrayY[12]=3732
MoveArrayX[13]=4296
MoveArrayY[13]=3732
MoveArrayX[14]=4295
MoveArrayY[14]=3732
MoveArrayX[15]=4294
MoveArrayY[15]=3732
MoveArrayX[16]=4293
MoveArrayY[16]=3732
MoveArrayX[17]=4292
MoveArrayY[17]=3732
MoveArrayX[18]=4291
MoveArrayY[18]=3732
MoveArrayX[19]=4290
MoveArrayY[19]=3732
MoveArrayX[20]=4289
MoveArrayY[20]=3732
MoveArrayX[21]=4288
MoveArrayY[21]=3732
MoveArrayX[22]=4287
MoveArrayY[22]=3733
MoveArrayX[23]=4286
MoveArrayY[23]=3733
MoveArrayX[24]=4285
MoveArrayY[24]=3733
MoveArrayX[25]=4284
MoveArrayY[25]=3733
MoveArrayX[26]=4283
MoveArrayY[26]=3734
MoveArrayX[27]=4282
MoveArrayY[27]=3734
MoveArrayX[28]=4281
MoveArrayY[28]=3735
MoveArrayX[29]=4280
MoveArrayY[29]=3735
MoveArrayX[30]=4279
MoveArrayY[30]=3736
MoveArrayX[31]=4278
MoveArrayY[31]=3737
MoveArrayX[32]=4277
MoveArrayY[32]=3737
MoveArrayX[33]=4276
MoveArrayY[33]=3737
MoveArrayX[34]=4275
MoveArrayY[34]=3737
MoveArrayX[35]=4274
MoveArrayY[35]=3737
MoveArrayX[36]=4273
MoveArrayY[36]=3737
MoveArrayX[37]=4272
MoveArrayY[37]=3738
MoveArrayX[38]=4271
MoveArrayY[38]=3738
MoveArrayX[39]=4270
MoveArrayY[39]=3738
MoveArrayX[40]=4269
MoveArrayY[40]=3738
MoveArrayX[41]=4269
MoveArrayY[41]=3737
MoveArrayX[42]=4268
MoveArrayY[42]=3737
MoveArrayX[43]=4267
MoveArrayY[43]=3737
MoveArrayX[44]=4266
MoveArrayY[44]=3737
MoveArrayX[45]=4265
MoveArrayY[45]=3736
MoveArrayX[46]=4265
MoveArrayY[46]=3735
MoveArrayX[47]=4264
MoveArrayY[47]=3735
MoveArrayX[48]=4263
MoveArrayY[48]=3735
MoveArrayX[49]=4262
MoveArrayY[49]=3735
MoveArrayX[50]=4262
MoveArrayY[50]=3734
MoveArrayX[51]=4262
MoveArrayY[51]=3733
MoveArrayX[52]=4261
MoveArrayY[52]=3733
MoveArrayX[53]=4260
MoveArrayY[53]=3733
MoveArrayX[54]=4259
MoveArrayY[54]=3733
MoveArrayX[55]=4258
MoveArrayY[55]=3733
MoveArrayX[56]=4257
MoveArrayY[56]=3733
MoveArrayX[57]=4256
MoveArrayY[57]=3733
MoveArrayX[58]=4255
MoveArrayY[58]=3733
MoveArrayX[59]=4254
MoveArrayY[59]=3733
MoveArrayX[60]=4253
MoveArrayY[60]=3733
MoveArrayX[61]=4252
MoveArrayY[61]=3733
MoveArrayX[62]=4251
MoveArrayY[62]=3733
MoveArrayX[63]=4250
MoveArrayY[63]=3733
MoveArrayX[64]=4249
MoveArrayY[64]=3733
MoveArrayX[65]=4248
MoveArrayY[65]=3733
MoveArrayX[66]=4247
MoveArrayY[66]=3733
MoveArrayX[67]=4246
MoveArrayY[67]=3733
MoveArrayX[68]=4245
MoveArrayY[68]=3733
MoveArrayX[69]=4244
MoveArrayY[69]=3733
MoveArrayX[70]=4243
MoveArrayY[70]=3733
MoveArrayX[71]=4242
MoveArrayY[71]=3734
MoveArrayX[72]=4241
MoveArrayY[72]=3734
MoveArrayX[73]=4241
MoveArrayY[73]=3735
MoveArrayX[74]=4241
MoveArrayY[74]=3736
MoveArrayX[75]=4240
MoveArrayY[75]=3736
MoveArrayX[76]=4239
MoveArrayY[76]=3736
MoveArrayX[77]=4238
MoveArrayY[77]=3736
MoveArrayX[78]=4237
MoveArrayY[78]=3737
MoveArrayX[79]=4236
MoveArrayY[79]=3738
MoveArrayX[80]=4235
MoveArrayY[80]=3739
MoveArrayX[81]=4234
MoveArrayY[81]=3739
MoveArrayX[82]=4233
MoveArrayY[82]=3739
MoveArrayX[83]=4233
MoveArrayY[83]=3740
MoveArrayX[84]=4232
MoveArrayY[84]=3740
MoveArrayX[85]=4231
MoveArrayY[85]=3740
MoveArrayX[86]=4230
MoveArrayY[86]=3741
MoveArrayX[87]=4229
MoveArrayY[87]=3742
MoveArrayX[88]=4228
MoveArrayY[88]=3743
MoveArrayX[89]=4227
MoveArrayY[89]=3744
MoveArrayX[90]=4227
MoveArrayY[90]=3745
MoveArrayX[91]=4227
MoveArrayY[91]=3746
MoveArrayX[92]=4227
MoveArrayY[92]=3747
MoveArrayX[93]=4227
MoveArrayY[93]=3748
MoveArrayX[94]=4226
MoveArrayY[94]=3748
MoveArrayX[95]=4226
MoveArrayY[95]=3749
MoveArrayX[96]=4226
MoveArrayY[96]=3750
MoveArrayX[97]=4226
MoveArrayY[97]=3751
MoveArrayX[98]=4226
MoveArrayY[98]=3752
MoveArrayX[99]=4226
MoveArrayY[99]=3753
MoveArrayX[100]=4226
MoveArrayY[100]=3752
MoveArrayX[101]=4226
MoveArrayY[101]=3751
MoveArrayX[102]=4226
MoveArrayY[102]=3750
MoveArrayX[103]=4226
MoveArrayY[103]=3749
MoveArrayX[104]=4226
MoveArrayY[104]=3748
MoveArrayX[105]=4227
MoveArrayY[105]=3747
MoveArrayX[106]=4227
MoveArrayY[106]=3746
MoveArrayX[107]=4228
MoveArrayY[107]=3745
MoveArrayX[108]=4228
MoveArrayY[108]=3744
MoveArrayX[109]=4229
MoveArrayY[109]=3743
MoveArrayX[110]=4229
MoveArrayY[110]=3742
MoveArrayX[111]=4230
MoveArrayY[111]=3741
MoveArrayX[112]=4231
MoveArrayY[112]=3740
MoveArrayX[113]=4232
MoveArrayY[113]=3740
MoveArrayX[114]=4233
MoveArrayY[114]=3740
MoveArrayX[115]=4233
MoveArrayY[115]=3739
MoveArrayX[116]=4234
MoveArrayY[116]=3738
MoveArrayX[117]=4235
MoveArrayY[117]=3738
MoveArrayX[118]=4236
MoveArrayY[118]=3738
MoveArrayX[119]=4237
MoveArrayY[119]=3738
MoveArrayX[120]=4238
MoveArrayY[120]=3737
MoveArrayX[121]=4238
MoveArrayY[121]=3736
MoveArrayX[122]=4239
MoveArrayY[122]=3736
MoveArrayX[123]=4240
MoveArrayY[123]=3736
MoveArrayX[124]=4241
MoveArrayY[124]=3736
MoveArrayX[125]=4242
MoveArrayY[125]=3736
MoveArrayX[126]=4241
MoveArrayY[126]=3736
MoveArrayX[127]=4241
MoveArrayY[127]=3735
MoveArrayX[128]=4241
MoveArrayY[128]=3734
MoveArrayX[129]=4242
MoveArrayY[129]=3734
MoveArrayX[130]=4243
MoveArrayY[130]=3734
MoveArrayX[131]=4244
MoveArrayY[131]=3734
MoveArrayX[132]=4245
MoveArrayY[132]=3734
MoveArrayX[133]=4246
MoveArrayY[133]=3734
MoveArrayX[134]=4246
MoveArrayY[134]=3733
MoveArrayX[135]=4247
MoveArrayY[135]=3732
MoveArrayX[136]=4248
MoveArrayY[136]=3732
MoveArrayX[137]=4249
MoveArrayY[137]=3732
MoveArrayX[138]=4250
MoveArrayY[138]=3732
MoveArrayX[139]=4251
MoveArrayY[139]=3732
MoveArrayX[140]=4252
MoveArrayY[140]=3732
MoveArrayX[141]=4253
MoveArrayY[141]=3732
MoveArrayX[142]=4254
MoveArrayY[142]=3732
MoveArrayX[143]=4255
MoveArrayY[143]=3733
MoveArrayX[144]=4256
MoveArrayY[144]=3733
MoveArrayX[145]=4257
MoveArrayY[145]=3733
MoveArrayX[146]=4258
MoveArrayY[146]=3733
MoveArrayX[147]=4259
MoveArrayY[147]=3733
MoveArrayX[148]=4260
MoveArrayY[148]=3733
MoveArrayX[149]=4261
MoveArrayY[149]=3733
MoveArrayX[150]=4262
MoveArrayY[150]=3733
MoveArrayX[151]=4263
MoveArrayY[151]=3734
MoveArrayX[152]=4264
MoveArrayY[152]=3735
MoveArrayX[153]=4265
MoveArrayY[153]=3735
MoveArrayX[154]=4266
MoveArrayY[154]=3736
MoveArrayX[155]=4267
MoveArrayY[155]=3737
MoveArrayX[156]=4268
MoveArrayY[156]=3737
MoveArrayX[157]=4269
MoveArrayY[157]=3737
MoveArrayX[158]=4270
MoveArrayY[158]=3737
MoveArrayX[159]=4271
MoveArrayY[159]=3737
MoveArrayX[160]=4272
MoveArrayY[160]=3737
MoveArrayX[161]=4273
MoveArrayY[161]=3737
MoveArrayX[162]=4274
MoveArrayY[162]=3737
MoveArrayX[163]=4275
MoveArrayY[163]=3737
MoveArrayX[164]=4276
MoveArrayY[164]=3737
MoveArrayX[165]=4277
MoveArrayY[165]=3737
MoveArrayX[166]=4278
MoveArrayY[166]=3737
MoveArrayX[167]=4279
MoveArrayY[167]=3737
MoveArrayX[168]=4279
MoveArrayY[168]=3736
MoveArrayX[169]=4280
MoveArrayY[169]=3736
MoveArrayX[170]=4280
MoveArrayY[170]=3735
MoveArrayX[171]=4281
MoveArrayY[171]=3735
MoveArrayX[172]=4282
MoveArrayY[172]=3735
MoveArrayX[173]=4282
MoveArrayY[173]=3734
MoveArrayX[174]=4283
MoveArrayY[174]=3733
MoveArrayX[175]=4284
MoveArrayY[175]=3733
MoveArrayX[176]=4285
MoveArrayY[176]=3733
MoveArrayX[177]=4286
MoveArrayY[177]=3733
MoveArrayX[178]=4287
MoveArrayY[178]=3733
MoveArrayX[179]=4288
MoveArrayY[179]=3733
MoveArrayX[180]=4288
MoveArrayY[180]=3732
MoveArrayX[181]=4289
MoveArrayY[181]=3732
MoveArrayX[182]=4290
MoveArrayY[182]=3732
MoveArrayX[183]=4291
MoveArrayY[183]=3732
MoveArrayX[184]=4292
MoveArrayY[184]=3732
MoveArrayX[185]=4293
MoveArrayY[185]=3732
MoveArrayX[186]=4294
MoveArrayY[186]=3732
MoveArrayX[187]=4295
MoveArrayY[187]=3732
MoveArrayX[188]=4296
MoveArrayY[188]=3732
MoveArrayX[189]=4297
MoveArrayY[189]=3732
MoveArrayX[190]=4298
MoveArrayY[190]=3732
MoveArrayX[191]=4299
MoveArrayY[191]=3732
MoveArrayX[192]=4300
MoveArrayY[192]=3732
MoveArrayX[193]=4301
MoveArrayY[193]=3732
MoveArrayX[194]=4302
MoveArrayY[194]=3732
MoveArrayX[195]=4303
MoveArrayY[195]=3732
MoveArrayX[196]=4304
MoveArrayY[196]=3732
MoveArrayX[197]=4305
MoveArrayY[197]=3732
MoveArrayX[198]=4306
MoveArrayY[198]=3732
MoveArrayX[199]=4307
MoveArrayY[199]=3733
MoveArrayX[200]=4307
MoveArrayY[200]=3734


start:


	for i=0 to ArraySize		

		if MoveArrayX[i] AND MoveArrayY[i] then
			uo.print(STR(MoveArrayX[i]) + " " + STR(MoveArrayY[i]))
			gotoxy(MoveArrayX[i],MoveArrayY[i])
			rapetiles()
		endif

		wait(50)
		
	next

goto start
end sub



sub randomxy(num,myx,myy,myz)
	
	
	myx=myx
	myy=myy
	
	return str(myx)+" "+str(myy)+" "+str(myz)	

	
	
	wait(100)

end sub





sub gotoxy(x,y) 
var prec=0
var ld=0,ldc=0 
var dx,dy 
var mx,my 
var ox,oy,mk,k 
var mDelay=150 			#delay for sending steps
#uo.print(">") 
uo.track("1",str(x),str(y)) 
start: 
mx=UO.GetX() 
my=UO.GetY() 
dx=mx-x 
if dx<0 then 
dx=0-dx 
endif 
dy=my-y 
if dy<0 then 
dy=0-dy 
endif 
if dy>dx then 
dx=dy 
end if 
if dx<=prec then 
return 
end if 
if not ldc then 
#uo.print(STR(dx)) 
end if 
if dx<3 then 
mk=70 
else 
mk=15 
end if 

ox=mx 
oy=my 
for k=1 to mk 
mx=UO.GetX() 
my=UO.GetY() 
if mx<>ox or my<>oy then 
goto sdidapl 
end if 
wait(10) 
next 
sdidapl: 

mx=UO.GetX() 
my=UO.GetY() 
dx=mx-x 
if dx<0 then 
dx=0-dx 
endif 
dy=my-y 
if dy<0 then 
dy=0-dy 
endif 
if dy>dx then 
dx=dy 
end if 
mx=UO.GetX() 
my=UO.GetY() 
if dx<=prec then 
return 
end if 
if ld==dx then 
ldc=ldc+1 
if ldc>100 then 
uo.print("Can not reach location!") 
return 
end if 
else 
ld=dx 
end if 
mx=UO.GetX() 
my=UO.GetY() 
if mx==x then 
if my==y then 
return 
endif 
if my>y then 
#UO.Print("UR") 
UO.Press(33) 
goto start 
endif 
#UO.Print("DL") 
UO.Press(35) 
goto start 
end if 
if mx<x then 
if my>y then 
#UO.Print("R") 
UO.Press(39) 
goto start 
endif 
if my==y then 
#UO.Print("DR") 
UO.Press(34) 
goto start 
endif 
#UO.Print("D") 
UO.Press(40) 
goto start 
end if 
if my<y then 
#UO.Print("L") 
UO.Press(37) 
goto start 
endif 
if my==y then 
#UO.Print("LU") 
UO.Press(36) 
goto start 
endif 
#UO.Print("U") 
UO.Press(38) 
goto start 
end sub 

sub recordarray()
	UO.Print("1. Try to avoid impassable objects like stalagmites by staying away by 2 tiles")
	UO.Print("2. It is good idea to walk back to original start location or close to it to avoid script stuff ups")
	UO.Print("3. Tile array is output to text dialog")
	UO.TextOpen()
	var mX,mY,lX,lY,count=0
	UO.DeleteJournal()
	
	repeat
		wait(10)
		mX=UO.GetX()
		mY=UO.GetY()
		
			if lX<>mX AND lY<>mY OR lX<>mX OR lY<>mY then
				UO.TextPrint("MoveArrayX["+str(count)+"]="+str(mX))
				UO.TextPrint("MoveArrayY["+str(count)+"]="+str(mY))
				count=count+1
			endif
			
			
			
		lX=mX
		lY=mY
		
		
	until UO.InJournal("stop")
end sub

sub rapetiles()

	var mx,my,mz,string,count=0
	mx=UO.GetX()
	my=UO.GetY()
	mz=UO.GetZ()

	
	
		string=randomxy(count,mx,my,mz)
		rapetile(string)
		
	
	
end sub

sub mineonce(string)
	var fcount
	start:

	UO.DeleteJournal()
	
	UO.Exec("waittargettile 1339 "+string)

	uo.exec("findtype 0x0F39 0x0000 my")
	fcount=UO.FindCount()
	
	if fcount==0 then
		uo.useobject(UO.ObjAtLayer('Bpack'))
		wait(5000)
	endif
    uo.exec("findtype 0x0F39 0x0000 my")
	UO.Useobject("finditem")
	
	repeat
	wait(10)
	until UO.InJournal("stop mining") OR UO.InJournal("Reconnected.") OR UO.InJournal("too far") OR UO.InJournal("Welcome to Ultima Online!")

end sub

sub rapetile(string)
	
	repeat
	mineonce(string)
	wait(10)
	until UO.InJournal("no ore") OR UO.InJournal("Reconnected.") OR UO.InJournal("too far")

end sub


sub dumpstuff()
var fcount
var ArraySize=49
dim DropArray[49]
#graphic color
DropArray[0]="0xabcd exfghi"
DropArray[1]="0x19b9 0x0000"
DropArray[2]="0x19b9 0x045e"
DropArray[3]="0x19b9 0x03ea"
DropArray[4]="0x19b9 0x0602"
DropArray[5]="0x19b9 0x0455"
DropArray[6]="0x19b9 0x06b8"
DropArray[7]="0x19b9 0x1159"
DropArray[8]="0x19b9 0x04df"
DropArray[9]="0x19b9 0x1111"
DropArray[10]="0x19b9 0x1158"
DropArray[11]="0x19b9 0x0383"
DropArray[12]="0x19b9 0x1160"
DropArray[13]="0x19b9 0x1223"
DropArray[14]="0x19b9 0x1134"
DropArray[15]="0x19b9 0x1152"
DropArray[16]="0x19b9 0x1001"
DropArray[17]="0x19b9 0x1155"
DropArray[18]="0x19b9 0x0633"
DropArray[19]="0x19b9 0x1131"
DropArray[20]="0x19b9 0x0852"
DropArray[21]="0x19b9 0x1154"
DropArray[22]="0x19b9 0x1105"
DropArray[23]="0x19b9 0x1209"
DropArray[24]="0x19b9 0x049e"
DropArray[25]="0x19b9 0x0499"
DropArray[26]="0x19b9 0x049c"
DropArray[27]="0x19b9 0x048b"
DropArray[28]="0x19b9 0x0500"
DropArray[29]="0x19b9 0x0501"
DropArray[30]="0x19b9 0x0492"
DropArray[31]="0x19b9 0x049f"
DropArray[32]="0x3885 0x1171"
DropArray[33]="0x3877 0x1172"
DropArray[34]="0x3873 0x1176"
DropArray[35]="0x19b9 0x0482"
DropArray[36]="0x19b9 0x0279"
DropArray[37]="0x19b9 0x04b9"
DropArray[38]="0x19b9 0x0480"
DropArray[39]="0x19b9 0x046e"
DropArray[40]="0x19b9 0x0451"
DropArray[41]="0x19b9 0x04c7"
DropArray[42]="0x19b9 0x0457"
DropArray[43]="0x19b9 0x017f"
DropArray[44]="0x19b9 0x046b"
DropArray[45]="0x19b9 0x0483"
DropArray[46]="0x19b9 0x0487"
DropArray[47]="0x19b9 0x0486"
DropArray[48]="0x19b9 0x03E9"
DropArray[49]="0x19b9 0x0488"

for var i=0 to ArraySize

	UO.exec("findtype " + DropArray[i] + " my")
	fcount=UO.FindCount()

	if fcount==1 then
		uo.exec("moveitem finditem 60000 dumpcrate")
	endif

	if fcount>1 then
		uo.exec("moveitem finditem 60000 dumpcrate")
	endif
	
	wait(100)

next

end sub

sub where()
#########################
# |x:2857               #
# |y:2241               #
#                       #
#                       #
#                       #
#               |x:2869 #
#               |y:2253 #
#########################


var x=UO.GetX()
var y=UO.GetY()

x=UO.GetX()
y=UO.GetY()

if x==2521 AND y==191 then   #TILE NEXT TO METAL CHEST
	return "DTILE"
endif

if x>=2555 AND y>=450 AND x<=2581 AND y<=500 then
	return "MINE"
endif

if x>=2515 AND y>=185 AND x<=2528 AND y<=196 then
	return "TOWER"
endif

wait(250)



end sub

sub recall(rid)

	var x=UO.GetX(),y=UO.GetY(),x2=UO.GetX(),y2=UO.GetY()			#do not modify these
	var RecallDelay=2500 		 #Taken from zh3 scripts
	var timeout=200				
	var counter=0				
	var Msg.Failure="failure"
	var Msg.Recall="recalled"
	var Msg.Error="error"
	var Msg.NoCharges="nocharges"

	UO.DeleteJournal()

	uo.exec("set norbcheck  1")
	uo.exec("set norbcalc 1")

	UO.Recall("runebook",int(rid))
	uo.exec("moveoff")

	repeat
		x2=UO.GetX()
		y2=UO.GetY()
		
		wait(100)
		counter=counter+1
	until x2<>x OR y2<>y OR counter>=timeout OR UO.InJournal("out of charges.")

	if UO.InJournal("out of charges.") then
		uo.exec("moveon")
		return Msg.NoCharges
	endif
	
	if counter>=timeout then
		uo.exec("moveon")
		return Msg.Failure
	else
		uo.exec("moveon")
		return Msg.Recall
	endif
	

	

	uo.exec("moveon")
	
	return Msg.Error


end sub

sub fillrbook()
	var fcount
	var tmp
	var wDelay=1000  #action delay

	UO.Exec("findtype 0x1F4C 0x0000 my")
	fcount=UO.FindCount()
	if fcount>=1 then
		uo.print("found recalls, trying to fill book!")
		UO.Exec("moveitem finditem 60000 runebook")
	endif
	
	wait(wDelay)

	UO.Exec("findtype 0x1F4C 0x0000 dumpcrate")
	fcount=UO.FindCount()
	if fcount>=1 then
		uo.print("found recalls, trying to fill book!")
		UO.Exec("moveitem finditem 60000 runebook")
	endif

	wait(wDelay)
	
	UO.Exec("findtype 0x1F4C 0x0000 my")
	fcount=UO.FindCount()
	
	if fcount>=1 then
	
	uo.print("moving recalls to dumpchest")
	
		if fcount==1 then
				UO.Exec("findtype 0x1F4C 0x0000 my")
				fcount=UO.FindCount()
				tmp=UO.Count("0x1F4C")-5
				UO.Exec("moveitem finditem "+str(tmp)+" dumpcrate")
				wait(wDelay)
				return
		endif



		while fcount>=3
			UO.Exec("findtype 0x1F4C 0x0000 my")
			fcount=UO.FindCount()
			tmp=UO.Count("0x1F4C")
			UO.Exec("moveitem finditem "+str(tmp)+" dumpcrate")
			wait(wDelay)
		wend
		

		UO.Exec("findtype 0x1F4C 0x0000 my")
		fcount=UO.FindCount()
		tmp=UO.Count("0x1F4C")-5
		UO.Exec("moveitem finditem "+str(tmp)+" dumpcrate")
		wait(wDelay)
		return
	endif

	UO.Print("FUCK!")

end sub

sub food()
var msg

UO.DeleteJournal()
wait(250)
UO.ServerPrint(".hungry")
wait(250)
if UO.InJournal("You are absolutely stuffed!")==false then
repeat
	uo.usetype("food")
	wait(500)
until UO.InJournal("You're stuffed!")
endif

end sub

mining 16.sc #

sub main()

var la
var boobs
  
Repeat

  la = 0
  boobs = 0

  Repeat
    Repeat 
      UO.Press(37)
      UO.Print("Going Left. Tile Number " + str(la + 1))
	  mine()
	  la = la + 1
    Until la == 5
  
    UO.Press(40)
    UO.Press(40)
  
    Repeat
      UO.Press(39)
      UO.Print("Going Right. Tile Number " + str(la))
  	  mine()
	  la = la - 1
    Until la == 0

	If not boobs == 1 Then
      UO.Press(40)
      UO.Press(40)
    Endif
    
	boobs = boobs + 1
	
  Until boobs == 2
  
  UO.Print("Going up!")
  UO.Press(38)
  UO.Press(38)
  UO.Press(38)
  UO.Press(38)

Until FALSE

end sub

sub mine()
	var time
	UO.WaitTargetSelf()
	UO.Usetype(0x0E85)
	time = 0
	UO.DeleteJournal()
	UO.Say(".hungry")
	Repeat
		Wait(200)
		time = time + 200
	Until UO.InJournal("You stop") || UO.InJournal("no ore") || UO.InJournal("dig anything") || time > 10000 
	time = 0
	If UO.InJournal("no ore") || UO.InJournal("dig anything") Then
		wait(1000)
	End If
	If NOT UO.InJournal("stuffed") AND UO.Stamina < 10 Then
		UO.Usetype(0x097B)
	End if
	UO.DeleteJournal()
end sub

sub smelt()
  Repeat
	UO.Usetype(0x19b9)
	Wait(300)
  Until FALSE
end sub

Ultimate Mining Script.sc #

############################################################ 
#              Ultimate Mining Script! v1.11 
#                    by  Hephaisto 
#                     04/9/2003 
# Special Thanks to Voyta for ideas! 
############################################################ 
# 
#=== Main Idea 
#   First of all, user records a path inside the mine,    
#   then... the script follows this path mining under 
#   user's position each step. 
# 
#=== Possible Upgrades 
#   - Recalling between mines (at least in my shard, this 
#     macro mines faster than the mine regeneration rate, 
#     even in the biggest mines). 
#   - Override using of setcatchbag. Considered illegal 
#     in most of shards. First idea is to let the macro 
#     walk to a house and drop the ore there. UNFINISHED! 
#   - Correcting the lang... my englis is poor *lol* 
# 
#=== How to setup (it isn't that difficult) 
#   1. Create an Object TYPE called "pickaxe", init 
#       it to your mining tool. 
#   2. In my shard, mining time of a spot never takes 
#      more than 5 seconds. If in yours this time can 
#      be longer, change the maxMineTime var on the 
#      mine_spot sub. 
#   3. If you wish to use the "setCatchBag" thing, 
#      create an injection OBJECT called "oresBag", 
#      and set it to the container in the bank (old 
#      spheres only) or in you pack wich will store 
#      the ores. 
#   4. If you want to cycle the path (neverending 
#      mining, till you stop the macro), set the 
#      value of "cycle" variable in the go_mining 
#      sub to 1. 
# 
#=== Action starts! How to record the path?! 
#   1. Go to the starting location (have to remember it!) 
#      and execute the record_path sub. 
#   2. Walk normally all over where you you want to 
#      mine later (char will follow YOUR path, try to 
#      repeat as low spots as you can) 
#   3. When you're done, just say "stop" 
#   4. Your path is in the textWindow! Copy it to 
#      the 'Var path="xxxx"' on the go_mining sub, where 
#      xxxx is your path. 
# 
#       IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT! 
#   The path is a fucking long string :P 
#   If you want to cycle this path, make sure it ends 
#   EXACTLY where it stats! (no need to look at same dir) 
# 
#=== Hardcore Action time! Let's rock! 
#   1. Go to the starting position of your path. 
#   2. Execute the go_mining function! 
#   3. Let the time do his work, woh0h0h0h0! 
# 
#=== Considerations 
#   This macro NEVER uses the mouse! Why? This way you 
#   can use your comp while it's working. You can even 
#   use multiclient and have as many chars mining as you 
#   want. 
#   I use it to mine with one char while I play with my 
#   main char. 

############################################################ 
#   Main Mining Function! Conf. Needed (look above) 
############################################################ 
sub go_mining() 
   var cycle=0 
   var path="l7el9wl8ek" 
   var test=0 
   var i=0 
   var j 
   UO.SetCatchBag("oresBag") 
   UO.DeleteJournal()    

   While i<LEN(path) 
      if VAL(path[i]) then 
         j=VAL(path[i]) 
         i=i+1 
      else 
         j=1 
      endif 

      Repeat 
         if test<>1 then 
            UO.DeleteJournal() 
            mine_spot() 
         end if        

         UO.Print("New Location!") 
         if not make_step(path[i]) then 
            UO.Print("Probably Stuck!") 
            UO.Print("Hope it is a Worldsave") 
         endif 
         j=j-1 
      Until j==0 
        
      i = i + 1 
      if cycle && i==LEN(path) then 
         i=0 
      endif 
   Wend 
end sub 

############################################################ 
#   Auxilliar Function. Little mod needed (look above) 
############################################################ 
sub mine_spot() 
   var maxMineTime=5000 
   var times=0 
   var timeout=0 
   While UO.InJournal("There is no")==0 
   UO.Print("Mining time!") 
   UO.DeleteJournal() 
   UO.WaitTargetTile("1339",STR(UO.GetX()),STR(UO.GetY()),"0") 
   UO.UseType("pickaxe") 
   timeout=0 
   times = times +1 
   if times>20 then 
      wait(maxMineTime) 
      times = 0 
   endif 
   Repeat 
      timeout=timeout+200 
      Wait(200) 
      #UO.Print("Waiting...") 
      Until UO.InJournal("You put") OR UO.InJournal("There is no") OR timeout>maxMineTime 
   Wend 
   return 0 
end sub 

############################################################ 
#   Main Path-Recording function! 
############################################################ 
sub record_path() 
   var x 
   var y 
   var path="" 
   UO.DeleteJournal() 
   Repeat 
      x=UO.GetX() 
      y=UO.GetY() 
      if waitNewPos(x,y) then 
         path=path+extract_dir(x,y,UO.GetX(),UO.GetY()) 
      endif 
   Until UO.InJournal("stop") 
   path = compressPath(path) 
   UO.TextClear()  
   UO.TextOpen() 
   UO.TextPrint("Your path is:") 
   UO.TextPrint(path) 
end sub 

############################################################ 
#   Auxilliar sub. 
############################################################ 
sub send_step(keycode,dir) 
   var x = UO.GetX() 
   var y = UO.GetY() 
   var timeout = 0 
   if UO.GetDir()<>dir then 
      UO.Press(keycode) 
      Repeat 
         wait(50) 
      Until UO.GetDir()==dir 
   endif 
   UO.Press(keycode) 
   Repeat 
      timeout=timeout+50 
      wait(50) 
   Until x<>UO.GetX() || y<>UO.GetY() || timeout>2000 
   if timeout>2000 then 
      return 0 
   endif 
   return 1 
end sub 

############################################################ 
#   Bunch of auxilliar subs. No need to change anything! 
############################################################ 
sub waitNewPos(x,y) 
   while x==UO.GetX() && y==UO.GetY() 
      if UO.InJournal("stop") then 
         return 0 
      endif 
   wend 
   return 1 
end sub 

sub compressPath(path) 
   Var i=0 
   Var j=0 
   Var newPath="" 
   while i<LEN(path) 
      j=1 
      while path[i]==path[i+1] AND j<9 
         i=i+1 
         j=j+1 
      wend 
      if j==1 then 
         newPath=newPath+path[i] 
      else 
         newPath=newPath+STR(j)+path[i] 
      endif 
      i=i+1 
   wend 
   return newPath 
end sub 

sub extract_dir(x,y,a,b) 
   if x>a then 
      if y==b then 
         return "i" 
      else 
         if y>b then 
            return "n" 
         else 
            return "w" 
         endif 
      endif 
   else 
      if x<a then 
         if y==b then 
            return "l" 
         else 
            if y>b then 
               return "e" 
            else 
               return "s" 
            endif 
         endif 
      else 
         if y>b then 
            return "o" 
         else 
            return "k" 
         endif 
      endif 
   endif 
end sub 

sub make_step(dir) 
   if dir=="e" then 
      send_step(39,1) 
      return 1 
   endif 
   if dir=="l" then 
      send_step(34,2) 
      return 1 
   endif 
   if dir=="s" then 
      send_step(40,3) 
      return 1 
   endif 
   if dir=="k" then 
      send_step(35,4) 
      return 1 
   endif 
   if dir=="w" then 
      send_step(37,5) 
      return 1 
   endif 
   if dir=="i" then 
      send_step(36,6) 
      return 1 
   endif 
   if dir=="n" then 
      send_step(38,7) 
      return 1 
   endif 
   if dir=="o" then 
      send_step(33,0) 
      return 1 
   endif 
   if dir=="d" then 
      While UO.Count("0x19b9") 
         UO.Drop("0x19b9") 
         wait(1000) 
      Wend 
      wait(200) 
      return 1 
   endif 
   UO.Print("Recall Time!") 
   return 0 
end sub

Powered by BetterDocs