Немного необычно) Но нужно)

Ask for scripts here

Moderators: Murderator+, Murderator

Post Reply
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Немного необычно) Но нужно)

Post by TarantuL »

Суть такая. Я копаю на постороннем софте, у этого софта замечен баг, когда руда на кнопке "сворачивания" бакпака - он не может ее взять почему то и берет бакпак, и не разгружает!!!!!!!

Просьба такая! Помочь сделать скрипток если руда вне доступных руками границ бакпака - чтобы ее перекладывало в серединку))
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

мм?? :oops:
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

А сам ?

uo.findtype, uo.getx(), uo.getY() - и всего делов-то..

Code: Select all

sub fixOre()
   var i, x, y
   ; объявление "доступных" координат рюкзака
   var min_x = 5
   var min_y = 5
   var max_x = 500
   var max_y = 500
   ; объявление координат куда перекидывать
   var move_x = 200
   var move_y = 200
   DIM ore[4]
   ore[0] = "0x0000"
   ore[1] = "0x0000"
   ore[2] = "0x0000"
   ore[3] = "0x0000"
   for i = 0 to 3
      uo.findtype( ore[ i ], '-1', 'backpack' )
      while uo.findcount()
         x = uo.getX( 'finditem' )
         y = uo.getY( 'finditem' )
         if x < min_x || x > max_x || y < min_y || y > max_y then
            uo.moveitem( 'finditem', '0', 'backpack', str( move_x ), str(  move_y ), '0' )
            wait( 500 )
         endif
         uo.findtype( ore[ i ], "-1", "backpack" )
      wend
   next
   uo.ignorereset()
endsub
Last edited by Destruction on 2007-12-05 14:13:19, edited 1 time in total.
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.
Telegram: @tatikom
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

Спасибо за отзывчивость!

Типы вписал! Вроде больше ничего не нужно!

Но скрипт запускается и ничего не делает.
Слева пишется что нашел 1 итем и так до самого верху пишет и пишет :roll: :oops: :lol:
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

TarantuL wrote:Спасибо за отзывчивость!

Типы вписал! Вроде больше ничего не нужно!

Но скрипт запускается и ничего не делает.
Слева пишется что нашел 1 итем и так до самого верху пишет и пишет :roll: :oops: :lol:

1. Выключи Verbose Menu - нафиг не нужно.
2. Впиши координаты, я же их с потолка написал :)
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.
Telegram: @tatikom
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

балин, а я порадовался что тебе известны координаты "доступных" мест))))))
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

TarantuL wrote:балин, а я порадовался что тебе известны координаты "доступных" мест))))))

Мне - нет. Потолку, как выяснилось - тоже нет.
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.
Telegram: @tatikom
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Печально.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Grin wrote:Печально.

Согласен. По обоим пунктам печально.
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.
Telegram: @tatikom
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

Grin wrote:Печально.


Прив! Порадуй)))
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

,info Левого верхнего предмета:

Code: Select all

X=44 Y=65

Стало быть минимальные х и у


,info Правого нижнего предмета:

Code: Select all

X=142 Y=131

Стало быть максимальные х и у


Подставил...
Получил:

Code: Select all

sub fixOre()
   var i, x, y
   
   var min_x = 44
   var min_y = 65
   var max_x = 142
   var max_y = 131
   
   var move_x = 95
   var move_y = 85
   DIM ore[4]
   ore[0] = "0x19B7"
   ore[1] = "0x19BA"
   ore[2] = "0x19B8"
   ore[3] = "0x19B9"
   for i = 0 to 3
      uo.findtype( ore[ i ], '-1', 'backpack' )
      while uo.findcount()
         x = uo.getX( 'finditem' )
         y = uo.getY( 'finditem' )
         if x < min_x || x > max_x || y < min_y || y > max_y then
            uo.moveitem( 'finditem', '0', 'backpack', str( move_x ), str(  move_y ), '0' )
            wait( 500 )
         endif
         uo.findtype( ore[ i ], "-1", "backpack" )
      wend
   next
   uo.ignorereset()
endsub



Результат то бездействие, то анхандлел ерор вместе с флудом, что ему не нравится как задано FindType... вроде ..

Дестракшен, помоему ты что-то не учёл.... Если есть время посмотри пожалуйста.. :oops:
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

Code: Select all

sub fixOre() 
   var i
   
   var move_x = 95
   var move_y = 85
   DIM ore[4]
   ore[0] = "0x19B7"
   ore[1] = "0x19BA"
   ore[2] = "0x19B8"
   ore[3] = "0x19B9"
   for i = 0 to 3
      uo.findtype( ore[ i ], '-1', 'backpack' )
      while uo.findcount()
        uo.moveitem( 'finditem', '0', 'backpack', str( move_x ), str(  move_y ), '0' )
        wait(500)
        uo.Ignore('finditem')
        uo.findtype( ore[ i ], "-1", "backpack" )
      wend
   next
   uo.ignorereset()
endsub
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

Спасибо Грин! Пожертвовали крутой сравнилкой по координатам, за то получили почти то, что хотелось!!!
Grin
Expert!
Posts: 2580
Joined: 2005-05-04 14:05:19
Location: Москва

Post by Grin »

она так нужна была?
TarantuL
Posts: 117
Joined: 2006-08-06 10:23:20

Post by TarantuL »

Неа. Как бы было приятнее наверное, типа скрипт грамотнее) Но нет, и так всё стабильно)
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Точно.. игнор забыл.. :roll:
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.
Telegram: @tatikom
Post Reply