Page 1 of 1

MassMove с земли...

Posted: 2004-06-26 17:10:41
by psiworm
сабж
из сумок на земле получается, а с земли не идет...

Posted: 2004-06-26 19:54:51
by Lord Ruslan Nightmare

Code: Select all

sub uoPromptObject(s)
  var needserial = 1
  while needserial
    uo.exec("addobject " + s)
    while uo.targeting()
      wait(50)
    wend
    if uo.getserial(s) <> "0x00000000" then
      needserial = 0
    endif
  wend
  return uo.getserial(s)
end sub

sub massmove()
  var backpack
  var maxquant = 70 #max number of items to move
  var delay = 400 #move delay
  var item
  var moved = 0
  var quant = 0
  var obj = PromptObject("Select Object Of Type To MassMove")
  var type = uo.GetGraphic(obj)
  var color = "-1" #color of items to move
  # OR var color = uo.GetColor(obj)
  var cont = uo.containerof(obj)
  if cont = "0x00000000" then
    cont = "ground"
  endif
  var x = -100,y = -100
  uo.findtype(type,color,cont)
  while uo.findcount() and quant <= maxquant
    item = uo.getserial("finditem")
    moved = 0     
    if x == -100 then
      uo.moveitem(item)
    else
      uo.moveitem(item,color,backpack,str(x),str(y),"0")
    endif
    while not moved     
      wait(delay)
      if not uo.containerof(item) == cont then
        moved = 1
        if quant == 0 then
          x = uo.getx(item)
          y = uo.gety(item)
          uo.findtype("-1")
          backpack = uo.containerof("finditem")           
        endif
        quant = quant + 1
      endif
    wend
    uo.findtype(type,color,cont)
  wend
end sub