Help With Mining. There is somewhere error... :)

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Vitle
Posts: 14
Joined: 2006-11-07 00:52:08
Location: Russia, Saratov
Contact:

Help With Mining. There is somewhere error... :)

Post by Vitle »

Please help with this script. Id does't work
Уважаемые скриптеры. Окиньте "свежим взглядом" сию ересь . Где-то ошибка закралась. Но незначительная. Ибо предыдущая модификация работала без ошибок. Однако сам не могу найти. УЖе притупилось внимание.

Code: Select all

##### Automatic Mining (c) Vitle #####

sub MiningAroundWRaR()
var imx, imy, imz
var i, j, k, w, jorcheck, joser, notor, pk, minenumber, elemcheck, elemser
var strWeight
var ms2 = "Pause, Please!"
minenumber = 1
while not uo.dead()

RecallToMine(minenumber)
begin:
elemcheck = 0

imx = UO.GetX("self")
imy = UO.GetY("self")
imz = UO.GetZ("self")

while uo.weight < 601
uo.deletejournal()
for j = imx-4 to imx+4
for i = imy -4 to imy+4
k = 0
uo.print("Now Mining In: "+str(imx-j)+" "+str(imy-i))

   continuemining:
   
   while not k == 3 and not UO.InJournal("no ore here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in rock") and not uo.injournal("Manifest") and uo.weight < 601
   
   If UO.Dead() then
      If elemcheck > 0 then
      uo.set('finddistance', '12')
      uo.findtype('0x0010', '-1', '1')
         if not uo.findcount() then
         elemcheck = 0
            else
               if not uo.getdistance('finditem') < 5 then
               elemcheck = 0
               endif
         endif
      endif
   UO.Print("Weight before You were killed:"+str(strWeight))
   goto reschar
   endif
   
   CheckLag()
   UO.DeleteJournal()
   
   while not UO.Hidden()
   uo.warmode(false)
   CheckLag()
   UO.DeleteJournal()
   UO.UseSkill('Hiding')
      while not UO.InJournal("hidden") and not UO.InJournal("seem")
      wait(100)
      wend
   wend
   UO.DeleteJournal()
   if uo.waiting() then
   uo.canceltarget()
   endif      
   UO.Waittargettile("1341", str(j), str(i), str(imz))
   UO.Usetype('0x0f39')
      w = 0
      pk = 0
      while pk == 0 and not UO.InJournal("You put") and not UO.InJournal("location") and not UO.InJournal("but fail") and not UO.InJournal("no ore") and not UO.InJournal("far away") and not UO.InJournal("in rock") and not UO.InJournal("World is saving") and not uo.injournal("revealed") and not UO.InJournal(ms2) and w < 20
      wait(500)      
         for jorcheck = 0 to 9
         joser = uo.journalserial(jorcheck)
         notor = uo.getnotoriety(joser)
         
            if notor <> 1 and notor <> 0 and not uo.injournal("Elemental") and not uo.injournal("Anton B") then
            pk = 1
            goto oops
            endif
         next
      w = w + 1      
      wend
         if UO.InJournal("World is saving") then
         CheckLag()
         wait(4000)
         UO.Warmode(True)
         wait(500)
         UO.Warmode(False)
         endif
      if UO.InJournal(ms2) then
      Pause(2)
      endif
         if uo.injournal("revealed") and elemcheck > 0 then
         goto oops
         endif
      if UO.InJournal("but fail") then
      wait(500)
      k = k + 1
      endif
         if uo.injournal("heavy") then
            if uo.weight < 602 then
            elemcheck = elemcheck + 1
            endif
         endif
   strweight = uo.weight
   wend
UO.DeleteJournal()

next
next
wend
oops:
   If elemcheck > 0 then
   uo.set('finddistance', '12')
   uo.findtype('0x0010', '-1', '1')
      if uo.findcount() then
         if uo.getdistance('finditem') < 5 then
         RunFromElem()
         else
         elemcheck = 0
         RecallToHome{pk)
         endif
      else
      elemcheck = 0
      RecallToHome(pk)
      endif
   else
   RecallToHome(pk)
   endif
if uo.dead() then
reschar:
Ressurect()
wait(60000)
goto tomine
endif
wait(1000)
Unload()
wait(1000)
tomine:
   if elemcheck > 0 then
   minenumber = minenumber + 1
      if minenumber > 3 then
      minenumber = 1
      endif
   endif
wend

end sub

##### Recall To Home by RuneBook or By Scroll if You See PK #####

Sub RecallToHome(k)

var w, p, hx, hy

hx = uo.getx("self")
hy = uo.gety("self")

repeat
if uo.dead() then
goto dead
endif
   if k == 1 then
   if uo.waiting() then
   uo.canceltarget()
   endif      
   uo.warmode(false)
   CheckLag()
   uo.deletejournal("World is saving")
   uo.waittargettype('0x1f14')
   uo.usetype('0x1f4c')
      w = 0
      while not uo.getx("self") <> hx and not uo.gety("self") <> hy and not uo.injournal("World is saving") and w <= 50
      wait(100)
      w = w + 1
      wend
         if UO.InJournal("World is saving") then
         CheckLag()
         wait(4000)
         UO.Warmode(True)
         wait(500)
         UO.Warmode(False)
         endif
   else
   if uo.waiting() then
   uo.canceltarget()
   endif      
   uo.warmode(false)
   uo.deletejournal("World is saving")
   uo.useobject('0x4046B3F8')
   CheckLag()
   uo.Lclick(135,115)
   w = 0
   while not uo.getx("self") <> hx and not uo.gety("self") <> hy and not uo.injournal("World is saving") and w <= 70
   wait(100)
   w = w + 1
   wend
      if UO.InJournal("World is saving") then
      CheckLag()
      wait(4000)
      UO.Warmode(True)
      wait(500)
      UO.Warmode(False)
      endif
   endif
until uo.getx("self") <> hx or uo.gety("self") <> hy
if k == 1 then
wait(30000)
endif
dead:
endsub   

##### Standard Unload Ore Script #####

Sub Unload()

var MetallSafe
var a

MetallSafe = '0x4010CC11' ; личный сейф перса

DIM Ore[4]
Ore[0] = '0x19B9' ; 4 and more ore
Ore[1] = '0x19B7' ; 1 ore
Ore[2] = '0x19BA' ; 2 ore
Ore[3] = '0x19B8' ; 3 ore

for a = 0 to 3
uo.findtype(Ore[a])
   if uo.findcount('finditem') > 0 then
      repeat
      uo.moveitem('finditem', '0', MetallSafe)
      wait(500)
      CheckLag()
      uo.findtype(Ore[a])
      until not uo.findcount()
   endif
next
endsub

##### Recall To Mines From RuneBook #####

Sub RecallToMine(mn)

var r, w, mx, my, runa
var Rbag = '0x4010CC11'

if mn == 1 then
runa = 85 ; руна в первую шахту
endif
if mn == 2 then
runa = 70 ; руна во вторую шахту
endif
if mn == 3 then
runa = 100 ; руна в третью шахту
endif

mx = uo.getx("self")
my = uo.gety("self")

      repeat
      if uo.dead() then
      goto deadagain
      endif
      if uo.waiting() then
      uo.canceltarget()
      endif      
      uo.deletejournal("World is saving")
      uo.useobject('0x4046B3F8')
      CheckLag()
      uo.Lclick(135,runa)
         w = 0
         while not uo.getx("self") <> mx and not uo.gety("self") <> my and not uo.injournal("World is saving") and w < 70
         wait(100)
         w = w + 1
         wend
            if UO.InJournal("World is saving") then
            CheckLag()
            wait(4000)
            UO.Warmode(True)
            wait(500)
            UO.Warmode(False)
            wait(500)
            endif
      until uo.getx("self") <> mx or uo.gety("self") <> my
deadagain:
endsub

##### Run From Elemental and Recall #####

sub RunFromElem()
var mx, my, ex, ey, w, stepx, stepy
mx = uo.getx("self")
my = uo.gety("self")
uo.set('finddistance', '12')
uo.findtype('0x0010', '-1', '1')
   repeat
   if uo.dead() then
   goto damn
   endif
   if uo.waiting() then
   uo.canceltarget()
   endif      
   uo.deletejournal("fizzles")
   uo.warmode(false)
   CheckLag()
   uo.waittargettype('0x1f14')
   uo.usetype('0x1f4c')
         w = 0
         while (uo.getx("self") <> 2498 and uo.gety("self") <> 66) and not uo.injournal("fizzles") and w < 28
#         wait(250)

         ex = uo.getx('finditem')
         ey = uo.gety('finditem')
            stepx = uo.getx("self")
            stepy = uo.gety("self")
            if (uo.getx("self") - ex) > 0 and (uo.gety("self") - ey) > 0 then
               CheckLag()
               uo.addstep(2)
                  repeat
                  wait(100)
                  until uo.getx("self") <> stepx or uo.gety("self") <> stepy
            endif
               if (uo.getx("self") - ex) > 0 and (uo.gety("self") - ey) < 0 then         
               CheckLag()
               uo.addstep(6)
                  repeat
                  wait(100)
                  until uo.getx("self") <> stepx or uo.gety("self") <> stepy
               endif
            if (uo.getx("self") - ex) < 0 and (uo.gety("self") - ey) < 0 then         
            CheckLag()
            uo.addstep(8)
               repeat
               wait(100)
               until uo.getx("self") <> stepx or uo.gety("self") <> stepy
            endif
               if (uo.getx("self") - ex) < 0 and (uo.gety("self") - ey) > 0 then         
               CheckLag()
               uo.addstep(4)
                  repeat
                  wait(100)
                  until uo.getx("self") <> stepx or uo.gety("self") <> stepy
               endif
               
            if (uo.getx("self") - ex) == 0 and (uo.gety("self") - ey) > 0 then
               CheckLag()
               uo.addstep(1)
                  repeat
                  wait(100)
                  until uo.getx("self") <> stepx or uo.gety("self") <> stepy
            endif
               if (uo.getx("self") - ex) == 0 and (uo.gety("self") - ey) < 0 then         
               CheckLag()
               uo.addstep(9)
                  repeat
                  wait(100)
                  until uo.getx("self") <> stepx or uo.gety("self") <> stepy
               endif
            if (uo.getx("self") - ex) < 0 and (uo.gety("self") - ey) == 0 then         
            CheckLag()
            uo.addstep(7)
               repeat
               wait(100)
               until uo.getx("self") <> stepx or uo.gety("self") <> stepy
            endif
               if (uo.getx("self") - ex) > 0 and (uo.gety("self") - ey) == 0 then         
               CheckLag()
               uo.addstep(3)
                  repeat
                  wait(100)
                  until uo.getx("self") <> stepx or uo.gety("self") <> stepy
               endif
         w = w + 1
         wend
   until not uo.getx("self") <> 2498 and not uo.gety("self") <> 66
damn:
endsub

##### Auto Ressurection if You are Dead (with ankh in Minoc) #####

Sub Ressurect()
var mx, my, kx, ky
uo.warmode(false)
mx = uo.getx("self")
my = uo.gety("self")
CheckLag()
uo.Lclick(858,57)
wait(500)
CheckLag()
uo.Lclick(268,306)
wait(500)
CheckLag()
uo.Lclick(175,201)
repeat
wait(100)
until uo.getx("self") <> mx or uo.gety("self") <> my
CheckLag()
uo.addstep(6)
wait(500)
CheckLag()
uo.addstep(6)
wait(500)
CheckLag()
uo.useobject('0x4001D120')
while uo.dead()
wait(100)
wend
endsub

##### CheckLag #####

Sub CheckLag()
UO.DeleteJournal('backpack')
UO.Click('backpack')

repeat
wait(500)
until UO.InJournal('backpack')
end sub

##### Pause #####

Sub Pause(x)

   DIM PauseArg[8]
   PauseArg[0] = "Pause! You're dead!"
   PauseArg[1] = "Pause! Full weight!"
   PauseArg[2] = "Pause! Paused by player!"
   PauseArg[3] = "Pause! Not enough ingots to continue!"
   PauseArg[4] = "Pause! There is no ingots here!"
   PauseArg[5] = "Pause! Not enough reagents to continue!"
   PauseArg[6] = "Pause! There is no reagents here!"
   PauseArg[7] = "Pause! Elemental here. Can' recall!"
   
   var MsSB = "spellbook"   
   var t, m, h, s, const

t = 0   
uo.deletejournal(MsSB)
   repeat
   uo.print(PauseArg[x])
   wait(10000)
   t = t + 10
   Timer(t)
   until uo.injournal(MsSB)
   uo.print("Script is continues now")
endsub

##### Timer for Pause #####

Sub Timer(const)
var h, m, s

h = 0
m = 0

   while const > 3600
   const = const - 3600
   h = h + 1
   wend
   while const > 60
   const = const - 60
   m = m + 1
   wend
   s = const
   
uo.print("Paused: "+str(h)+" hour(s) "+str(m)+" min(s) "+str(s)+" sec(s).")
uo.print("Paused: "+str(h)+" hour(s) "+str(m)+" min(s) "+str(s)+" sec(s).")

endsub


P.S. в предыдущей модификации не было реколлов со свитка + немножко поменял елемчеки. Но впринципе все должно работать. Скорее всего где-то просто "ендифа" не хватает.. или наоборот лишний стоит. Но я уже не могу на это смотреть. Помогите если не лень. Буду чрезвычайно благодарен. :?
Kynep
Expert!
Posts: 1348
Joined: 2006-02-07 08:51:40
Location: г. Старый Оскол
Contact:

Re: Help With Mining. There is somewhere error... :)

Post by Kynep »

Vitle wrote:Please help with this script. Id does't work
Уважаемые скриптеры. Окиньте "свежим взглядом" сию ересь . Где-то ошибка закралась. Но незначительная. Ибо предыдущая модификация работала без ошибок. Однако сам не могу найти. УЖе притупилось внимание.

P.S. в предыдущей модификации не было реколлов со свитка + немножко поменял елемчеки. Но впринципе все должно работать. Скорее всего где-то просто "ендифа" не хватает.. или наоборот лишний стоит. Но я уже не могу на это смотреть. Помогите если не лень. Буду чрезвычайно благодарен. :?


Хотелось бы узнать что сия ошибка выдает, для начала.
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Забавно когда в топике есть обращение к иностраным пользователям
Vitle
Posts: 14
Joined: 2006-11-07 00:52:08
Location: Russia, Saratov
Contact:

Post by Vitle »

А что в этом забавного? :)
З.Ы. ошибку нашел вместо "(" стояла "{"
мдя. Спать надо чаще.
Post Reply