Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global Ascia
- from System.Collections.Generic import List
- from System import Math
- tileinfo = List[Statics.TileInfo] #vuol dire che copio I TIPI della lista Statics.Tileinfo
- treeposx = [] #formo delle liste.
- treeposy = []
- treeposz = []
- treegfx = []
- TreeStaticID = [3302,3221, 3222, 3225, 3227, 3228, 3229, 3210, 3238, 3240, 3242, 3243, 3267, 3268, 3272, 3273, 3274, 3275, 3276, 3277, 3280, 3283, 3286, 3288, 3290, 3293, 3296, 3299, 3302, 3320, 3323, 3326, 3329, 3365, 3367, 3381, 3383, 3384, 3394, 3395, 3417, 3440, 3461, 3476, 3478, 3480, 3482, 3484, 3486, 3488, 3490, 3492, 3496, 3230]
- #(3686, 2526, 0)
- bancax = 3686
- bancay = 2526
- bancaz = 0
- TreeNumber = 0
- BagLegno = 0x44786F9D
- flagCount = 0
- myFood = 0x097B
- blockcount = 0
- i = 0
- xmed = 0
- ymed = 0
- #############GIGA487##################################
- #######DIMENSIONI SCAN#########
- larghezzax = 25
- larghezzay = 25
- ###############################
- def PrendiBende():
- if( Player.IsGhost == 0 ):
- Misc.SendMessage("NON HO BENDE")
- Misc.Pause(2000)
- Bagasce = Items.FindBySerial(0x4029FD18)
- Items.UseItem(0x4029FD18)
- Misc.Pause(2000)
- for item in Bagasce.Contains:
- if item.ItemID == 0x0E21:
- Items.Move(item, Player.Backpack, 10)
- Misc.Pause(1000)
- break
- def RecuperoArma():
- if( Player.IsGhost == 0 ):
- Misc.SendMessage("APRO IL BACKPACK DELLE ASCE")
- Bagasce = Items.FindBySerial(0x4029FD18)
- Items.UseItem(0x4029FD18)
- Misc.Pause(2000)
- for item in Bagasce.Contains:
- if item.ItemID == 0x0F49:
- Player.EquipItem(item)
- Misc.Pause(1000)
- break
- def Cura():
- if (Items.BackpackCount(0x0E21,-1) == 0 ):
- Banca()
- Arma = Player.GetItemOnLayer("LeftHand")
- Misc.SendMessage(str(Arma))
- while 1:
- for item in Player.Backpack.Contains:
- if item.ItemID == 0x0E21:
- Items.UseItem(item)
- Misc.Pause(500)
- Target.WaitForTarget(1000)
- Target.Self()
- Misc.Pause(500)
- if(Items.BackpackCount(0x0F49,-1) == 0):
- break
- Player.EquipItem(Arma)
- if(Player.Hits == Player.HitsMax ):
- break
- if(Items.BackpackCount(0x0E21,-1) == 0 ):
- break
- Misc.Pause(8000)
- def checkFine(num):
- if (num == 10):
- return 1;
- if (num != 10):
- return 0;
- def Banca():
- Goto(bancax,bancay,bancaz)
- if( Player.IsGhost == 1 ):
- Morto()
- if( Player.IsGhost == 0 ):
- Player.ChatSay(52,"Bank")
- walnut = Items.BackpackCount(0x1BE0,0x0892)
- willow = Items.BackpackCount(0x1BE0,0x086F)
- log = Items.BackpackCount(0x1BE0,0x0000)
- for item in Player.Backpack.Contains:
- if item.ItemID == 0x1BDD:
- Items.Move(item, BagLegno, 0)
- Misc.Pause(3000)
- def distanza(dx,dy):
- d = Math.Sqrt(dx*dx + dy*dy)
- Misc.SendMessage("Distanza "+str(d)+" ")
- return d;
- def CondizioniBanca():
- if(not Player.CheckLayer("LeftHand")):
- Misc.Beep()
- Misc.Pause(1000)
- Misc.Beep()
- Misc.Pause(1000)
- Misc.Beep()
- Misc.Pause(1000)
- return True
- elif( Player.Weight > (Player.MaxWeight - 80)):
- Misc.SendMessage("Peso Eccessivo")
- return True
- else:
- return False
- def checkJ():
- if( Journal.Search("not enough") ):
- Misc.SendMessage("Fine Albero")
- return False
- elif( not Player.CheckLayer("LeftHand") ):
- return False
- elif( Player.Weight > (Player.MaxWeight - 80) ):
- Misc.SendMessage("Peso Eccessivo")
- return False
- else:
- return True
- def LumberTree(i):
- Journal.Clear()
- Ascia = Player.GetItemOnLayer("LeftHand")
- if Target.HasTarget():
- Misc.SendMessage("--> Blocco rilevato target residuo, cancello!", 77)
- Target.Cancel()
- Misc.Pause(500)
- else:
- Misc.NoOperation()
- Misc.SendMessage("SITUAZIONE OTTIMALE")
- Items.UseItem(Ascia)
- Target.WaitForTarget(5000)
- Target.TargetExecute(treeposx[i],treeposy[i],treeposz[i],treegfx[i])
- def mod(num):
- if num < 0:
- num = -1*num
- if num > 0:
- num = num
- return num;
- def Goto(x,y,z):
- x0 = Player.Position.X
- y0 = Player.Position.Y
- z0 = Player.Position.Z
- dx = mod(x0-x)
- dy = mod(y0-y)
- blockcount = 0
- d = distanza(dx,dy)
- while( 1 ): #il ciclo รจ vero fino a che sono lontano.
- if( d > 32 ): #VA MODIFICATA UNA COSA
- Misc.SendMessage("VADO NEL MEZZO")
- tileinfo = Statics.GetStaticsTileInfo(x, y, Player.Map)
- i = 0
- xmedio = (x+x0)/2
- ymedio = (y+y0)/2
- Goto((x+x0)/2,(y+y0)/2,z0)
- Misc.Pause(1000)
- Player.PathFindTo(x,y,z)
- xa = Player.Position.X
- ya = Player.Position.Y
- za = Player.Position.Z
- Misc.SendMessage("X: "+str(xa)+" Y: "+str(ya)+" Z: "+str(za))
- dx = mod(xa-x)
- dy = mod(ya-y)
- #blockcount = blockcount + 1
- #Misc.SendMessage("BLOCK COUNT : "+str(blockcount))
- d = distanza(dx,dy)
- Misc.Pause(3000)
- if( d < 1.6 ):
- break
- def Scan():
- global TreeNumber
- x = Player.Position.X
- y = Player.Position.Y
- global xfin
- global yfin
- global xmed
- global ymed
- xfin = x + larghezzax
- yfin = y + larghezzay
- while (x <= xfin):
- y = Player.Position.Y ####QUADRATO DA ME VERSO SUD EST
- while (y <= yfin):
- tileinfo = Statics.GetStaticsTileInfo(x, y, Player.Map)
- if tileinfo.Count > 0:
- for tile in tileinfo:
- for spot in TreeStaticID:
- if (tile.StaticID == spot):
- if(Player.Position.Z == tile.StaticZ):
- treeposx.Add(x)
- treeposy.Add(y)
- treeposz.Add(tile.StaticZ)
- treegfx.Add(tile.StaticID)
- else:
- Misc.NoOperation()
- y = y + 1
- x = x + 1
- TreeNumber = treeposx.Count
- xmed = (x + xfin)/2
- ymed = (y + yfin)/2
- Misc.SendMessage("SPOT "+str(len(treeposx))+" ")
- Misc.SendMessage("XFINE "+str(xfin)+" YFINE "+str(yfin)+" ")
- ###############################################START#######################################
- #Parametri del quadrato in cui cerca gli alberi.
- Goto(3686, 2526, 0)
- Scan()
- Banca()
- Ascia = Player.GetItemOnLayer("LeftHand")
- while 1:
- xa = Player.Position.X
- ya = Player.Position.Y
- za = Player.Position.Z
- Misc.SendMessage("X: "+str(xa)+" Y: "+str(ya)+" Z: "+str(za))
- Misc.Pause(1000)
- global i
- i = 0
- while(i < TreeNumber):
- Journal.Clear()
- #Goto(827,1459,0)
- Goto(treeposx[i],treeposy[i],treeposz[i])
- Misc.SendMessage("ALBERO: "+str(i+1))
- if( Gumps.HasGump ):
- Misc.Beep()
- Misc.Pause(500)
- Misc.Beep()
- Misc.Pause(500)
- Misc.Beep()
- Misc.Pause(500)
- Misc.Beep()
- Misc.Pause(500)
- Misc.Beep()
- Misc.Pause(500)
- while(checkJ()):
- LumberTree(i)
- if( Player.Hits != Player.HitsMax ):
- Cura()
- if( CondizioniBanca() ):
- Banca()
- i = i + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement