Yoko

All sides of Injection
It is currently 2026-01-19 09:52:57

All times are UTC+02:00




Post new topic  Reply to topic  [ 16 posts ] 
Author Message
PostPosted: 2007-11-30 19:43:53 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
Суть такая. Я копаю на постороннем софте, у этого софта замечен баг, когда руда на кнопке "сворачивания" бакпака - он не может ее взять почему то и берет бакпак, и не разгружает!!!!!!!

Просьба такая! Помочь сделать скрипток если руда вне доступных руками границ бакпака - чтобы ее перекладывало в серединку))


Top
   
 Post subject:
PostPosted: 2007-12-05 09:47:17 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
мм?? :oops:


Top
   
 Post subject:
PostPosted: 2007-12-05 09:59:24 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
А сам ?

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

Code:
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

_________________
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.
Skype: d119060


Last edited by Destruction on 2007-12-05 14:13:19, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2007-12-05 13:23:03 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
Спасибо за отзывчивость!

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

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


Top
   
 Post subject:
PostPosted: 2007-12-05 14:14:29 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
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.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-12-05 14:24:59 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
балин, а я порадовался что тебе известны координаты "доступных" мест))))))


Top
   
 Post subject:
PostPosted: 2007-12-05 15:22:33 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
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.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-12-05 15:25:49 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
Печально.


Top
   
 Post subject:
PostPosted: 2007-12-05 16:19:03 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
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.
Skype: d119060


Top
   
 Post subject:
PostPosted: 2007-12-05 18:53:35 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
Grin wrote:
Печально.


Прив! Порадуй)))


Top
   
 Post subject:
PostPosted: 2007-12-08 00:19:19 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
,info Левого верхнего предмета:
Code:
X=44 Y=65

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


,info Правого нижнего предмета:
Code:
X=142 Y=131

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


Подставил...
Получил:
Code:
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:


Top
   
 Post subject:
PostPosted: 2007-12-08 00:27:45 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
Code:
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


Top
   
 Post subject:
PostPosted: 2007-12-08 01:28:12 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
Спасибо Грин! Пожертвовали крутой сравнилкой по координатам, за то получили почти то, что хотелось!!!


Top
   
 Post subject:
PostPosted: 2007-12-08 01:45:57 
Offline
Expert!
User avatar

Joined: 2005-05-04 14:05:19
Posts: 2580
Location: Москва
она так нужна была?


Top
   
 Post subject:
PostPosted: 2007-12-08 09:31:40 
Offline
User avatar

Joined: 2006-08-06 10:23:20
Posts: 117
Неа. Как бы было приятнее наверное, типа скрипт грамотнее) Но нет, и так всё стабильно)


Top
   
 Post subject:
PostPosted: 2007-12-08 18:37:14 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
Точно.. игнор забыл.. :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.
Skype: d119060


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 0 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