Yoko

All sides of Injection
It is currently 2026-01-19 06:45:09

All times are UTC+02:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 2008-07-14 17:04:55 
Offline
User avatar

Joined: 2006-10-24 01:51:41
Posts: 23
Location: Middle Earth
Скрипт на Poisoning для шарда Middle-Earth.
если можно то пожалуйсто сделайте что-бы скрипт брал любой вепон из контейнера "а" пойзонил егт Х зарядами, и клал в контейнер "б"
заранее спасибо.
Я не знаю что в этом скрипте не так, но он пишет, то что ошибка на 31 линии, но инжа показывает то что всего 30 строк в скрипте.
Code:
sub main()
var i=1
var x=10 #количество бутылок на каждый вепон
item_select()
   while not uo.dead()
      poison()
      uo.sayu(str(i))
      if uo.injournal(str(x)) then
         item_select()
      endif
   wend
end sub

sub item_select()
   uo.addobject('item')
   uo.print("Выбери что травим")
   while uo.targeting()
      wait(1000)
   wend
end sub

sub poison()
uo.waittargettype(0x0F0E, 0x0694)
uo.waittargetobejct('item')
uo.useskill("Poisoning")
while not uo.injournal('You succeed in poisoning the item.)
wait(10)
wend
i=i+1
end sub


Top
   
 Post subject:
PostPosted: 2008-07-14 17:20:11 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
i=i+1

Это зачем? Переменная не объявлена в контексте функции poison.

Отсюда: uo.sayu(str(i))

Будет всегда говорить единицу.

Плюс цикл без паузы, если не пройдёт условие:
if uo.injournal(str(x)) then

Которое не совсем понятно зачем нужно.

_________________
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2008-07-14 20:07:17 
Offline
User avatar

Joined: 2006-10-24 01:51:41
Posts: 23
Location: Middle Earth
Destruction wrote:
i=i+1

Это зачем? Переменная не объявлена в контексте функции poison.

Отсюда: uo.sayu(str(i))

Будет всегда говорить единицу.

Плюс цикл без паузы, если не пройдёт условие:
if uo.injournal(str(x)) then

Которое не совсем понятно зачем нужно.


i=i+1 это чтобы он считал сколько пойзонов уже закинул.
а когда проходит if uo.injournal(str(x)) then тогда он показывает таргет на следующий итем.


Top
   
 Post subject:
PostPosted: 2008-07-14 20:33:28 
Offline

Joined: 2005-04-19 18:00:29
Posts: 2259
Location: Московская область
Code:
sub main() 
var i=1
var x=10 #количество бутылок на каждый вепон
item_select()
   while not uo.dead()
      poison()
      uo.sayu(str(i))
      if uo.injournal(str(x)) then
         item_select()
      endif
   wend
end sub


Ты хочешь сказать, у тебя он пишет 1,2,3,...10 в чат?


Top
   
 Post subject:
PostPosted: 2008-07-14 23:06:04 
Offline
User avatar

Joined: 2006-10-24 01:51:41
Posts: 23
Location: Middle Earth
да :)
мну помог Beyonder, за что ему большое спасибо :)

Code:
var from_bag=0x716B7BE8
var to_bag=0x7169A58C
var ptype=0x0f0e
var pcolor=0x0694

var maxPoisonItem = 10
 
sub main()
   var item
   var ppotion

   var poisonNum

   while (true)
      uo.findtype(-1,-1,from_bag)
       item=uo.getserial('finditem')

      #no items
      if (UO.FindCount() == 0) then
         return
      endif
      
      for poisonNum = 1 to maxPoisonItem
         DeleteJournalLine('You succeed in poisoning the item')
         uo.findtype(ptype,pcolor)
          ppotion=uo.getserial('finditem')

         #no poison left
         if (UO.FindCount() == 0) then
            return
         endif

          uo.grab(1,item)
           uo.waittargetobject(ppotion,item)
      
          uo.useskill('Poisoning')

          WaitJournal('You succeed in poisoning the item',7000)
      wait(10000)
      next

       uo.moveitem(item,1,to_bag)
   wend
end sub
 
sub WaitJournal(Line,maxWait)
        if (maxWait < 0) then
                maxWait = 60*60*24*30*12
        end if
 
        while (not UO.InJournal(Line)) and (maxWait > 0)
                wait(100)
                maxWait = maxWait - 100
        wend
        wait(100)
end sub
 
Sub DeleteJournalLine(msg)
        while uo.injournal(msg)
                uo.setjournalline(uo.injournal(msg)-1,"")
        wend
end sub


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Limited