Помогите исправить пожалуйста

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
jaison
Posts: 18
Joined: 2004-08-26 13:00:26

Помогите исправить пожалуйста

Post by jaison »

Сообственно вот этот скрипт

Code: Select all

sub main()
; + EDIT +++++++++++++++++++++++++++++++++++++++++++++++
var zona = 6;
; ++++++++++++++++++++++++++++++++++++++++++++++++++
var m, i, a, tX, tY, tr = 1
tX = UO.GetX('self')
tY = UO.GetY('self')
for i=1 to zona
if tr then
m = - 5
else
m = 5
endif
for a=1 to zona
tY = tY + m
GotoXY(tX,tY)
Lamber()
next
tX = tX - 5
if tr then
tr = 0
else
tr = 1
endif
next
endsub

sub Lamber()
; + EDIT +++++++++++++++++++++++++++++++++++++++++++++++
var MaxFailCount = 10; fizzle
var MaxRange = 3; 3 tiles
var mDebug = false;
; ++++++++++++++++++++++++++++++++++++++++++++++++++

var X, Y, Z, FailCount = 0, LTimer, Tiles
var mX, mY, mZ, TrWeight, TrT, TrW, adX, adY

; ** Debug ***********************
if mDebug then
UO.TextOpen()
UO.TextClear()
endif
; ********************************

mX = UO.GetX('self')
mY = UO.GetY('self')
mZ = UO.GetZ('self')
for Y = MaxRange - ( MaxRange * 2 ) to MaxRange
for X = MaxRange - ( MaxRange * 2 ) to MaxRange
Tiles = F_HarvestTiles(mX+X, mY+Y)
if Tiles then
  adX = mX+X
  adY = mY+Y
  repeat
   F_DelJournalMine();
   UO.Warmode(0)
   UO.WaitTargetTile(Tiles, mX+X, mY+Y, mZ)

; ********************************
   if UO.Count(0x0F43) then
    UO.UseType(0x0F43); <-- Axe
   else
    return 1
   endif
; ********************************

; ************ Triger ************
; ErrorExitTimer
   LTimer=UO.Timer()
   TrT = UO.Timer() > LTimer + 60; !!! 60/10 = 6 sec !!!
; MyWeight + Ore
   TrWeight = UO.Weight
   TrW = UO.Weight <> TrWeight
; ********************************

   repeat
    wait(100)
   until UO.InJournal("useable wood|You can|That is too far away|here to chop") || TrT || UO.Dead()

; ********* ON=@FailCount ********
   if TrW then
    FailCount = 0
   else
    FailCount = FailCount + 1
   endif
; ********************************

; ***** Debug Harvest Tiles ******
   if mDebug then
    if TrT then
     UO.TextPrint(Tiles); !Harvest
    else
;       UO.TextPrint(Tiles);  Harvest
    endif
   endif
; ********************************

  until UO.InJournal("here to chop|You can|That is too far away") || FailCount >= MaxFailCount || UO.Dead()
endif
next
next
UO.Sound(61)
return 0
end sub

sub F_HarvestTiles(X,Y)
var i
if UO.PrivateGetTile(X, Y, -1, 3274, 3302) then
for i=3274 to 3302
if UO.PrivateGetTile(X, Y, -1, i, i) then

; ***** Patch ********************************************
  if i==3278 || i==3279 || i==3281 || i==3282 then
   return 0
  endif
  if i==3284 || i==3285 || i==3287 || i==3289 then
   return 0
  endif
  if i==3291 || i==3292 || i==3294 || i==3295 then
   return 0
  endif
  if i==3297 || i==3298 || i==3300 || i==3301 then
   return 0
  endif
; **************************************************

  return i
end if
next
end if
return 0
end sub

sub F_DelJournalMine()
F_DeleteJournal("useable wood");
F_DeleteJournal("That is too far away");
F_DeleteJournal("You can")        ;
F_DeleteJournal("here to chop");
end sub

sub F_DeleteJournal( string1 )
var nom = UO.InJournal( string1 )
if nom > 0 then
UO.SetJournalLine( Nom - 1, "string replaced" )
F_DeleteJournal( string1 )
endif
end sub
# **************************************************

sub GotoXY(x,y)
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0
for i=1 to 60

myX=UO.GetX();
myY=UO.GetY();
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if UO.GetDir()==1 then
  for z=0 to 8
   UO.Press(40)
  next
end if
if UO.GetDir()==3 then
  for z=0 to 8
   UO.Press(37)
  next
end if
if UO.GetDir()==5 then
  for z=0 to 8
   UO.Press(38)
  next
end if
if UO.GetDir()==7 then
  for z=0 to 8
   UO.Press(39)
  next
end if
halt=15
end if
if Numb(x-myX)<=1 and Numb(y-myY)<=2 then
return 1
end if
if x<=myX then
if y<=myY then
  for z=0 to 3
   UO.Press(38)
  next
else
  for z=0 to 3
   UO.Press(37)
  next
end if
else
if y<=myY then
  for z=0 to 3
   UO.Press(39)
  next
else
  for z=0 to 3
   UO.Press(40)
  next
end if
end if
lastX=myX
lastY=myY
wait(200)
next
return 0
end sub

sub Numb(num)
if num>=0 then
return num
else
return num*(-1)
end if
end sub



Нада сделать так чтобы выкидывал треш логи (сервер OLDP.net) если нужно сделаю название логов которые выкидывать цвет и тип или дайте просто я сам пропишу всё что надо
Okypok
Posts: 100
Joined: 2007-10-12 20:48:07

Post by Okypok »

Ну попробуй после этой строчки
until UO.InJournal("here to chop|You can|That is too far away") || FailCount >= MaxFailCount || UO.Dead()

вставить

Code: Select all

uo.findtype(тут тип логов,тут цвет логов,'backpack')
if uo.findcount() then
uo.drop(0,0,0,0,'finditem')
endif

Это если только один тип логов...
Image
Image
jaison
Posts: 18
Joined: 2004-08-26 13:00:26

Post by jaison »

спасибо помогло есть еше один вопросик

куда вставить это чтобы работало автоубиство риперов(я взял из мининга и переделал)

Code: Select all

if uo.InJournal("Reaper") or uo.InJournal("is attacking you")then
killelem()
wait(1000)
endif

это первая часть(незнаю куда ее в скрипте вставить)

и вот сам скрипт

Code: Select all

sub killelem()
VAR Count,Elem

uo.equipt('Rhand','0x13B1') #tip oruzija kotorim budem bitj elementa
UO.DeleteJournal()
UO.Exec('warmode 1')

UO.FindType('0x002F',-1,'ground')
Elem=UO.GetSerial('finditem')
wait (300)
UO.Attack(Elem)

repeat
wait(1000)
If UO.Life<110 Then
UO.WaitMenu('Camping','Healing Campfie')
UO.UseType(0x0DE1)
Endif
If UO.Life<70 Then
UO.UseType(0x182E)
Endif
until UO.IsNPC(Elem)==0
wait(3000)
UO.Exec('warmode 0')
wait(1000)

UO.Print("poka!")

end sub
Ururu
Posts: 479
Joined: 2007-02-21 20:15:57

Post by Ururu »

там же где и в мининге было, после сообщений

Code: Select all

  until UO.InJournal("here to chop|You can|That is too far away") || FailCount >= MaxFailCount || UO.Dead() 
endif
Шард Антарес
Ururu
jaison
Posts: 18
Joined: 2004-08-26 13:00:26

Post by jaison »

ок спс проверю, а там next next это ничего не трогать просто вставить if и endif потом?
jaison
Posts: 18
Joined: 2004-08-26 13:00:26

Post by jaison »

Так и не смог убийство риперов сделать, помогите чем нибудь хотябы какиенить свои наброски, может сам что смогу, просто когда рипер вылез одел лук и начал его мочить, остальное сам сделаю
Post Reply