Page 1 of 1

haroshiy skript toka nado popravit 4u4ut

Posted: 2005-05-12 11:50:32
by Admeral
izvinayus za translit vot neploho rabotayushiy skriptik na vip shahtu!!!
tolko vot ya sosvoimi krivimi ru4onkami popitalsa dobavit vnevo rekonektor tak shtobi on rekonektilsa i zapuskal snova skriptik!!!
no po4emuto skriptik on ne zapuskayet!!!

scriptika kopirait HellScream

Code: Select all

sub main() 
VAR KillElemental=1 ;Óáèâàòü ýëåé, èëè íåò 
VAR my, mx,i,j,p=1,time=UO.Time(),maxweight=500,n=2
DIM x[1],y[1]

UO.Exec('exec Reconnector')

x[0]=5519 ;Êîîðäèíàòû òàéëà 
y[0]=1594  ;ðÿäîì ñ ÿùèêîì

;Ïàðàìè õ,ó óêàæèòå êîîðäèíàòû òàéëîâ, ñòîÿ â êîòîðûõ ÷àð áóäåò êîïàòü âîêðóã ñåáÿ
x[1]=5530  
y[1]=1591

uo.deletejournal()
while (not uo.dead())   
  WalkN(x[p],y[p],'') 
  if p==1 then ;Âìåñòî öèôðû 2 óêàæèòå ïîðÿäêîâûé íîìåð ïîñëåäíåãî òàéëà, ñòîÿ â êîòîðîì âû êîïàåòå
    p=1
  else
    p=p+1
  endif
  mx = UO.GetX("self") 
  my = UO.GetY("self") 
  tohide() 
  for i = mx-3 to mx+3 
   for j = my-3 to my+3     
   dig(i,j,KillElemental) 
if UO.Weight>=maxweight then 
	WalkN(x[0],y[0],'') 
	razgruzka()
	WalkN(x[p],y[p],'')
	endif
###### Spirit Speak ######
UO.FindType('0x0010',-1,'ground')
if uo.Time()-time>500 and UO.FindCount()>0 and UO.SkillVal('Spirit',1)<1000 then
uo.deletejournal()
uo.useskill('Spirit')
while not uo.injournal('netherworld')
	wait(200)
	wend
time=uo.Time()
tohide() 
endif
##########################
   UO.Print("Now Mining In: "+str(mx-i)+" "+str(my-j)) 	
  next 
   next 
UO.FindType('0x0010',-1,'ground')
if UO.FindCount()>0 then
	i = UO.GetX("self") 
	j = UO.GetY("self") 
	if KillElemental==1 Then
		KillElem()
		WalkN(i,j,'') 
	else
		repeat
		wait(1000)
		until UO.IsNPC('finditem')==0
	endif
endif
  WalkN(x[0],y[0],'') 
  razgruzka()
  wend 
end sub 

sub dig(i,j,KillElemental) 
var MMM,count,x,y

while (not uo.injournal("no ore")) and (not uo.injournal("in rock")) and (not uo.injournal ("That is too far")) 
  tohide() 
  UO.Waittargettile("1339", str(i), str(j),"0") 
  UO.Usetype (0x0E85)  ;lopata
  uo.deletejournal() 
  count=0
  while (not uo.injournal("fail")) and (not uo.injournal("put")) and (not uo.injournal("elemental")) and (not uo.injournal("no ore")) and (not uo.injournal("in rock")) and (not uo.injournal ("That is too far")) and count<300
    wait(100) 
	count=count+1
    wend 
	if count<10 and uo.injournal("fail") then
		wait(9000)
		endif
  UO.FindType('0x0010',-1,'ground')
  if UO.InJournal('something with ore') OR UO.InJournal("attacking you") OR uo.findcount()>0 then
    x = UO.GetX("self") 
    y = UO.GetY("self") 
    if KillElemental==1 Then
      KillElem()
      WalkN(x,y,'')          
    endif
  endif  
wend 
uo.deletejournal() 
end sub 

sub razgruzka()
VAR Container='0x4015C687'; Òóò óêàæèòå ID ñâîåãî ÿùèêà
VAR Container2='0x40268D39';ID ñóìêè âíóòðè ÿùèêà
UO.UseObject(Container)
wait(1000)
UO.UseObject('0x4024D8C8')
wait(1000)
while uo.count('0x19B7')<>0
	UO.FindType('0x19B7')
	UO.MoveItem('finditem','0',Container2)    
	wait(900)
	wend
  while uo.count('0x19B8')<>0
	UO.FindType('0x19B8')
	UO.MoveItem('finditem','0',Container2)    
	wait(900)
	wend
  while uo.count('0x19B9')<>0
	UO.FindType('0x19B9')
	UO.MoveItem('finditem','0',Container2)    
	wait(900)
	wend
  while uo.count('0x19BA')<>0
	UO.FindType('0x19BA')
	UO.MoveItem('finditem','0',Container2)    
	wait(900)
	wend  
end sub

sub tohide() 
while NOT UO.Hidden() 
UO.DeleteJournal() 
if UO.Life<50 then 
  UO.UseType('0x0F0E','0x0631') ; inviz potion 
  wait(2000) 
    else 
  UO.UseSkill('Hiding') 
  repeat 
    wait(50) 
    until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') 
  endif 
UO.WarMode('flip') 
wait(100) 
UO.Warmode(0) 
wend 
end sub


#=====================================thx to SavageV=========== 
# CheckLag() - click on backpack and awaiting "backpack" 
#    message in journal. 
# 
# Journal has been deleted!!! 
#-------------------------------------------------------------- 
sub CheckLag() 
 UO.DeleteJournal() 
 UO.Click('backpack') 

 Repeat 
  wait(500) 
 Until UO.InJournal('backpack') 
end sub 


#======================================thx to SavageV========== 
# WalkN(X,Y,Serial) - char is walking by dX and dY step 
#    sub using Home, End, PgUp, PgDown keys 
#    d'not rebind this key from default action! 
#  serial - Serial of target or "" - string 
#  walkwait - delay after keypress 
#  Example: 
#  WalkN(2080,2113,'') - go to coordinates 
#  WalkN(0,0,'0x12345678') - go to target position 
#-------------------------------------------------------------- 
sub WalkN(x,y,Target) 
 VAR i,StepSucess 
 VAR dx,dy,Exit=0 
 
 While Exit<>1 
  If Target<>"" Then 
   dx=UO.GetX(Target)-UO.GetX() 
   dy=UO.GetY(Target)-UO.GetY() 
   If UO.GetDistance(Target)<2 Then 
   Exit=1 
   Endif 
  Else 
   dx=x-UO.GetX() 
   dy=y-UO.GetY() 
   If dx==0 AND dy==0 Then 
   Exit=1 
   Endif 

  Endif 
 
  If dx<>0 AND dy<>0 Then 
   If dx>0 AND dy>0 Then 
   StepSucess=Go(3,40,300) ;SE - DownArrow 
   Endif 

   If dx>0 AND dy<0 Then 
   StepSucess=Go(1,39,300) ;NE - RightArrow 
   Endif 

   If dx<0 AND dy>0 Then 
   StepSucess=Go(5,37,300) ;SW - LeftArrow 
   Endif 

   If dx<0 AND dy<0 Then 
   StepSucess=Go(7,38,300) ;WN - UpArrow 
   Endif 

  Endif 
 
  If dx<>0 AND dy==0 Then 
   If dx>0 Then 
   StepSucess=Go(2,34,300) ;E - PgDown 
   If StepSucess==-1 Then 
    StepSucess=Go(3,40,300) ;SE - DownArrow 
    If StepSucess==-1 Then 
     StepSucess=Go(1,39,300) ;NE - RightArrow 
    Endif 
   Endif 
   Endif 
   
   If dx<0 Then 
   StepSucess=Go(6,36,300) ;W - Home 
   If StepSucess==-1 Then 
    StepSucess=Go(7,38,300) ;WN - UpArrow 
    If StepSucess==-1 Then 
     StepSucess=Go(5,37,300) ;SW - LeftArrow 
    Endif 
   Endif 
   Endif 
  Endif 


  If dx==0 AND dy<>0 Then 
   If dy>0 Then 
   StepSucess=Go(4,35,300) ;S - End 
   If StepSucess==-1 Then 
    StepSucess=Go(3,40,300) ;SE - DownArrow 
    If StepSucess==-1 Then 
     StepSucess=Go(5,37,300) ;SW - LeftArrow 
    Endif 
   Endif 
   Endif 
   
   If dy<0 Then 
   StepSucess=Go(0,33,300) ;N - PgUp 
   If StepSucess==-1 Then 
    StepSucess=Go(7,38,300) ;WN - UpArrow 
    If StepSucess==-1 Then 
     StepSucess=Go(1,39,300) ;NE - RightArrow 
    Endif 
   Endif 
   Endif 
  Endif 
 Wend 
end sub 


sub Go(dir,key,walkwait) 
 VAR x,y 

 x=UO.GetX() 
 y=UO.GetY() 

 while UO.GetDir()<>dir 
  UO.Press(key) 
  wait(walkwait) 
  If UO.GetDir()<>dir Then 
   CheckLag() 
  Endif 
 wend 

 UO.Press(key) 
 wait(walkwait) 

 If x==UO.GetX() AND y==UO.GetY() Then 
  CheckLag() 
 Endif 
 
 If x==UO.GetX() AND y==UO.GetY() Then 
  return -1 
 Else 
  return 1 
 Endif 
end sub 

sub killelem()
  VAR LastTimer, Elem
  UO.UseType('0x0F0E','0x0631') ; inviz potion
  While UO.STR<201 ; U'r not morfed char max Strength + 1
    If UO.Mana>=50 then
      UO.WaitMenu('What','Daemon')
      UO.Cast('Polymorph')
      wait(8000)
    else
      UO.UseType('0x0F0E','0x09DF') ; total mana potion
      wait(3000)
    endif
  Wend  
  LastTimer=UO.Timer()  
  repeat
    UO.BandageSelf()
    wait(4000)
  until UO.Life==UO.STR
  UO.UseType(0x1B76) ; heater shield
  UO.UseType(0x1413) ; platemail gorget  
  UO.DeleteJournal()
  UO.Exec('warmode 1')
  UO.FindType('0x0010',-1,'ground')
  Elem=UO.GetSerial('finditem')
  UO.Attack(Elem)  
  repeat
    wait(1000)
    If UO.Life<50 Then
      UO.UseType('0x0F0E','0x09BB') ;GH
    Endif
    If UO.GetDistance(Elem)>1 Then
      WalkN(0,0,Elem)
    Endif
  until UO.IsNPC(Elem)==0
  wait(3000)
  UO.findtype('0x19B9',-1,'ground') ; 3 ore
  UO.moveitem('finditem')
  wait(1000)
  UO.findtype('0x19B8',-1,'ground') ; 3 ore
  UO.moveitem('finditem')
  wait(1000)
  UO.findtype('0x19BA',-1,'ground') ; 3 ore
  UO.moveitem('finditem')
  wait(1000)
  UO.findtype('0x19B7',-1,'ground') ; 3 ore
  UO.moveitem('finditem')
  wait(1000)
  UO.findtype('0x0EED',-1,'ground') ; 3 ore
  UO.moveitem('finditem')
  wait(1000)
  UO.FindType('0x0010',-1,'ground')
  If UO.GetQuantity('finditem')>0 Then
    KillElem()
  Endif
  UO.Exec('warmode 0')
  wait(1000)
  UO.Print("Sdoh skotina!")
  LastTimer=UO.Timer()
  if UO.Life<180 then ; U'r max HP
    repeat
      UO.BandageSelf()
      wait(4000)
    until UO.Life>180 OR LastTimer+300<UO.Timer()
  endif
  UO.DeleteJournal()
end sub

sub Reconnector() 
var ReconnectTime, RFlag 
ReconnectTime = '0' 
RFlag = 1 
Repeat 
While (UO.ObjAtLayer('Bpack') == '') 
if RFlag Then 
ReconnectTime = MakeTime() 
RFlag = 0 
endif 
Wait(20000) # WorldSave Protection 
UO.Say('') 
Wait(3000) 
UO.Say('') 
Wait(3000) 
UO.Say('') 
Wait(3000) 
UO.LDblClick(357,164) 
UO.LClick(616,459) 
Wait(3000) 
WEnd 
Wait(3000) 
if (RFlag == 0) and (ReconnectTime <> '0') Then 
UO.Exec('terminate all')
wait(1000) 
UO.Exec('exec main') 
UO.TextOpen() 
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime) 
RFlag = 1 
ReconnectTime = '0' 
endif 
Until false 
end sub 

sub MakeTime() 
VAR D, T, Ret, i 
Ret = STR(UO.Time()) 
T = "" 
For i = 0 To Len(Ret) 
T = Ret[Len(Ret)-i] + T 
If (I == 2) OR (I == 4) Then 
T = ":" + T 
EndIf 
Next 
Ret = STR(UO.Date()) 
D = "" 
For i = 0 To Len(Ret) 
D = Ret[Len(Ret)-i] + D 
If (I == 2) OR (I == 4) Then 
D = "." + D 
EndIf 
Next 
Ret = T + " @ " + D 
RETURN Ret 
end sub 

Posted: 2005-05-12 17:04:09
by Haxor
отдельно запускай рекноект и усё.

Posted: 2005-05-13 04:29:29
by Admeral
delo v tom shto rekonektor otdelno ot skriptika ne perezapuskayet skript
hota vnom i yest takaya funktsiya tipo
ubit vse skripti i zapustit kakiyeto

Posted: 2005-05-13 06:35:07
by Beyonder
В этой строке:

Code: Select all

UO.Exec('exec main')
Замени main на название нужной для запуска функции.

Posted: 2005-05-13 07:01:17
by Admeral
nu vot vstav i posmotri shto iz etovo polu4ayetsa!!!
rekonect proishodit i on zapuskayet vtoroy raz skript
i 2 vmeste rabotayut a kogda uberayesh komentariy pod predidushiy strokoy on vsoravno skript perviy ne virubayet

Posted: 2005-05-13 11:44:48
by Beyonder
Значит или ты глючишь, или инжект. Но точно не скрипт.
Эта строка должна вырубать все скрипты:
UO.Exec('terminate all')
Если она не вырубает, то это не скрипта проблема.