Yoko

All sides of Injection
It is currently 2025-12-17 19:59:14

All times are UTC+02:00




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: 2008-03-11 02:54:49 
Offline

Joined: 2007-04-26 23:35:15
Posts: 220
Решил сделать сортировку банка, а то хлама навалилось жуть))
Ну и как всегда работает, только криво :) Сортирует только реги.. не понимаю почему.

Code:
sub banksorter{
$regpack = '0x418CB969';
#----------------------------------------------------------------------------
  my @wepbag = ("0x417f4ac8", "0x4185398a", "0x417daef6", "0x417e70bc", "0x417d4d92", "0x417d3d58");
  #katanas,kryss,viking sword,longsword, magic staff, cutlass
  my $weptq = scalar(@wepbag);

  my @armorbag = ("0x4183b723","0x4180c3a9","0x417d30ff","0x417dc775","0x417e5881","0x417e70bc","0x417d3d58");
  #berserker, snow, scorp, reptile, acid maniac, plusarm, gargul
  my $armtq = scalar(@armorbag);

#----------------------------------------------------------------------------
  my @weapon = ("0x13fe","0x1400","0x1400","0x0f61","0x13f8","0x1440");
  # katana, kryss, viking sword, longsword, magic staff, cutlass

  my @armor = ("0x07ec","0x0481","0x0497","0x049f","0x049c","0x048f","0x0482");
  # bers, snow, scorp, reptilem acid, plus, gargule

  my @full = ("0x1410","0x1411","0x1412","0x1413","0x1414","0x1415","0x1c04","0x140e","0x13c4","0x13c4","0x1b76","0x13ef","0x1b7b","0x13ca");
  # plate, plate, plate, plate, plate, liv4ik, helm, xz, chainmail, heather, chain arm, buckler, tunic
  my $fulltq = scalar(@full);

  my @regs = ("0x0f7a","0x0f7b","0x0f8d","0x0f84","0x0f85","0x0f86","0x0f88","0x0f8c","0x0e21");
  # bp, bm, ss, gl, gs, mr, ns, sa, bandages
  my $regstq = scalar(@regs);
#----------------------------------------------------------------------------
  uo::msg('bank');
  &wait(100);
  #uo::usefromground('0x20e0'); # open bank
  &wait(100);
  for ($i = 1; $i != $weptq; $i++) {
    &banksort( 0, @weapon[$i], -1, @wepbag[$i] ); # weapons
    &wait(100);
  }
  for ($n = 1; $n != $fulltq; $n++){
    for ($i = 1; $i != $armtq; $i++) {
      &banksort( 0, @full[$n], @armor[$i], @armorbag[$i] ); # armors
      &wait(100);
    }
  }
  for ($i = 1; $i != $regstq; $i++) {
    &banksort( 0, $regs[$i], -1, $regpack); # regs, bandages
    &wait(100);
  } $i = 1 ;
}

sub banksort { # { from }, { type }, { color }, { where }
  my($from, $type, $color, $where);
  $from = $_[0]; $type = $_[1]; $color = $_[2]; $where = $_[3];
  if ($from == 0) {
    $from = 'lastcontainer';
  } uo::ignorereset();
  do{
    uo::findtype($type, $color, $from);
    if (uo::findcount()) {
      uo::moveitem('finditem', -1, $where);
      &wait(100);
    }
  } until (uo::findcount() == 0);
  uo::ignore('lastcontainer');
}


ЗЫ Рабочий аналог на простом инжекте..

Code:

sub BankSorter()
  var WepTQ = 6 ; количество типов оружия для сортировки
  Dim WepBag[ val( str( WepTQ ) ) ] ; сериалы сумок для сортировки оружия
  WepBag[1] = '0x417F4AC8' ; bag for katanas
  WepBag[2] = '0x4185398A' ; bag for kryss
  WepBag[3] = '0x417DAEF6' ; bag for viking sword
  WepBag[4] = '0x417E70BC' ; bag for longsword
  WepBag[5] = '0x417D4D92' ; bag for magic staff
  WepBag[6] = '0x417D3D58' ; bag for cutlass

  var ArmTQ = 7 ; количество типов брони для сортировки
  Dim ArmorBag[ val( str( ArmTQ ) ) ]  ; сериалы сумок для сортировки брони
  ArmorBag[1] = '0x4183B723' ; bag for berserker
  ArmorBag[2] = '0x4180C3A9' ; bag for snow
  ArmorBag[3] = '0x417D30FF' ; bag for scorpion
  ArmorBag[4] = '0x417DC775' ; bag for reptile
  ArmorBag[5] = '0x417E5881' ; bag for acid maniac
  ArmorBag[6] = '0x417E70BC' ; bag for +1,+3,+5,+7
  ArmorBag[7] = '0x417D3D58' ; bag gargul

  Dim weapon[ val( str( WepTQ ) ) ]    ; Оружие для сортировки
  weapon[1] = '0x13FE' ; katana
  weapon[2] = '0x1400' ; kryss
  weapon[3] = '0x1400' ; viking sword
  weapon[4] = '0x0F61' ; longsword
  weapon[5] = '0x13F8' ; magic staff
  weapon[6] = '0x1440' ; cutlass

  Dim Armor[ val( str( ArmTQ ) ) ]    ; броня для сортировки
  Armor[1] = '0x07EC' ; berserker
  Armor[2] = '0x0481' ; snow
  Armor[3] = '0x0497' ; scorpion
  Armor[4] = '0x049F' ; reptile
  Armor[5] = '0x049C' ; acid maniac
  Armor[6] = '0x048F' ; +1,+3,+5,+7
  Armor[7] = '0x0482' ; gargule

  Var FullTQ = 14
  Dim Full[ val( str( FullTQ ) ) ]    ; типы арморов
  Full[1] = '0x1412' ; plate arm
  Full[2] = '0x1413' ; plate arm
  Full[3] = '0x1415' ; plate arm
  Full[4] = '0x1411' ; plate arm
  Full[5] = '0x1410' ; plate arm
  Full[6] = '0x1414' ; plate arm
  Full[7] = '0x1C04' ; plate liv4ik
  Full[8] = '0x140E' ; plate helm
  Full[9] = '0x13C4' ; xz
  Full[10] = '0x13C4' ; chainmail
  Full[11] = '0x1B76' ; heather
  Full[12] = '0x13EF' ; chain arms
  Full[13] = '0x1B7B' ; buckler
  Full[14] = '0x13CA' ; tunic
 
  var RegsTQ = 9
  Dim Regs[ val( str( RegsTQ ) ) ]     ; Реги, бинты, скролы
  Regs[1] = '0x0F7A'   ; black pearls
  Regs[2] = '0x0F7B'   ; bood moss
  Regs[3] = '0x0F8D'   ; spiders silk
  Regs[4] = '0x0F84'   ; garlic
  Regs[5] = '0x0F85'   ; ginseng
  Regs[6] = '0x0F86'   ; mandrake root
  Regs[7] = '0x0F88'   ; night shade
  Regs[8] = '0x0F8C'   ; sulphorous ash
  Regs[9] = '0x0E21'   ; Bandages
;----------------------------------------------------------------------------
  uo.msg('Bank')
  wait(100)
  UO.Usefromground('0x20E0') ; open bank
  wait(100)
  var i,n
  start:
  For i = 1 to WepTQ
    banksort( 0, weapon[i], -1, WepBag[i] )
    wait(100)
    ;UO.MoveItem( WepBag[i], -1, uo.getglobal('MainWepBag') )
  next
  For n = 1 to FullTQ
    For i = 1 to ArmTQ
      banksort( 0, Full[n], Armor[i], ArmorBag[i] )
      wait(100)
      ;UO.MoveItem( ArmorBag[i], -1, uo.getglobal('MainArmBag') )
    next
  next
  For i = 1 to RegsTQ
    banksort( 0, Regs[i], -1, uo.getglobal('MainRegBag') )
    wait(100)
  next
  For i = 1 to ArmTQ
      banksort( 0, '0x1BEF', -1, uo.getglobal('MainIngotBag') )
  next
  banksort( 0, '0x0E85', -1, uo.getglobal('MainIngotBag') ) ; pickaxe
end sub

sub BankSort( From, ItemType, Color, where )
  If From == 0 || From == '' then
    From = 'lastcontainer'
  endif
  UO.IgnoreReset()
  Repeat
    UO.FindType(ItemType, Color, From)
    If UO.FindCount() Then
      UO.MoveItem('finditem', -1, where)
      Wait(100)
    EndIf
  Until (Not UO.FindCount())
  UO.Ignore('lastcontainer')
endsub



Грин, я тебя жду :wink:


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 5 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