Yoko

All sides of Injection
It is currently 2025-10-16 18:05:34

All times are UTC+02:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2009-08-26 06:08:32 
Offline
User avatar

Joined: 2009-01-13 13:42:54
Posts: 8
Помогите , начинает ничего не делать после слов ('Проверяем чё купить') при запуске zakupka(); а также при запуске medved() после слов (' НАчинаем кач!')

Шард Пол097


Code:
sub zakupka()
   var sklad = '0x76B70E69'
    var book = '0x766C998A'
    var gold = '0x0EED'
    var take_count = 0
    var i = 0
    var j = 0
    var it_count

    dim items[4]
    items[0] = '0x0F3F' # Arrows
    items[1] = '0x1BFB' # Bolts
    items[2] = '0x13B1' # Bows
    items[3] = '0x0F4F' # Crossbow

    dim no_buy[4]
    no_buy[0] = 0
    no_buy[1] = 0
    no_buy[2] = 0
    no_buy[3] = 0

    dim items_max[4]
    items_max[0] = 300
    items_max[1] = 300
    items_max[2] = 4
    items_max[3] = 2

    dim take[4]
    take[0] = 6000
    take[1] = 6000
    take[2] = 1400
    take[3] = 1400

    dim buy_fraza[4]
   buy_fraza[0] = ",buy arrow"
   buy_fraza[1] = ",buy bolt"
    buy_fraza[2] = ",buy bows"
    buy_fraza[3] = ",buy cross"

    #Проверяем чё надо
    uo.exec('terminate detect')
    uo.print("ПРОВЕРЯЕМ чё нада купить!")
    uo.IgnoreReset()
    uo.useobject(sklad)
    wait(500)
    CheckLag()
    for i = 0 to 3
       it_count = 0
       uo.findtype(items[i], -1, sklad)
       while uo.findcount()
           it_count = it_count + uo.getquantity('finditem')
         uo.ignore('finditem')
            uo.findtype(items[i], -1, sklad)
        wend
        if it_count >= items_max[i] then
           no_buy[i] = 1
        else
           take_count = take_count + take[i]
       endif
    next
    uo.IgnoreReset()

    #Если ничё ненада то никуда не идём
    if take_count == 0 then
       uo.print('ВСЁ НА МАЗИ ОСТАЯЁМСЯ ДОМА!')
       return uo.Exec('exec medved')
    endif


     # Берём бабки

    uo.findtype(gold, -1, sklad)
    while uo.gold < take_count and uo.findcount()
       uo.moveitem('finditem', (take_count - uo.gold))
        wait(500)
        CheckLag()
        uo.findtype(gold, -1, sklad)
    wend

    if uo.gold <  take_count then
       CheckLag()
        uo.print("БАБЛА НЕТ! СКАЧАЕМСЯ ДАЛЬШЕ!")
          return uo.Exec('exec medved')
    endif

    #Раздеваемся

    uo.disarm()
    wait(1000)
    CheckLag()
    for i = 0 to 3
       uo.findtype(items[i], -1)
        while uo.FindCount()
           uo.moveitem('finditem', 0,  sklad)
            wait(500)
            CheckLag()
            uo.findtype(items[i], -1)
        wend
    next

    #Начинаем реколиться по шопам
    for i = 0 to 4
         CheckLag()
      recall(i, book)
        wait(6500)
        uo.UseSkill("Detect Hidden")
        wait(1000)
        uo.sayu('Guards!!!')
        for j = 0 to 3
           if no_buy[j] == 0 then
               uo.sayu(buy_fraza[j])
                wait(2500)
            endif
        next
    next

    #Пиздуем домой
    CheckLag()
    recall(5, book)
    wait(7000)

    #Разгружаемся
    uo.useobject(sklad)
    for i = 0 to 3
       uo.findtype(items[i], -1)
        while uo.FindCount()
           uo.moveitem('finditem', 0,  sklad)
            wait(500)
            CheckLag()
            uo.findtype(items[i], -1)
        wend
    next


    #Перезарядка буки
    CheckLag()
    UO.FindType('0x1F4C', -1, sklad)
   wait(1000)
   uo.useobject(book)
   wait(2000)
   CheckLag()
   uo.waittargetobject('finditem')
   uo.lclick(243,22)
   wait(10000)
    CheckLag()
    return uo.Exec('exec medved')

endsub


sub medved()
     var sklad = '0x76B70E69'
     var timerz, i
     var medvedz_count = 0
     dim medvedz[256]
     var timeout = 10200

     dim patroni[2]
     dim oruzie[2]

     var j = 0

     patroni[0] = '0x0F3F' # Arrows
     patroni[1] = '0x1BFB' # Bolts
     oruzie[0] = '0x13B1' # Bows
     oruzie[1] = '0x0F4F' # Crossbow


     timerz = uo.Timer()

     uo.exec('exec detect')
     uo.print('Ищем МЕДВЕДЕЙ!')
     uo.useobject(sklad)
     uo.IgnoreReset()
     uo.set( 'finddistance', 10 )
     UO.FindType('0x00D4', -1, 'ground')
     while UO.FindCount()
       medvedz[medvedz_count] = UO.GetSerial('finditem')
        UO.Ignore(medvedz[medvedz_count])
        medvedz_count = medvedz_count + 1
       UO.FindType('0x00D4', -1, 'ground')
     wend
     uo.set( 'finddistance', 32 )

     uo.print('Начинаем КАЧ!')

     j = 0

     while 1
        for i = 0 to (medvedz_count - 1)
           uo.warmode(0)
           if uo.getHP(medvedz[i]) > ((uo.getMaxHP(medvedz[i]) / 3 * 2)) then
               check:
                CheckLag()
                if uo.count(patroni[j]) < 1 then
                   uo.findtype(patroni[j], -1, sklad)
                    if uo.findcount() then
                       uo.moveitem('finditem', 300)
                        wait(500)
                    else
                       if j == 0 then
                           j = 1
                            uo.disarm()
                            wait(500)
                            CheckLag()
                            goto check
                        else
                           uo.warmode(0)
                            return
                        endif
                    endif
                endif
                CheckLag()
                if uo.ObjAtLayer('Rhand') == "" then
                   uo.findtype(oruzie[j], -1, sklad)
                    wait(500)
                    if uo.findcount() then
                       uo.moveitem('finditem', 0)
                        wait(500)
                        CheckLag()
                    uo.Equipt('Rhand', oruzie[j])
                    else
                        if j == 0 then
                           j = 1
                            wait(500)
                            CheckLag()
                            goto check
                        else
                           uo.warmode(0)
                            return
                        endif
                    endif
              endif
              uo.warmode(1)
            uo.attack(medvedz[i])
               wait(2000)
           endif
           if (timerz + timeout) <= uo.Timer() then
               uo.warmode(0)
                CheckLag()
                uo.print("Идём ЗАКУПАЦО")
                return uo.Exec('exec zakupka')
            endif
            wait(500)
            uo.print("До закупки: " + str((timerz + timeout) - uo.Timer()))
         next
     wend

endsub




sub recall(id, runebook)
   var y
   var x = 63
   y = 68 + (id * 14)
   repeat
      CheckLag()
      uo.rclick(198,128)
      wait(500)
      uo.useobject(runebook)
      wait(2000)
      uo.lclick(x, y)
      wait(500)
   until uo.InJournal("Kal Ort Por")
end sub


sub CheckLag()
   if uo.Waiting()>0 then
      uo.Exec('canceltarget')
   end if
   uo.DeleteJournal()
   uo.Click('backpack')
   repeat
      wait(50)
   until uo.InJournal('backpack')
end sub

sub Detect()
  while uo.SkillVal("Detect Hidden") < 1000
    uo.UseSkill("Detect Hidden")
    wait(2000)
  wend
  end sub


БЛАГОДАРЮ


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited