Page 1 of 1

Помагите выскакивает ошибка,первый раз вижу.

Posted: 2007-08-01 20:14:30
by Raisefamous
Помагите выскакивает ошибка Line 42:Goto"Полетел счётчик вложености циклов" с чего бы это?Вроде летит подходит а как тока подошёл начинает юзать скил и сразу вот это вот.Кто знает в чём проблема?

Code: Select all

sub main()
VAR n , x, q
VAR maxrune = 16

uo.exec("set norbcheck 1")
uo.exec("set norbcalc 1")
uo.exec("set grabdelay 0")
Dim rune[16]
rune[1] = '20';home
rune[2] = '22';and reagents
rune[3] = '24'
rune[4] = '26'
rune[5] = '28'
rune[6] = '30'
rune[7] = '32'
rune[8] = '34'
rune[9] = '36'
rune[10]= '38'
rune[11]= '40'
rune[12]= '42'
rune[13]= '44'
rune[14]= '46'
rune[15]= '48'
rune[16]= '50'

uo.exec('addobject runebook')
while uo.targeting()
wait(200)
wend

uo.exec('addobject safe')
while uo.targeting()
wait(200)
wend

uo.exec('addobject bag')
while uo.targeting()
wait(200)
wend

Check()

While true and NOT uo.dead()
uo.ignorereset()
 For n = 2 To maxrune
  uo.deletejournal()
   If uo.mana < 20 then
    repeat
     uo.warmode(0)
      uo.useskill('Meditation')
       wait(2000)
        until uo.mana >= uo.int
         endif
          fizzle:
           uo.recall('runebook', rune[n] )
            x = uo.getx()
             q = 0
              repeat
               q = q + 1
                wait(500)
               checklag()
              until uo.getx()<>x or q >= 20
             if q >= 20 then
            goto fizzle
           endif
          checklag()
         wait(2000)
        GOandBUY()
     endif
    next
   GOandDROP()
  hide()
 wait(220000)
wend
end sub

sub GOandBUY()
  var f=0, name, s
  uo.ignore('self')
  uo.set('finddistance','15')
Dim Vname[31]
Vname[1] = 'Gilana'#1
Vname[2] = 'Lene'#1
Vname[3] = 'Donna'#2
Vname[4] = 'Fayme'#2
Vname[5] = 'Dagny'#3
Vname[6] = 'Daren'#3
Vname[7] = 'Janice'#3
Vname[8] = 'Lorenzo'#4
Vname[9] = 'Keith'#5
Vname[10]= 'Russ'#5
Vname[11]= 'Meyer'#6
Vname[12]= 'Sharman'#7
Vname[13]= 'Ianthe'#7
Vname[14]= 'Geoff'#8
Vname[15]= 'Arley'#8
Vname[16]= 'Jamie'#9
Vname[17]= 'Bella'#10
Vname[18]= 'Palmiera'#10
Vname[19]= 'Kegan'#11
Vname[20]= 'Morgance'#11
Vname[21]= 'Hamlin'#12
Vname[22]= 'Kayin'#12
Vname[23]= 'Hilliard'#13
Vname[24]= 'Elliott'#13
Vname[25]= 'Chaya'#13
Vname[26]= 'Walter'#13
Vname[27]= 'Kedar'#14
Vname[28]= 'Beval'#14
Vname[29]= 'Aitan'#14
Vname[30]= 'Ramon'#15
Vname[31]= 'Melian'#15

Dim Vser[31]
Vser[1] = '0x00109355'#1
Vser[2] = '0x0010D3F0'#1
Vser[3] = '0x0010781B'#2
Vser[4] = '0x000DBB5A'#2
Vser[5] = '0x000DE57B'#3
Vser[6] = '0x000D7DB9'#3
Vser[7] = '0x000DC725'#3
Vser[8] = '0x000DD62F'#4
Vser[9] = '0x000C8930'#5
Vser[10]= '0x000CD150'#5
Vser[11]= '0x0009293B'#6
Vser[12]= '0x0011FF45'#7
Vser[13]= '0x0011F3D2'#7
Vser[14]= '0x000E5568'#8
Vser[15]= '0x000DDE3E'#8
Vser[16]= '0x000E0EF7'#9
Vser[17]= '0x000D8CE8'#10
Vser[18]= '0x000E578E'#10
Vser[19]= '0x00117DFC'#11
Vser[20]= '0x000CF22F'#11
Vser[21]= '0x001132BF'#12
Vser[22]= '0x00058509'#12
Vser[23]= '0x000CAA6A'#13
Vser[24]= '0x000D65FB'#13
Vser[25]= '0x000CDCB1'#13
Vser[26]= '0x000DA9D8'#13
Vser[27]= '0x00069511'#14
Vser[28]= '0x001108EE'#14
Vser[29]= '0x000CC865'#14
Vser[30]= '0x000CE00D'#15
Vser[31]= '0x0004F575'#15

search:
 checklag()
  uo.findtype('0x0190', -1 ,'ground')
    if uo.findcount() == 0 then
      uo.findtype('0x0191', -1 ,'ground')   
       if uo.findcount() == 0 then
        return
       else
      f = 1
     endif
    else
   f = 1
  endif 

  if f == 1 then
   For s = 1 to 31 #
    If uo.getserial('finditem') == Vser[s] then
     ignore()
      uo.deletejournal()
       WalkME( 0 , 0 ,Vser[s])
       WalkME( 0 , 0 ,Vser[s])
          while not uo.InJournal("Begging|no money", 10)
          uo.DeleteJournal()
          UO.WaitTargetObject(Vser[s])
          uo.UseSkill('Begging')
          while not uo.InJournal("Begging|no money|must wait", 10)
          CheckLag()
;         GOandbuy()
;        uo.closeuo()
;       endif
       uo.ignore(Vser[s])
      goto search
     endif
    next
   uo.ignore('finditem')
  goto search
 endif
end sub

sub GOandDROP()
VAR y, w
 fizzle:
  uo.recall('runebook', 20 )
   y = uo.gety()
    w = 0
     repeat
      w = w + 1
     wait(500)
    checklag()
   until uo.gety()<>y or w >= 20
  if w >= 20 then
 goto fizzle
endif
WalkME( 0 , 0 ,'safe')
uo.useobject('bag')
CheckLag()
uo.findtype( -1 , -1 ,'bag')
While uo.findcount()
uo.moveitem('finditem', 0 ,'safe')
wait(200)
CheckLag()
uo.ignore('finditem')
uo.findtype( -1 , -1 ,'bag')
wend
Check()
end sub

sub ignore()
uo.findtype( -1 )
While uo.findcount()
uo.ignore('finditem')
wait(200)
uo.findtype( -1 )
wend
CheckLag()
end sub

sub drag()
uo.findtype( -1 )
While uo.findcount()
uo.moveitem('finditem', 0 ,'bag')
wait(200)
CheckLag()
uo.findtype( -1 )
wend
end sub

sub check()
VAR r
Dim reg[3]
reg[1] = 0x0F7B
reg[2] = 0x0F86
reg[3] = 0x0F7A
 uo.ignorereset()
 if uo.count(reg[1])<50 or uo.count(reg[2])<50 or uo.count(reg[3])<50 then
  If UO.GetDistance('safe')>3 then
   WalkMe( 0 , 0 ,'safe')
  endif
 uo.useobject('safe')
  CheckLag()
   For r = 1 to 3
    uo.findtype(reg[r], -1 ,'safe')
     If uo.findcount() == 0 then
      uo.msg('You must have reagents for recall in your fucking safe chest you stupid fuck!')
       uo.exec('terminate all')
       endif
      uo.moveitem('finditem','50','backpack')
     wait(400)
    CheckLag()
  next
 endif
end sub

sub hide()
while NOT uo.hidden()
uo.useskill('Hiding')
wait(5000)
wend
end sub

################# W A L K E R ######################

sub WalkME(x,y,Target)
   VAR i
   VAR dir,ldir,rdir,key,olddir
   VAR dx,dy,Exit=0
   VAR CacheLimit=9,CacheIndex="Text"
   DIM CacheX[10], CacheY[10]
   
   CacheX[0]="Test"
   While Exit<>1   
      If Target<>"" Then
         dx=UO.GetX(Target)-UO.GetX()
         dy=UO.GetY(Target)-UO.GetY()
;         UO.Print("Target locked!")
         If UO.GetDistance(Target)<2 Then
            return
         Endif
      Else
         dx=x-UO.GetX()
         dy=y-UO.GetY()
         If dx==0 AND dy==0 Then
            Exit=1
         Endif

      Endif
   
      If dx<>0 AND dy<>0 Then
         If dx>0 AND dy>0 Then ; GoSE
            dir=3
            ldir=2
            rdir=4
            key=40 ; DownArrow
            olddir=UO.GetDir()
            If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
               If olddir==2 Then ; GoNE
                  dir=1
                  ldir=0
                  rdir=1
                  key=39 ; RightArrow
                  While UO.GetDir()<>1
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoSW
                  dir=5
                  ldir=5
                  rdir=6
                  key=37 ; LeftArrow
                  While UO.GetDir()<>5
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif

         If dx>0 AND dy<0 Then ; GoNE
            dir=1
            ldir=0
            rdir=2
            key=39 ; RightArrow
            olddir=UO.GetDir()
            If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
               If olddir==0 Then ; GoWN
                  dir=7
                  ldir=6
                  rdir=7
                  key=38 ; UpArrow
                  While UO.GetDir()<>7
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoSE
                  dir=3
                  ldir=3
                  rdir=4
                  key=40 ; DownArrow
                  While UO.GetDir()<>3
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif

         If dx<0 AND dy>0 Then ; GoSW
            dir=5
            ldir=4
            rdir=6
            key=37 ; LeftArrow
            olddir=UO.GetDir()
            If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
               If olddir==6 Then ; GoWN
                  dir=7
                  ldir=7
                  rdir=0
                  key=38 ; UpArrow
                  While UO.GetDir()<>7
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoSE
                  dir=3
                  ldir=2
                  rdir=3
                  key=40 ; DownArrow
                  While UO.GetDir()<>3
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif

         If dx<0 AND dy<0 Then ; GoWN
            dir=7
            ldir=6
            rdir=0
            key=38 ; UpArrow
            olddir=UO.GetDir()
            If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
               If olddir==0 Then ; GoNE
                  dir=1
                  ldir=1
                  rdir=2
                  key=39 ; RightArrow
                  While UO.GetDir()<>1
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoSW
                  dir=5
                  ldir=4
                  rdir=5
                  key=37 ; LeftArrow
                  While UO.GetDir()<>5
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif
      Endif
   
      If dx<>0 AND dy==0 Then
         If dx>0 Then ; GoE
            dir=2
            key=34 ; PgDown
            olddir=UO.GetDir()
            If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
               If olddir==2 Then ; GoSE
                  dir=3
                  ldir=3
                  rdir=4
                  key=40 ; DownArrow
                  While UO.GetDir()<>3
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoNE
                  dir=1
                  ldir=1
                  rdir=0
                  key=39 ; RightArrow
                  While UO.GetDir()<>1
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif
         
         If dx<0 Then ; GoW
            dir=6
            key=36 ; Home key
            olddir=UO.GetDir()
            If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
               If olddir==0 Then ; GoWN
                  dir=7
                  ldir=7
                  rdir=0
                  key=38 ; UpArrow
                  While UO.GetDir()<>7
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoSW
                  dir=5
                  ldir=4
                  rdir=5
                  key=37 ; LeftArrow
                  While UO.GetDir()<>5
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif
      Endif

      If dx==0 AND dy<>0 Then
         If dy>0 Then ; GoS
            dir=4
            key=35 ; End
            If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
               If olddir==2 Then ; GoSE
                  dir=3
                  ldir=2
                  rdir=3
                  key=40 ; DownArrow
                  While UO.GetDir()<>3
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoSW
                  dir=5
                  ldir=6
                  rdir=5
                  key=37 ; LeftArrow
                  While UO.GetDir()<>5
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif
         
         If dy<0 Then ;GoN
            dir=0
            key=33 ; PgUp
            olddir=UO.GetDir()
            If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
               If olddir==2 Then ; GoNE
                  dir=1
                  ldir=1
                  rdir=2
                  key=39 ; RightArrow
                  While UO.GetDir()<>1
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Else ; GoWN
                  dir=7
                  ldir=7
                  rdir=6
                  key=38 ; UpArrow
                  While UO.GetDir()<>7
                     StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
                  Wend
               Endif
            Endif
         Endif
      Endif
   Wend
end sub


sub StepEdit(x,y,dir,key)
   VAR walkwait=300
   VAR ErrLevel=0
   If UO.GetDir()<>dir Then
         checkstam()
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir Then
         CheckLag()
      Endif
   Endif
         checkstam()
   UO.Press(key)
   wait(walkwait)
   If x==UO.GetX() AND y==UO.GetY() Then
      CheckLag()
      If x==UO.GetX() AND y==UO.GetY() Then
;zatik
         ErrLevel=1
      Endif
   Endif
   Return ErrLevel
end sub


sub StepArrow(x,y,dir,ldir,rdir,key)
   VAR walkwait=300
   VAR ErrLevel=0
   If UO.GetDir()<>dir Then
      checkstam()
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()<>dir AND UO.GetDir()<>ldir AND UO.GetDir()<>rdir Then
         CheckLag()
      Endif
   Endif

   If UO.GetX()==x AND UO.GetY()==y Then
      checkstam()
      UO.Press(key)
      wait(walkwait)
      If UO.GetDir()==dir AND UO.GetX()==x AND UO.GetY()==y Then
         CheckLag()
         If UO.GetDir()==dir AND UO.GetX()==x AND UO.GetY()==y Then
; zatik         
            ErrLevel=1
         Endif
      Endif
   Endif
   Return ErrLevel
end sub

sub checkstam()
var refresh = '0x0F0B'
if uo.stamina < 10 then
   uo.findtype(refresh,-1,'backpack')
   if uo.findcount() then
      uo.usetype(refresh)
      wait(1000)
   else
      uo.print("Nety Refreshey! Stoim...")
   repeat
      wait(500)
   until uo.stamina >= 10
   endif
else
endif
endsub

Sub CHECKLAG()
   del('backpack')
   uo.click('backpack')
   repeat
   wait(200)
   until uo.injournal('backpack')
   del('backpack')
endsub

Sub DEL(msg)
   while uo.injournal(msg)
   uo.setJournalLine(uo.injournal(msg)-1,"Is Empty!")
   wend
endsub

##########################################
Sub test()
##########################################
   If uo.getglobal('test')=='On' then
   uo.setglobal('test',0)
   uo.print(' !!! -= Test: OFF =- !!! ')
   uo.exec('terminate test')
   else
   uo.setglobal('test','On')
   uo.print(' !!! -= Test: On =- !!! ')
   end if
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

if uo.weight > uo.str*4-400 then
uo.print(' ok ')
endif

#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#
                                       
   uo.setglobal('test', 0 )
   uo.print(' !!! -= Test: OFF =- !!! ')
##########################################
end sub
##########################################

Posted: 2007-08-01 20:16:18
by DerMeister =)

Code: Select all

Line 42:Goto"Полетел счётчик вложености циклов"

Че, прям так и пишет? Скрин плз для моей коллекции )

Posted: 2007-08-01 20:55:15
by Allower
Тебе смешно,а у нас проблема :)

Posted: 2007-08-01 20:57:09
by Scripts Writer
goto плохой тон в программировании

Posted: 2007-08-01 21:06:51
by Allower
Еррор появился после того как добавили это

Code: Select all

while not uo.InJournal("Begging|no money", 10)
          uo.DeleteJournal()
          UO.WaitTargetObject(Vser[s])
          uo.UseSkill('Begging')
          while not uo.InJournal("Begging|no money|must wait", 10)

Может кто знает как подругому сделать, чтобы после того как он покупает реги он использовал скилл begining и летел дальше

Posted: 2007-08-01 22:08:33
by Raisefamous
Scripts Writer wrote:goto плохой тон в программировании


А есть ли какието другие варианты?

Posted: 2007-08-01 23:09:29
by Scripts Writer
Raisefamous wrote:
Scripts Writer wrote:goto плохой тон в программировании


А есть ли какието другие варианты?


Всегда

Posted: 2007-08-02 07:31:41
by Allower
Подскажи какие?

Posted: 2007-08-02 08:59:56
by Scripts Writer
Я говорю о том что скрипты всегда можно написать без использования goto за счёт условных операторов .

Posted: 2007-08-02 14:21:09
by Allower
Allower wrote:Еррор появился после того как добавили это

Code: Select all

while not uo.InJournal("Begging|no money", 10)
          uo.DeleteJournal()
          UO.WaitTargetObject(Vser[s])
          uo.UseSkill('Begging')
          while not uo.InJournal("Begging|no money|must wait", 10)

Может кто знает как подругому сделать, чтобы после того как он покупает реги он использовал скилл begining и летел дальше

Почему скрипт портиться при таком маленьком изменение?

Posted: 2007-08-02 14:58:12
by Scripts Writer
О чём мы можем здесь разговаривать если ты даже не знаешь о чём речь?

Posted: 2007-08-02 15:39:31
by Allower
Так я сюда и пришел за помошью, а не за умными словами.....

Posted: 2007-08-02 16:11:42
by Destruction
Ну допустим в приведённых циклах не хватает двух wend...

Posted: 2007-08-02 16:37:25
by Raisefamous
Где?

Posted: 2007-08-02 17:08:26
by Destruction
Raisefamous wrote:Где?

Вот уж это точно не мне судить...

Posted: 2007-08-03 00:23:06
by Ururu
Вот это нужно закрыть 2 раза =)

Code: Select all

while not uo.InJournal("Begging|no money", 10) 
uo.DeleteJournal()
UO.WaitTargetObject(Vser[s])
uo.UseSkill('Begging')
while not uo.InJournal("Begging|no money|must wait", 10)

Posted: 2007-08-03 13:00:08
by Allower
Ururu wrote:Вот это нужно закрыть 2 раза =)

Code: Select all

while not uo.InJournal("Begging|no money", 10) 
uo.DeleteJournal()
UO.WaitTargetObject(Vser[s])
uo.UseSkill('Begging')
while not uo.InJournal("Begging|no money|must wait", 10)

Благодарю, будем тестить :)