Yoko

All sides of Injection
It is currently 2025-10-17 03:50:06

All times are UTC+02:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2009-05-28 10:15:04 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
Смысл такой:
чар на охоте набрал в пак вещей. Прибегает к банку или домой и скриптом раскидывает вещи из пака по контейнерам (сундучкам).

Есть такие варианты:

Code:
var MyType,MyColor,SourceContainer,TargetContainer
VAR SundLoot = '0x40E833AF' ;бэкпак чара
VAR SundBi = '0x40E84027' ;бижутерия камни
VAR SundS = '0x4078E807' ;свитки
VAR SundB = '0x40E56321' ;бутылки
VAR SundR = '0x40312F51' ;реагенты
VAR SundD = '0x4078E807' ;одежда
VAR SundI = '0x402CE1D7' ;железяки

Sub Garb()
   UO.Set('quiet','0')
   UO.IgnoreReset()
For item ='0x1085' to '0x108b'
PUTLoot('item', '0', SundLoot, SundBi)
next
For item ='0x1f05' to '0x1f0a'
PUTLoot('item', '0', SundLoot, SundBi)
next
For item =0x0f0f' to '0xf30'; камни
PUTLoot('item', '0', SundLoot, SundBi)
next
For item ='0x1f19', '0x1f5c'
PUTLoot('item', '0', SundLoot, SundS);
next
For item ='0xF06', '0xF0D'
PUTLoot('item', '0', SundLoot, SundB);
next
For item ='0xf78' to '0xf91'; реагенты
PUTLoot('item', '0', SundLoot, SundR);
next
For item ='0xe9c' to '0xe9e'
PUTLoot('item', '0', SundLoot, SundD);
next
For item ='0xeb1' to '0xeb4'
PUTLoot('item', '0', SundLoot, SundD);
next
PUTLoot('0xe89', '0', SundLoot, SundD)
PUTLoot('0xe8a', '0', SundLoot, SundD)
PUTLoot('0x1057', '0', SundLoot, SundD)
PUTLoot('0x1058', '0', SundLoot, SundD)
PUTLoot('0x13b3', '0', SundLoot, SundD)

For item ='0x0E85' to '0x0E88'
PUTLoot('item', '0', SundLoot, SundI);
next
For item ='0x0ec2' to '0x0ec5'
PUTLoot('item', '0', SundLoot, SundI);
next
For item ='0x1438' to '0x1443'
PUTLoot('item', '0', SundLoot, SundI);
next
For item ='0x1c00' to '0x1c0d'
PUTLoot('item', '0', SundLoot, SundI);
next
PUTLoot('0x0e9b', '0', SundLoot, SundI)
PUTLoot('0x0f39', '0', SundLoot, SundI) ;лопата
PUTLoot('0x0f3a', '0', SundLoot, SundI) ;лопата
PUTLoot('0x0f51', '0', SundLoot, SundI) ;даггер
PUTLoot('0x0f52', '0', SundLoot, SundI) ;даггер
PUTLoot('0x0f93', '0', SundLoot, SundI) ;ножницы
PUTLoot('0x0f94', '0', SundLoot, SundI) ;ножницы
   Uo.Print("=== Все ===")
endsub

sub PUTLoot(MyType,MyColor,SourceContainer,TargetContainer)
uo.ignorereset()
Repeat
UO.FindType(MyType,MyColor,SourceContainer)
If uo.FindCount()>0 Then
if (TargetContainer=='ground') then
uo.MoveItem('finditem',0,TargetContainer,uo.GetX('self'),uo.GetY('self'),uo.GetZ('self'))
else
uo.MoveItem('finditem',0,TargetContainer)
end if
wait(100)
end if
Until uo.FindCount()<1 or uo.Dead()
end sub


^ кусок скрипта ^

Оно в принципе работает (не смотря на то что 16 ричные типы перебором...) но весь скрипт слишком громоздок.

Вариант забивания 1 массива на все предметы я пробовал но столбик получается на несколько сотен итемов.

Подскажите как реализовать сортировку получше. МБ закинуть все типы предметов в текстовик? Но я незнаю как это сделать в данном скрипте :(


Top
   
 Post subject:
PostPosted: 2009-05-29 09:24:15 
Offline
User avatar

Joined: 2009-05-28 09:58:28
Posts: 2802
Location: Иваново
:D Всегда знал что правильно сформулированный вопрос уже содержит 80% ответа. Сам разобрался в оптимизации скрипта. Но все еще остался вопрос про текстовый список (хотя скрипт из 100 строкового монстра превратился в 40 строковый читаемый и быстро настраиваемый).


Top
   
 Post subject:
PostPosted: 2009-05-29 09:29:47 
Offline

Joined: 2009-02-26 23:44:26
Posts: 26
делай массив
это сокращает скрипт до нескольких строк кода

другое дело чем ты его заполнишь.... :wink:


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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