buy Regs

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Kazoo
Posts: 173
Joined: 2004-04-03 18:39:28
Contact:

buy Regs

Post by Kazoo »

я сложил вот такой скриптик ! не ругаите силно я тока начинаюший !

Code: Select all

sub main() 

VAR Count, LastTimer, Elem ,MaxWeight=500
var i 
dim t[2] 
t[1]="0x0190" 
t[2]="0x0191" 
uo.set("finddistance","4") 
uo.ignorereset() 
uo.ignore("self") 
while 1 
  repeat 
   for i=1 to 2 
    uo.findtype(t[i],"-1","ground") 
    if uo.findCount()>0 then 
     uo.Click("finditem") 
     Wait(1000) 
     uo.buy("regs" , uo.getName("finditem")) 
     wait(10)
            if UO.Weight>=MaxWeight then 
               unloadore() 
            endif 
        UO.DeleteJournal() 
   UO.Exec('warmode 1') 

   UO.FindType('0x0190',-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 
    loot()
   wait(3000) 
     uo.ignore("finditem") 
    endif 
   next 
   wait(1000) 
  until uo.findcount()==0 
           UO.Exec('warmode 0') 
                                ToHide() 

wend 
end sub 

sub WalkN(x,y,Target) 
   VAR i 
   VAR dx,dy,Exit=0 
    
   While Exit<>1    
      If Target<>"" Then 
         dx=UO.GetX(Target)-UO.GetX() 
         dy=UO.GetY(Target)-UO.GetY() 
;         UO.Print("Target locked!") 
         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 
            GoSE() 
         Endif 

         If dx>0 AND dy<0 Then 
            GoNE() 
         Endif 

         If dx<0 AND dy>0 Then 
            GoSW() 
         Endif 

         If dx<0 AND dy<0 Then 
            GoWN() 
         Endif 

      Endif 
    
      If dx<>0 AND dy==0 Then 
         If dx>0 Then 
            GoE() 
         Endif 
          
         If dx<0 Then 
            GoW() 
         Endif 
      Endif 


      If dx==0 AND dy<>0 Then 
         If dy>0 Then 
            GoS() 
         Endif 
          
         If dy<0 Then 
            GoN() 
         Endif 
      Endif 
   Wend 
end sub 

sub GoW() 
   VAR walkwait=300 
   VAR x,y,dir=6 
   VAR key=36 ; Home key 
   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 UO.GetX()+1==x Then 
      return -1 
   Else 
      return 1 
   Endif 
end sub 


sub GoN() 
   VAR walkwait=300 
   VAR x,y,dir=0 
   VAR key=33 ; PgUp 
   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 UO.GetY()+1==y Then 
      return -1 
   Else 
      return 1 
   Endif 
end sub 


sub GoE() 
   VAR walkwait=300 
   VAR x,y,dir=2 
   VAR key=34 ; PgDown 
   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 UO.GetX()-1==x Then 
      return -1 
   Else 
      return 1 
   Endif 
end sub 


sub GoS() 
   VAR walkwait=300 
   VAR x,y,dir=4 
   VAR key=35 ; End 
   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 UO.GetY()-1==y Then 
      return -1 
   Else 
      return 1 
   Endif 
end sub 


sub GoWN() 
   VAR walkwait=300 
   VAR x,y,dir=7 
   VAR key=38 ; UpArrow 
   x=UO.GetX() 
   y=UO.GetY() 

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

   If UO.GetDir()==dir Then 
      UO.Press(key) 
      wait(walkwait) 
      If x==UO.GetX() AND y==UO.GetY() Then 
         CheckLag() 
      Endif 
      If UO.GetDir()==dir Then 
         return -1 
      Else 
         return UO.GetDir() 
      Endif 
   Else 
      return UO.GetDir() 
   Endif 
end sub 


sub GoNE() 
   VAR walkwait=300 
   VAR x,y,dir=1 
   VAR key=39 ; RightArrow 
   x=UO.GetX() 
   y=UO.GetY() 

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

   If UO.GetDir()==dir Then 
      UO.Press(key) 
      wait(walkwait) 
      If x==UO.GetX() AND y==UO.GetY() Then 
         CheckLag() 
      Endif 
      If UO.GetDir()==dir Then 
         return -1 
      Else 
         return UO.GetDir() 
      Endif 
   Else 
      return UO.GetDir() 
   Endif 
end sub 


sub GoSE() 
   VAR walkwait=300 
   VAR x,y,dir=3 
   VAR key=40 ; DownArrow 
   x=UO.GetX() 
   y=UO.GetY() 

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

   If UO.GetDir()==dir Then 
      UO.Press(key) 
      wait(walkwait) 
      If x==UO.GetX() AND y==UO.GetY() Then 
         CheckLag() 
      Endif 
      If UO.GetDir()==dir Then 
         return -1 
      Else 
         return UO.GetDir() 
      Endif 
   Else 
      return UO.GetDir() 
   Endif 
end sub 


sub GoSW() 
   VAR walkwait=300 
   VAR x,y,dir=5 
   VAR key=37 ; LeftArrow 
   x=UO.GetX() 
   y=UO.GetY() 

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

   If UO.GetDir()==dir Then 
      UO.Press(key) 
      wait(walkwait) 
      If x==UO.GetX() AND y==UO.GetY() Then 
         CheckLag() 
      Endif 
      If UO.GetDir()==dir Then 
         return -1 
      Else 
         return UO.GetDir() 
      Endif 
   Else 
      return UO.GetDir() 
   Endif 
end sub 

sub CheckLag() 
   UO.DeleteJournal() 
   UO.Click('backpack') 
   repeat 
      wait(500) 
   until UO.InJournal('backpack') 
end sub 

;------------------------- Unload ore ------------------------- 
sub unloadore() 
   UO.Recall('0x4001BDF1','3')
	Wait(10000)
   VAR TempX,TempY,i,Exit 
   VAR UnloadX=2935, UnloadY=291 
   VAR UnloadCont='0x40131AA0' 
   DIM Ore[5] 

   TempX=UO.GetX() 
   TempY=UO.GetY() 
    

   While UO.GetEasyUO(99)=='1' 
      wait(3000) 
   Wend 
    
   walkn(UnloadX,UnloadY,"") 
   ToHide() 

   Ore[0]=0x0F87 ; 4 and more ore 
   Ore[1]=0x0E34 ; 1 ore 
   Ore[2]=0x19BA ; 2 ore 
   Ore[3]=0x19B8 ; 3 ore 

   UO.SetReceivingContainer(UnloadCont) ; storecontainer 
   wait(500) 


   For i=0 to 3 
      Exit=0 
      repeat 
         UO.FindType(Ore[i]) 
          
         if UO.GetQuantity('finditem')>0 then 
            UO.Grab('0','finditem') 
            CheckLag() 
            wait(1500) 
         Else 
            Exit=1 
         endif 
      until Exit==1 
   Next 

   UO.UnSetReceivingContainer() 
    UO.Recall('0x40098197','6')
	Wait(10000) 
   ToHide() 
end sub 

#  tohide() - try hidding char. When char lose HP, drink inviz 
#             potion if it found in backpack 
# 
#  Journal has been deleted!!! 
#-------------------------------------------------------------- 
sub tohide() 
   while NOT UO.Hidden() 
      UO.DeleteJournal() 
      UO.FindType('0x0F0E','0x0631','my') 

      if UO.Life<UO.STR/2 AND UO.GetQuantity('finditem')>0 then 
         UO.UseType('0x0F0E','0x0631') ; inviz potion 
         UO.Exec('warmode 0') 
         wait(2000) 
      else 
         UO.Exec('warmode 0') 
         UO.UseSkill('Stealth') 
         repeat 
            wait(50) 
         until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied') 
      endif 
   wend 
end sub 


#==============================================================
#  Loot() - looting corpse and from ground
#--------------------------------------------------------------
sub Loot()
	VAR WaitTime=500
	VAR Exit=0, i
	DIM Loot[30]
	

	Loot[0]=0x19B9 ; ore
	Loot[1]=0x0EED ; gp
	Loot[2]=0x0F7B ; BM
	Loot[3]=0x0F7A ; BP
	Loot[4]=0x0F84 ; GA
	Loot[5]=0x0F85 ; GI
	Loot[6]=0x0F86 ; MR
	Loot[7]=0x0F88 ; NS
	Loot[8]=0x0F8C ; SA
	Loot[9]=0x0F8D ; SS
	Loot[10]=0x0F90 ; Dead Woods
	Loot[11]=0x0F7E ; Sceleton Bones
	Loot[12]=0x0F87 ; Eyes of newt
	Loot[13]=0x0E76 ; Bag
	Loot[14]=0x09B0 ; Pounch
	Loot[15]=0x1BDD ; Logs
	Loot[16]=0x1078 ; Hides
	Loot[17]=0x1BFB ; Bolts
	Loot[18]=0x0E34 ; Blanc Scroll
	Loot[19]=0x0F25 ; Pieces of Amber
	Loot[20]=0x0F16 ; Ametist
	Loot[21]=0x0F20 ; Tourmaline
	Loot[22]=0x0F26 ; Diamond
	Loot[23]=0x0F30 ; Diamond
	Loot[24]=0x0F8E ; Serpent Scales
	Loot[25]=0x14EB ; Treassure Map
	Loot[26]=0x0F79 ; Blackmoor
	Loot[27]=0x0F3F ; Arrow
	Loot[28]=0x0F79 ; Blackmoor
	Loot[29]=0x0F79 ; Blackmoor
	
	UO.UseObject('lastcorpse')

	if UO.GetQuantity('lastcorpse') then
		UO.SetArm('temp')
		UO.WaitTargetObject('lastcorpse')
		UO.UseType('0x0F51') ;dagger
		wait(1000)
		UO.Arm('temp')
		wait(1500)
	endif
	
;	UO.SetReceivingContainer('0x400935D4') ; loot store bag

	For i=0 to 27
		UO.FindType(Loot[i],-1,'ground')
		if UO.GetQuantity('finditem') then 
			UO.Grab(STR(0),'finditem')
			wait(WaitTime)
		endif

		if UO.GetQuantity('lastcorpse') then
			UO.FindType(Loot[i],-1,'lastcorpse')
			if UO.GetQuantity('finditem') then 
				if Loot[i]==0x1078 then
					UO.WaitTargetObject('finditem')
					UO.UseType('0x0F9E')
				else
					UO.Grab(STR(0),'finditem')
				endif				
				wait(WaitTime)
			endif
		endif
	next

;	UO.UnSetReceivingContainer()
end sub

Kazoo
Posts: 173
Joined: 2004-04-03 18:39:28
Contact:

Post by Kazoo »

помагите улучшит , штобы летал по 10 рунам и покупал и убивал
Ex-Brodyaga
Junior Expert
Posts: 150
Joined: 2004-04-12 20:26:41

Post by Ex-Brodyaga »

Братух. Дай нсачала хоть описание скрипта, что нужно делать. Вот ато ничего не понятно.
AGRS
Expert!
Posts: 1007
Joined: 2004-04-04 21:40:09
Contact:

Post by AGRS »

А потом чтобы еще слетал на рынок и пошарил по вендорам где выха подешевше. :lol:
Кое-что нужно делать руками.... к сожалению.
Post Reply