Yoko

All sides of Injection
It is currently 2024-03-28 21:16:25

All times are UTC+02:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2012-04-17 19:31:49 
Offline

Joined: 2012-03-13 15:09:30
Posts: 48
Как можно добавить в этот скрипт выгрузку драгоценных камней, что бы не прописывать все Type=0x0F26 и ......., камней??

Code:
var Chest='0x400F05E5'

sub Drop()
uo.useobject(Chest)
wait(1000)
uo.findtype('0x19B7',-1,'backpack')
repeat
   if uo.findcount() then
      uo.MoveItem('finditem','0',Chest)
   endif
wait(800)
until uo.findcount()==0
uo.findtype('0x19B7',-1,'backpack')
      wait(800)
   endif
endif
end sub


Top
   
PostPosted: 2012-04-17 20:03:27 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Драг камней всего то штук 8-10.
Массив или чтото типо такого:

Code:
sub main()
   Loot2(0xf0f, 0xf30, '-1', SundLoot, SundBi,'','','')      ; камни
endsub
   
Sub Loot2(Type1, Type2, Color, SourceContainer, TargetContainer,X,Y,Z)
   for TType = Type1 to Type2
      PUTLoot(TType, Color, SourceContainer, TargetContainer,X,Y,Z)
   next
end sub
Sub Loot(Type, Color, SourceContainer, TargetContainer,X,Y,Z)
   UO.FindType(Type, Color, SourceContainer)
   while UO.FindCount()
         timemove=UO.Timer()
         while UO.ContainerOf( UO.GetSerial('finditem') )==SourceContainer && timemove+20>UO.Timer()
            uo.MoveItem('finditem',0,TargetContainer,X,Y,Z)
            wait(lootwait)
         wend
      UO.FindType(Type, Color, SourceContainer)
   wend
end sub

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2012-04-18 20:03:35 
Offline

Joined: 2012-03-13 15:09:30
Posts: 48
отдельно лутить или выгружать я могу, просто майнеры носят собой кучи камней, пока их не убьют и не выгружают, если не сложно посоветуюте можно ли рописать все Type одной строчкой без добавления новой функции

Code:
sub main()
   Loot2(0xf0f, 0xf30, '-1', SundLoot, SundBi,'','','')      ; камни
endsub


Top
   
PostPosted: 2012-04-18 22:13:46 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
не понял вопроса. А тут сколько строк и что именно нужно чтобы делал скрипт?

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2012-04-19 13:32:35 
Offline

Joined: 2012-03-13 15:09:30
Posts: 48
Скрипт лесоруба, переделал его в майнетр, все работает, но у лесоруба и майнера немного разная выгрузка, я не смогу добавить в большой скрипт новые функции просто знаний не хватит, поэтому просто переделал скрипт выгрузки, мне хотелось бы понять или на примере что я должен добавить в свой скрипт чтобы он выгружал инги и все камни?
Code:
sub Drop()
uo.useobject(Chest)
wait(1000)
uo.findtype('0x19B7',-1,'backpack')
repeat
   if uo.findcount() then
      uo.MoveItem('finditem','0',Chest)
   endif
waits(800)
uo.findtype('0x19B8',-1,'backpack')
repeat
   if uo.findcount() then
      uo.MoveItem('finditem','0',Chest)
   endif
waits(800)
uo.findtype('0x19B9',-1,'backpack')
repeat
   if uo.findcount() then
      uo.MoveItem('finditem','0',Chest)
   endif
waits(800)
uo.findtype('0x19BA',-1,'backpack')
repeat
   if uo.findcount() then
      uo.MoveItem('finditem','0',Chest)
   endif
waits(800)
 uo.findtype('0x19B7',-1,'backpack')
until uo.findcount()==0
   endif
uo.findtype('0x19B8',-1,'backpack')
until uo.findcount()==0
   endif
uo.findtype('0x19B9',-1,'backpack')
until uo.findcount()==0
   endif
until uo.findcount()==0
uo.findtype('0x19BA',-1,'backpack')
waits(1000)
if uo.count('0x0F0E','0x0631')<GetInvis then
   uo.findtype('0x0F0E','0x0631',ResChest)
   if uo.findcount() then
      uo.moveitem('finditem',str(GetInvis-uo.count('0x0F0E','0x0631')),'backpack')
      waits(800)
   endif
endif
end sub


Top
   
PostPosted: 2012-04-19 18:48:51 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
нужно прочитать уроки про массивы и циклы for next. И попытаться осилить их. Ничего сложного в задаче нет.

Я же привел пример перекладывания ВСЕХ существующих драгоценных камней из сумки в сумку.

Ну вот пример попроще, без циклов.

Code:
var ore1 = '0x19B7'
var ore2 = '0x19BA'
var ore3 = '0x19B8'
var ore4 = '0x19B9'

sub main()
putore()    ; скидываем руду
end sub

Sub putore()
   put(ore1,bag)
   put(ore2,bag)
   put(ore3,bag)
   put(ore4,bag)
end sub

Sub PUT(item, cont)
   while UO.Count( item ) > 0
      UO.FindType( item, -1, -1 )
      UO.MoveItem( 'finditem', 0, cont )
      wait(1000)
   wend
end sub

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 19 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited