Хочется немного исправить скриптик...

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Maryssa
Posts: 4
Joined: 2006-03-21 18:13:24
Contact:

Хочется немного исправить скриптик...

Post by Maryssa »

Code: Select all

sub heal()    
VAR X=0 
repeat 
   if uo.life < 90 then
   uo.unequip("Rhand") 
   while uo.life < uo.str 
      uo.exec("bandageself") 
      uo.deletejournal() 
      while not (X == 60 or uo.injournal("backpack") or uo.injournal ("reach that") or uo.injournal("current state") or uo.injournal("barely") or uo.injournal("mummy") or uo.injournal("target info")) 
         wait(100) 
         X=X+1 
         if uo.injournal("reach that") or uo.injournal("current state") or uo.injournal("target info") then 
            wait(1000) 
         endif 
         if uo.stamina < 65 then 
            uo.usetype("0x0F0B") ;drink refresh potion 
         endif 
      wend 
   X=0 
   wend 
      uo.deletejournal() 
      uo.usetype("0x1B7B") ;sheild 
      uo.usetype("0x143C") ;sword
   endif 
wait(100) 
until uo.dead() 
end sub
Хочу сделать, чтобы скрипт действовал только когда есть бинтики, а то когда их нету он постоянно пытается их найти и наступает полный ужас :) И ещё хочу чтобы была какая-то задержка при лечении..
Спасибо
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

Code: Select all

 uo.FindType(band,-1,'backpack')
 if uo.Count('finditem') > 0 then 
    uo.bandageself()
 end if
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

ну Троцкий извас скриптер... Может ты забудишь про это?;)

Code: Select all

 uo.FindType(band,-1,'backpack') 
 if uo.Count('finditem') > 0 then 
    uo.bandageself() 
 end if
это же шедевр...

Code: Select all

if uo.Count(band) > 0 then 
    uo.bandageself() 
 end if
Maryssa
Posts: 4
Joined: 2006-03-21 18:13:24
Contact:

Post by Maryssa »

Из меня то уж скриптер точно никакой :)) Так что дайте мне готовенький скриптик уже, а то я щас налеплю что-то плохое чувствую ;(
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

Проверку на наличие бинтов вставил, а задержка там итак есть - он ждет, пока не увидит нужного сообщения в журнале.

Code: Select all

sub heal()    
VAR X=0 
repeat 
   if uo.life < 90 and (uo.count(band) > 0) then 
   uo.unequip("Rhand") 
   while uo.life < uo.str 
      uo.exec("bandageself") 
      uo.deletejournal() 
      while not (X == 60 or uo.injournal("backpack") or uo.injournal ("reach that") or uo.injournal("current state") or uo.injournal("barely") or uo.injournal("mummy") or uo.injournal("target info")) 
         wait(100) 
         X=X+1 
         if uo.injournal("reach that") or uo.injournal("current state") or uo.injournal("target info") then 
            wait(1000) 
         endif 
         if uo.stamina < 65 then 
            uo.usetype("0x0F0B") ;drink refresh potion 
         endif 
      wend 
   X=0 
   wend 
      uo.deletejournal() 
      uo.usetype("0x1B7B") ;sheild 
      uo.usetype("0x143C") ;sword 
   endif 
wait(100) 
until uo.dead() 
end sub
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

Grin wrote:ну Троцкий извас скриптер... Может ты забудишь про это?;)

Code: Select all

 uo.FindType(band,-1,'backpack') 
 if uo.Count('finditem') > 0 then 
    uo.bandageself() 
 end if
это же шедевр...

Code: Select all

if uo.Count(band) > 0 then 
    uo.bandageself() 
 end if
тоже неплохой вариант %)
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Это самый простой... А твой так вообще работать не будет;)
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

не звезди. будет всё работать
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Проверь;)))
Maryssa
Posts: 4
Joined: 2006-03-21 18:13:24
Contact:

Post by Maryssa »

flake wrote:Проверку на наличие бинтов вставил, а задержка там итак есть - он ждет, пока не увидит нужного сообщения в журнале.

Code: Select all

sub heal()    
VAR X=0 
repeat 
   if uo.life < 90 and (uo.count(band) > 0) then 
   uo.unequip("Rhand") 
   while uo.life < uo.str 
      uo.exec("bandageself") 
      uo.deletejournal() 
      while not (X == 60 or uo.injournal("backpack") or uo.injournal ("reach that") or uo.injournal("current state") or uo.injournal("barely") or uo.injournal("mummy") or uo.injournal("target info")) 
         wait(100) 
         X=X+1 
         if uo.injournal("reach that") or uo.injournal("current state") or uo.injournal("target info") then 
            wait(1000) 
         endif 
         if uo.stamina < 65 then 
            uo.usetype("0x0F0B") ;drink refresh potion 
         endif 
      wend 
   X=0 
   wend 
      uo.deletejournal() 
      uo.usetype("0x1B7B") ;sheild 
      uo.usetype("0x143C") ;sword 
   endif 
wait(100) 
until uo.dead() 
end sub
При загрузке выдает: Line 4: Variable undefined - BAND...
Что делать?
Kynep
Expert!
Posts: 1348
Joined: 2006-02-07 08:51:40
Location: г. Старый Оскол
Contact:

Post by Kynep »

Maryssa wrote:
flake wrote:Проверку на наличие бинтов вставил, а задержка там итак есть - он ждет, пока не увидит нужного сообщения в журнале.

Code: Select all

sub heal()    
VAR X=0 
repeat 
   if uo.life < 90 and (uo.count(band) > 0) then 
   uo.unequip("Rhand") 
   while uo.life < uo.str 
      uo.exec("bandageself") 
      uo.deletejournal() 
      while not (X == 60 or uo.injournal("backpack") or uo.injournal ("reach that") or uo.injournal("current state") or uo.injournal("barely") or uo.injournal("mummy") or uo.injournal("target info")) 
         wait(100) 
         X=X+1 
         if uo.injournal("reach that") or uo.injournal("current state") or uo.injournal("target info") then 
            wait(1000) 
         endif 
         if uo.stamina < 65 then 
            uo.usetype("0x0F0B") ;drink refresh potion 
         endif 
      wend 
   X=0 
   wend 
      uo.deletejournal() 
      uo.usetype("0x1B7B") ;sheild 
      uo.usetype("0x143C") ;sword 
   endif 
wait(100) 
until uo.dead() 
end sub
При загрузке выдает: Line 4: Variable undefined - BAND...
Что делать?

Вставь тип бинтов:

Code: Select all

sub heal()    
VAR X=0 
VAR band=0x0E21 # Тип бинтов на ДРВ
repeat 
   if uo.life < 90 and (uo.count(band) > 0) then 
   uo.unequip("Rhand") 
   while uo.life < uo.str 
      uo.exec("bandageself") 
      uo.deletejournal() 
      while not (X == 60 or uo.injournal("backpack") or uo.injournal ("reach that") or uo.injournal("current state") or uo.injournal("barely") or uo.injournal("mummy") or uo.injournal("target info")) 
         wait(100) 
         X=X+1 
         if uo.injournal("reach that") or uo.injournal("current state") or uo.injournal("target info") then 
            wait(1000) 
         endif 
         if uo.stamina < 65 then 
            uo.usetype("0x0F0B") ;drink refresh potion 
         endif 
      wend 
   X=0 
   wend 
      uo.deletejournal() 
      uo.usetype("0x1B7B") ;sheild 
      uo.usetype("0x143C") ;sword 
   endif 
wait(100) 
until uo.dead() 
end sub
Если на ДРВ то 0x0E21
SLAK
Posts: 182
Joined: 2005-08-19 16:12:23
Contact:

Post by SLAK »

You Must Die wrote:не звезди. будет всё работать
Небудит, каунт работает с типом и цветом, а не с объектом. Вот гетквантити с обьектом.
Зы: нашел с кем спорить :)
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Post by Scripts Writer »

SLAK wrote:
You Must Die wrote:не звезди. будет всё работать
Небудит, каунт работает с типом и цветом, а не с объектом. Вот гетквантити с обьектом.
Зы: нашел с кем спорить :)
а мы че ищем мля?

Code: Select all

band = ' Type of bandages' 
-не лезь не в свои дела, и тести прежде чем высказываться


2ToGrin - тебе как, видео записать и отослать? -Проверено. Работает, проверяй теперь у себя сам, лол мля
SLAK
Posts: 182
Joined: 2005-08-19 16:12:23
Contact:

Post by SLAK »

You Must Die wrote:

Code: Select all

 uo.FindType(band,-1,'backpack')
 if uo.Count('finditem') > 0 then 
    uo.bandageself()
 end if
Здеся
uo.count('finditem') - и есть ошибка, ты загнал значения объекта, а не типа!!!
ЗЫ: проспись :D
Kynep
Expert!
Posts: 1348
Joined: 2006-02-07 08:51:40
Location: г. Старый Оскол
Contact:

Post by Kynep »

SLAK wrote:
You Must Die wrote:

Code: Select all

 uo.FindType(band,-1,'backpack')
 if uo.Count('finditem') > 0 then 
    uo.bandageself()
 end if
Здеся
uo.count('finditem') - и есть ошибка, ты загнал значения объекта, а не типа!!!
ЗЫ: проспись :D
Типы, объекты... не буровьте, вот, и все работает:

Code: Select all

uo.FindType(band,-1,'backpack')
 if UO.GetQuantity('finditem') > 0 then 
    uo.bandageself()
 end if
Maryssa
Posts: 4
Joined: 2006-03-21 18:13:24
Contact:

Post by Maryssa »

Спасибо, вроде все работает так как и я хотела
Post Reply