подскажите плз

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
zimglads
Posts: 30
Joined: 2009-06-11 14:06:40

подскажите плз

Post by zimglads »

Code: Select all

sub Dropore() 
var Chest='0x4001CCDE' ## - ID сундука куда будут выгружаться логи.
if uo.Waiting() then 
   uo.CancelTarget() 
endif 
uo.Print('Скидываем товар.') 
uo.SetReceivingContainer(Chest) 
wait(100) 
repeat 
  UO.FindType('0x19B9','-1','my') 
  Wait(1200) 
  if UO.GetQuantity('finditem') > 0 then 
     UO.Grab('0','finditem') 
  endif 
  Wait(100) 
until not UO.Count('0x19B9') 
uo.Print('Товар на месте.') 

uo.UnSetReceivingContainer(Chest) 
end sub
почему не скидывает в статую ?

Image

ид нормальный задал .. но скидывает рядышком с неё.. статуя не активна .. как сундук при наводе на него цвет меняет ... открываеться дабл кликом .. никак иначе..

и ещё если не тяжко подскажите куда и в каком виде надо вставить
If UO.weight >= 300 Then

в сам скрипт на майнинг или в етот скрипт ? и ммм он сам пойдёт к етому сундуку ? или нужно его заставить туда пойти ? =) типа после иф вес больше 300
го ту х у тайл ?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: подскажите плз

Post by Mirage »

дабл кликом открывается контейнер или появляется прицел и потом надо указывать на то что ты хочешь переместить в неё?
zimglads
Posts: 30
Joined: 2009-06-11 14:06:40

Post by zimglads »

контейнер дабл кликом .. прицела нету .. там по финдтипу оно сразу всё скинет .. проблема в открытии контейнера ...
zimglads
Posts: 30
Joined: 2009-06-11 14:06:40

Post by zimglads »

мираж ты случайно не тот что играл когдато в гладиаторы и линейдж с Земелей (ето я ) ? =)
zimglads
Posts: 30
Joined: 2009-06-11 14:06:40

Post by zimglads »

Code: Select all

var step_timeout = 800 ; таймаут на шаг 
sub mining() 
   uo.addtype( "pickaxe" ) 
   while uo.targeting() 
      wait(200) 
   wend 
   var continue = "You loosen some rocks but fail to find any useable ore.|in your pack.|Success in work!" ; сообщения о продолжении капания этого тайла 
   var break = "Try mining in rock.|That is too far away.|There is no ore here to mine.|You can't see the target|Unexpected button input|You broke the pickaxe." ; сообщения о прекращении капания этого тайла 
   var i = 0, f = file ( "D:\mining3.txt" )  ; файлик с координатами 
   f.open() 
   var cnt = f.readNumber() 
   DIM type[ val( str( cnt ) ) ] 
   DIM tile_t[ val( str( cnt ) ) ] 
   DIM tile_x[ val( str( cnt ) ) ] 
   DIM tile_y[ val( str( cnt ) ) ] 
   DIM tile_z[ val( str( cnt ) ) ] 
   while not f.eof() 
      type[ i ] = f.readNumber() 
      tile_t[ i ] = f.readNumber() 
      tile_x[ i ] = f.readNumber() 
      tile_y[ i ] = f.readNumber() 
      tile_z[ i ] = f.readNumber() 
      i = i + 1 
   wend 
   f.close() 
   for i = 0 to cnt -1 
      if type[i] == 2 || type[i] == 1 then 
         desWalker( tile_x[i], tile_y[i] ) 
      endif 
      if type[i] == 2 || type[i] == 0 then 
         repeat 
            deljournal( break + "|" + continue ) 
            uo.waittargettile( str( tile_t[ i ] ), str( tile_x[ i ] ), str( tile_y[ i ] ), str( tile_z[ i ] ) ) 
            uo.usetype( "pickaxe" ) 
            repeat 
               wait( 100 ) 
            until uo.injournal( break + "|" + continue ) 
         until uo.injournal( break ) 
      endif 
   next 
endsub 

Sub desWalker( x, y ) 
   var dir, key, mx, my, timer 
   if x== uo.getX() && y == uo.getY() then 
      return false 
   endif 
   repeat 
      mx = uo.getX() 
      my = uo.getY() 
      key = getWalkDir( x-mx, y-my, 0, 0 ) 
      dir = getWalkDir( x-mx, y-my, 1, 0 ) 
      if Not uo.getDir() == dir then 
         uo.press( key, 2 ) 
      else 
         uo.press( key ) 
      endif 
      timer = 0 
      while uo.getX() == mx && uo.getY() == my && step_timeout / 100 > timer 
         wait( 100 ) 
         timer = timer + 1 
      wend 
   until uo.getX() == x && y == uo.getY() 
endsub
Sub getWalkDir(x, y, type, walk) 
   DIM keys[8] 
   if type == 0 then 
      if walk == 0 then 
         keys[0] = 35; End 
         keys[1] = 40; Down 
         keys[2] = 34; Page Down 
         keys[3] = 39; Right 
         keys[4] = 33; Page Up 
         keys[5] = 38; Up 
         keys[6] = 36; Home 
         keys[7] = 37; Left 
      else 
         keys[0] = 33; Page Up 
         keys[1] = 38; Up 
         keys[2] = 36; Home 
         keys[3] = 37; Left 
         keys[4] = 35; End 
         keys[5] = 40; Down 
         keys[6] = 34; Page Down 
         keys[7] = 39; Right 
      endif 
   else 
      if walk == 0 then 
         keys[0] = 4; End 
         keys[1] = 3; Down 
         keys[2] = 2; Page Down 
         keys[3] = 1; Right 
         keys[4] = 0; Page Up 
         keys[5] = 7; Up 
         keys[6] = 6; Home 
         keys[7] = 5; Left 
      else 
         keys[0] = 0; Page Up 
         keys[1] = 7; Up 
         keys[2] = 6; Home 
         keys[3] = 5; Left 
         keys[4] = 4; End 
         keys[5] = 3; Down 
         keys[6] = 2; Page Down 
         keys[7] = 1; Right 
      endif 
   endif 
   if x==0 && y > 0 then 
      return keys[0] 
   endif 
   if x==0 && y < 0 then 
      return keys[4] 
   endif 
   if x > 0 && y == 0 then 
      return keys[2] 
   endif 
   if x < 0 && y == 0 then 
      return keys[6] 
   endif 
   if x > 0 && y > 0 then 
      return keys[1] 
   endif 
   if x > 0 && y < 0 then 
      return keys[3] 
   endif 
   if x < 0 && y > 0 then 
      return keys[7] 
   endif 
   if x < 0 && y < 0 then 
      return keys[5] 
   endif 
endsub
Sub deljournal(msg)
while uo.injournal(msg)
uo.setjournalline(uo.injournal(msg)-1,"")
wend
endsub
sub OneClick() 

dim reindex[8] 
reindex[0] = 11 
reindex[1] = 12 
reindex[2] = 13 
reindex[3] = 10 
reindex[4] = 16 
reindex[5] = 14 
reindex[6] = 17 
reindex[7] = 15 
var GumpID = 0 
var ButtonID = 0 
var ButtonText 
var i = 18 

if uo.LastGump('text', 4) <> "0" then 
i = 19 
end if 
GumpID = val(Mid(uo.LastGump('command', i), 16, 4)) 
ButtonID = reindex[GumpID-2225] 
ButtonText = uo.LastGump('command', ButtonID) 
uo.LClick(Val(Mid(ButtonText, 7, 3)), Val(Mid(ButtonText, 11, 3))) 
wait(300) 

end sub 

sub AntiMacro() 

while not uo.Dead() 
if not uo.LastGump('replyed') then 
if uo.LastGump('text', 0) == 'Antimacros System' then 
OneClick() 
end if 
endif 
wait(500) 
wend 

end sub
вот сам макрос если так понятней буит О_О
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Post by Mirage »

Не тот.
Если я не путаю ничего с утра у тебя скрипт на копалку и антимакрос. Где функция скидывания руды? О_о

А понял это про вторую часть вопроса :)) Сори.

Code: Select all

var step_timeout = 800 ; таймаут на шаг 
sub mining() 
   uo.addtype( "pickaxe" ) 
   while uo.targeting() 
      wait(200) 
   wend 
   var continue = "You loosen some rocks but fail to find any useable ore.|in your pack.|Success in work!" ; сообщения о продолжении капания этого тайла 
   var break = "Try mining in rock.|That is too far away.|There is no ore here to mine.|You can't see the target|Unexpected button input|You broke the pickaxe." ; сообщения о прекращении капания этого тайла 
   var i = 0, f = file ( "D:\mining3.txt" )  ; файлик с координатами 
   f.open() 
   var cnt = f.readNumber() 
   DIM type[ val( str( cnt ) ) ] 
   DIM tile_t[ val( str( cnt ) ) ] 
   DIM tile_x[ val( str( cnt ) ) ] 
   DIM tile_y[ val( str( cnt ) ) ] 
   DIM tile_z[ val( str( cnt ) ) ] 
   while not f.eof() 
      type[ i ] = f.readNumber() 
      tile_t[ i ] = f.readNumber() 
      tile_x[ i ] = f.readNumber() 
      tile_y[ i ] = f.readNumber() 
      tile_z[ i ] = f.readNumber() 
      i = i + 1 
   wend 
   f.close() 
   for i = 0 to cnt -1 
      if type[i] == 2 || type[i] == 1 then 
         desWalker( tile_x[i], tile_y[i] ) 
      endif 
      if type[i] == 2 || type[i] == 0 then 
         repeat 
            deljournal( break + "|" + continue ) 
            uo.waittargettile( str( tile_t[ i ] ), str( tile_x[ i ] ), str( tile_y[ i ] ), str( tile_z[ i ] ) ) 
            uo.usetype( "pickaxe" ) 
            repeat 
               wait( 100 ) 
            until uo.injournal( break + "|" + continue ) || UO.Weight > 300 || UO.Dead()
         until uo.injournal( break ) || UO.Weight > 300 || UO.Dead()
				If UO.Weight > 300 Then
					UO.Print('Перегруз!')
				#какое-нибудь действиe#
				endif
      endif 
   next 
endsub 

Sub desWalker( x, y ) 
   var dir, key, mx, my, timer 
   if x== uo.getX() && y == uo.getY() then 
      return false 
   endif 
   repeat 
      mx = uo.getX() 
      my = uo.getY() 
      key = getWalkDir( x-mx, y-my, 0, 0 ) 
      dir = getWalkDir( x-mx, y-my, 1, 0 ) 
      if Not uo.getDir() == dir then 
         uo.press( key, 2 ) 
      else 
         uo.press( key ) 
      endif 
      timer = 0 
      while uo.getX() == mx && uo.getY() == my && step_timeout / 100 > timer 
         wait( 100 ) 
         timer = timer + 1 
      wend 
   until uo.getX() == x && y == uo.getY() 
endsub
Sub getWalkDir(x, y, type, walk) 
   DIM keys[8] 
   if type == 0 then 
      if walk == 0 then 
         keys[0] = 35; End 
         keys[1] = 40; Down 
         keys[2] = 34; Page Down 
         keys[3] = 39; Right 
         keys[4] = 33; Page Up 
         keys[5] = 38; Up 
         keys[6] = 36; Home 
         keys[7] = 37; Left 
      else 
         keys[0] = 33; Page Up 
         keys[1] = 38; Up 
         keys[2] = 36; Home 
         keys[3] = 37; Left 
         keys[4] = 35; End 
         keys[5] = 40; Down 
         keys[6] = 34; Page Down 
         keys[7] = 39; Right 
      endif 
   else 
      if walk == 0 then 
         keys[0] = 4; End 
         keys[1] = 3; Down 
         keys[2] = 2; Page Down 
         keys[3] = 1; Right 
         keys[4] = 0; Page Up 
         keys[5] = 7; Up 
         keys[6] = 6; Home 
         keys[7] = 5; Left 
      else 
         keys[0] = 0; Page Up 
         keys[1] = 7; Up 
         keys[2] = 6; Home 
         keys[3] = 5; Left 
         keys[4] = 4; End 
         keys[5] = 3; Down 
         keys[6] = 2; Page Down 
         keys[7] = 1; Right 
      endif 
   endif 
   if x==0 && y > 0 then 
      return keys[0] 
   endif 
   if x==0 && y < 0 then 
      return keys[4] 
   endif 
   if x > 0 && y == 0 then 
      return keys[2] 
   endif 
   if x < 0 && y == 0 then 
      return keys[6] 
   endif 
   if x > 0 && y > 0 then 
      return keys[1] 
   endif 
   if x > 0 && y < 0 then 
      return keys[3] 
   endif 
   if x < 0 && y > 0 then 
      return keys[7] 
   endif 
   if x < 0 && y < 0 then 
      return keys[5] 
   endif 
endsub
Sub deljournal(msg)
while uo.injournal(msg)
uo.setjournalline(uo.injournal(msg)-1,"")
wend
endsub
sub OneClick() 

dim reindex[8] 
reindex[0] = 11 
reindex[1] = 12 
reindex[2] = 13 
reindex[3] = 10 
reindex[4] = 16 
reindex[5] = 14 
reindex[6] = 17 
reindex[7] = 15 
var GumpID = 0 
var ButtonID = 0 
var ButtonText 
var i = 18 

if uo.LastGump('text', 4) <> "0" then 
i = 19 
end if 
GumpID = val(Mid(uo.LastGump('command', i), 16, 4)) 
ButtonID = reindex[GumpID-2225] 
ButtonText = uo.LastGump('command', ButtonID) 
uo.LClick(Val(Mid(ButtonText, 7, 3)), Val(Mid(ButtonText, 11, 3))) 
wait(300) 

end sub 

sub AntiMacro() 

while not uo.Dead() 
if not uo.LastGump('replyed') then 
if uo.LastGump('text', 0) == 'Antimacros System' then 
OneClick() 
end if 
endif 
wait(500) 
wend 

end sub
Можно сделать чтото наподобие

Code: Select all

###
				If UO.Weight > MaxVes Then
					UO.Print('Перегруз!')
					wait(500)
					BackMine()
					wait(500)
				endif

###
Sub BackMine()
i=UO.Getserial('self')
oldX=UO.GetX(i)
oldY=UO.GetY(i)
	walker(X1,Y1,1) ; идем до сундука
	wait(500)
	skid()
	wait(500)
	walker(X2,Y2,1) ; идем назад
	walker(oldX,oldY,0) ; возвращение в точку отправки.
endsub

Скидывалку опробуй вот такую:

Code: Select all

sub skid()
	var C='0x40B014E1' ; ID статуи
uo.useobject(C)
	wait(300)
	PUT(0x1BDD, C)
	PUT(0x19B9, C)
	PUT(0x19B7, C)
	PUT(0x19BA, C)
	PUT(0x19B8, C)
end sub

Sub PUT(item, cont)
	while UO.Count( item ) > 0
		UO.FindType( item, -1, -1 )
		UO.MoveItem( 'finditem', 0, cont )
		wait(300)
	wend
end sub
Post Reply