Tady je script na tréning miningu odemě.....
Kód: Vybrat vše
sub mining_S()
Uo.Exec("exec mining_SW")
return 0
endsub
sub mining_N()
Uo.Exec("exec mining_NE")
return 0
endsub
Sub mining_NE()
var mx,my,mz
while not uo.dead()
uo.deletejournal()
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
vyhaz2(0)
repeat
uo.deletejournal()
uo.waittargettile("0",mx,my,mz)
UO.usetype("0x0E85")
repeat
wait(100)
until uo.injournal("There is no|You put|You loosen|Try mining|You destroy") AND Uo.InJournal('...akce skoncila')
wait(2000)
until uo.injournal("There is no") or uo.injournal("Try mining") or vyhaz2(1)
wait(2000)
vyhaz2(0)
uo.print("Neni ruda")
if not go(uo.getx("self")+1,uo.gety("self")) then
while not go(uo.getx("self"),uo.gety("self")-1)
go2(uo.getx("self")-1,uo.gety("self"))
wend
while go2(uo.getx("self")+1,uo.gety("self"))
Wait(500)
wend
Uo.Exec("exec mining_NW")
return 0
endif
wend
end sub
Sub mining_NW()
var mx,my,mz
while not uo.dead()
uo.deletejournal()
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
vyhaz2(0)
repeat
uo.deletejournal()
uo.waittargettile("0",mx,my,mz)
UO.usetype("0x0E85")
repeat
wait(100)
until uo.injournal("There is no|You put|You loosen|Try mining|You destroy") AND Uo.InJournal('...akce skoncila')
wait(2000)
until uo.injournal("There is no") or uo.injournal("Try mining") or vyhaz2(1)
wait(2000)
vyhaz2(0)
uo.print("Neni ruda")
if not go2(uo.getx("self")-1,uo.gety("self")) then
while not go(uo.getx("self"),uo.gety("self")-1)
go(uo.getx("self")+1,uo.gety("self"))
wend
while go(uo.getx("self")-1,uo.gety("self"))
Wait(500)
wend
Uo.Exec("exec mining_NE")
return 0
endif
wend
end sub
Sub mining_SW()
var mx,my,mz
while not uo.dead()
uo.deletejournal()
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
vyhaz2(0)
repeat
uo.deletejournal()
uo.waittargettile("0",mx,my,mz)
UO.usetype("0x0E85")
repeat
wait(100)
until uo.injournal("There is no|You put|You loosen|Try mining|You destroy") AND Uo.InJournal('...akce skoncila')
wait(2000)
until uo.injournal("There is no") or uo.injournal("Try mining") or vyhaz2(1)
wait(2000)
vyhaz2(0)
uo.print("Neni ruda")
if not go2(uo.getx("self")-1,uo.gety("self")) then
while not go2(uo.getx("self"),uo.gety("self")+1)
go(uo.getx("self")+1,uo.gety("self"))
wend
while go(uo.getx("self")-1,uo.gety("self"))
Wait(500)
wend
Uo.Exec("exec mining_SE")
return 0
endif
wend
end sub
Sub mining_SE()
var mx,my,mz
while not uo.dead()
uo.deletejournal()
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
vyhaz2(0)
repeat
uo.deletejournal()
uo.waittargettile("0",mx,my,mz)
UO.usetype("0x0E85")
repeat
wait(100)
until uo.injournal("There is no|You put|You loosen|Try mining|You destroy") AND Uo.InJournal('...akce skoncila')
wait(2000)
until uo.injournal("There is no") or uo.injournal("Try mining") or vyhaz2(1)
wait(2000)
vyhaz2(0)
uo.print("Neni ruda")
if not go(uo.getx("self")+1,uo.gety("self")) then
while not go2(uo.getx("self"),uo.gety("self")+1)
go2(uo.getx("self")-1,uo.gety("self"))
wend
while go2(uo.getx("self")+1,uo.gety("self"))
Wait(500)
wend
Uo.Exec("exec mining_SW")
return 0
endif
wend
end sub
Sub go(x,y)
var xx,yy
repeat
if uo.getx("self") < x then ; x + 1 === E
if uo.getdir("self")<>2 then
uo.press(34,1,500)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(34,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
Wait(500)
endif
if uo.getx("self") > x then ; x - 1 === W
if uo.getdir("self")<>6 then
uo.press(36,1,0)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(36,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
endif
if uo.gety("self") < y then ; y + 1 === S
if uo.getdir("self")<>4 then
uo.press(35,1,0)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(35,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
Wait(500)
endif
if uo.gety("self") > y then ; y - 1 === N
if uo.getdir("self")<>0 then
uo.press(33,1,500)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(33,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
Wait(500)
endif
until uo.getx("self")==x and uo.gety("self")==y
return 1
end sub
Sub go2(x,y)
var xx,yy
repeat
if uo.getx("self") < x then ; x + 1 === E
if uo.getdir("self")<>2 then
uo.press(34,1,500)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(34,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
endif
if uo.getx("self") > x then ; x - 1 === W
if uo.getdir("self")<>6 then
uo.press(36,1,0)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(36,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
Wait(500)
endif
if uo.gety("self") < y then ; y + 1 === S
if uo.getdir("self")<>4 then
uo.press(35,1,0)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(35,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
Wait(500)
endif
if uo.gety("self") > y then ; y - 1 === N
if uo.getdir("self")<>0 then
uo.press(33,1,500)
endif
xx=uo.getx("self")
yy=uo.gety("self")
uo.press(33,1,100)
if not wait_for_move(xx,yy) then
return 0
endif
Wait(500)
endif
until uo.getx("self")==x and uo.gety("self")==y
return 1
end sub
Sub wait_for_move(x,y)
var oldtime=uo.timer()
repeat
wait(100)
if uo.timer()-oldtime>30 then
return 0
endif
until uo.GetX("self") <> X or uo.GetY("self") <> Y
return 1
end sub
Sub vyhaz2(returnik)
var d,i,y,p,kopecek
dim vyhazovat[18]
dim nechavat[18]
dim color[18]
#############################################################
#
# Tady dopln co chces vyhazovat 0=nevyhazovat 1=vykopat a položit na zem 2=Nekopat
#
############################
vyhazovat[0]=1 #Iron
vyhazovat[1]=1 #Copper
vyhazovat[2]=0 #Bronze
vyhazovat[3]=1 #Silver
vyhazovat[4]=1 #Shadow
vyhazovat[5]=1 #Rose
vyhazovat[6]=1 #Golden
vyhazovat[7]=1 #Verite
vyhazovat[8]=1 #Valorite
vyhazovat[9]=1 #Blood Rock
vyhazovat[10]=0 #Black Rock
vyhazovat[11]=0 #Mytheril
vyhazovat[12]=0 #Star Sapphire
vyhazovat[13]=1 #Emerald
vyhazovat[14]=0 #Citrine
vyhazovat[15]=0 #Amethyst
vyhazovat[16]=1 #Ruby
vyhazovat[17]=0 #Diamond
#############################
color[0]=0x0000 #Iron
color[1]=0x0289 #Copper
color[2]=0x01BF #Bronze
color[3]=0x0482 #Silver
color[4]=0x0322 #Shadow
color[5]=0x0665 #Rose
color[6]=0x0160 #Golden
color[7]=0x01CB #Verite
color[8]=0x0253 #Valorite
color[9]=0x04C2 #Blood Rock
color[10]=0x0455 #Black Rock
color[11]=0x052D #Mytheril
color[12]=0x0006 #Star Sapphire
color[13]=0x0041 #Emerald
color[14]=0x002C #Citrine
color[15]=0x0015 #Amethyst
color[16]=0x0027 #Ruby
color[17]=0x03E9 #Diamond
dim typ_ore[4]
typ_ore[0]="0x19B7" # 1
typ_ore[1]="0x19BA" # 2
typ_ore[2]="0x19B8" # 3
typ_ore[3]="0x19B9" # 4
for d=0 to 17
If Uo.InJournal('World save') THEN
Uo.DeleteJournal()
Wait(20000)
EndIf
if vyhazovat[d]==1 AND Uo.InJournal("There is no|Try mining") then
for i=0 to 3
uo.findtype(typ_ore[i],color[d],"backpack")
while uo.findcount()
If Uo.InJournal('World save') THEN
Wait(20000)
EndIf
uo.moveitem("finditem",-1,"ground")
wait(500)
uo.findtype(typ_ore[i],color[d],"backpack")
if returnik==2 then
return 2
endif
If Uo.InJournal('World save') THEN
Uo.DeleteJournal()
Wait(20000)
EndIf
wend
next
endif
if vyhazovat[d]==2 then
for i=0 to 3
uo.findtype(typ_ore[i],color[d],"backpack")
while uo.findcount()
If Uo.InJournal('World save') THEN
Wait(20000)
EndIf
uo.moveitem("finditem",-1,"ground")
wait(500)
uo.findtype(typ_ore[i],color[d],"backpack")
if returnik==3 then
return 3
endif
wend
If Uo.InJournal('World save') THEN
Uo.DeleteJournal()
Wait(20000)
EndIf
next
endif
next
return 0
end sub
Sub WaitForJournal(text)
repeat
wait(200)
until uo.inJournal(text)
wait(500)
end sub