Advertisement
Guest User

Untitled

a guest
May 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.33 KB | None | 0 0
  1. global Ascia
  2.  
  3. from System.Collections.Generic import List
  4. from System import Math
  5.  
  6. tileinfo = List[Statics.TileInfo] #vuol dire che copio I TIPI della lista Statics.Tileinfo
  7.  
  8. treeposx = [] #formo delle liste.
  9. treeposy = []
  10. treeposz = []
  11. treegfx = []
  12.  
  13. 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]
  14.  
  15. #(3686, 2526, 0)
  16.  
  17. bancax = 3686
  18. bancay = 2526
  19. bancaz = 0
  20.  
  21. TreeNumber = 0
  22. BagLegno = 0x44786F9D
  23. flagCount = 0
  24. myFood = 0x097B
  25. blockcount = 0
  26. i = 0
  27.  
  28. xmed = 0
  29. ymed = 0
  30.  
  31. #############GIGA487##################################
  32.  
  33. #######DIMENSIONI SCAN#########
  34. larghezzax = 25
  35. larghezzay = 25
  36. ###############################
  37.  
  38.  
  39. def PrendiBende():
  40.  
  41. if( Player.IsGhost == 0 ):
  42. Misc.SendMessage("NON HO BENDE")
  43. Misc.Pause(2000)
  44.  
  45. Bagasce = Items.FindBySerial(0x4029FD18)
  46. Items.UseItem(0x4029FD18)
  47. Misc.Pause(2000)
  48.  
  49. for item in Bagasce.Contains:
  50. if item.ItemID == 0x0E21:
  51. Items.Move(item, Player.Backpack, 10)
  52. Misc.Pause(1000)
  53. break
  54.  
  55. def RecuperoArma():
  56.  
  57. if( Player.IsGhost == 0 ):
  58. Misc.SendMessage("APRO IL BACKPACK DELLE ASCE")
  59.  
  60. Bagasce = Items.FindBySerial(0x4029FD18)
  61. Items.UseItem(0x4029FD18)
  62. Misc.Pause(2000)
  63.  
  64. for item in Bagasce.Contains:
  65. if item.ItemID == 0x0F49:
  66. Player.EquipItem(item)
  67. Misc.Pause(1000)
  68. break
  69. def Cura():
  70.  
  71. if (Items.BackpackCount(0x0E21,-1) == 0 ):
  72. Banca()
  73.  
  74. Arma = Player.GetItemOnLayer("LeftHand")
  75.  
  76. Misc.SendMessage(str(Arma))
  77.  
  78. while 1:
  79.  
  80. for item in Player.Backpack.Contains:
  81. if item.ItemID == 0x0E21:
  82. Items.UseItem(item)
  83. Misc.Pause(500)
  84.  
  85. Target.WaitForTarget(1000)
  86. Target.Self()
  87. Misc.Pause(500)
  88.  
  89. if(Items.BackpackCount(0x0F49,-1) == 0):
  90. break
  91.  
  92. Player.EquipItem(Arma)
  93.  
  94. if(Player.Hits == Player.HitsMax ):
  95. break
  96. if(Items.BackpackCount(0x0E21,-1) == 0 ):
  97. break
  98.  
  99. Misc.Pause(8000)
  100.  
  101. def checkFine(num):
  102. if (num == 10):
  103. return 1;
  104. if (num != 10):
  105. return 0;
  106.  
  107. def Banca():
  108.  
  109. Goto(bancax,bancay,bancaz)
  110.  
  111. if( Player.IsGhost == 1 ):
  112. Morto()
  113.  
  114. if( Player.IsGhost == 0 ):
  115.  
  116. Player.ChatSay(52,"Bank")
  117.  
  118. walnut = Items.BackpackCount(0x1BE0,0x0892)
  119. willow = Items.BackpackCount(0x1BE0,0x086F)
  120. log = Items.BackpackCount(0x1BE0,0x0000)
  121.  
  122. for item in Player.Backpack.Contains:
  123. if item.ItemID == 0x1BDD:
  124. Items.Move(item, BagLegno, 0)
  125. Misc.Pause(3000)
  126.  
  127.  
  128. def distanza(dx,dy):
  129. d = Math.Sqrt(dx*dx + dy*dy)
  130. Misc.SendMessage("Distanza "+str(d)+" ")
  131. return d;
  132.  
  133. def CondizioniBanca():
  134. if(not Player.CheckLayer("LeftHand")):
  135. Misc.Beep()
  136. Misc.Pause(1000)
  137. Misc.Beep()
  138. Misc.Pause(1000)
  139. Misc.Beep()
  140. Misc.Pause(1000)
  141. return True
  142. elif( Player.Weight > (Player.MaxWeight - 80)):
  143. Misc.SendMessage("Peso Eccessivo")
  144. return True
  145. else:
  146. return False
  147.  
  148.  
  149. def checkJ():
  150. if( Journal.Search("not enough") ):
  151. Misc.SendMessage("Fine Albero")
  152. return False
  153. elif( not Player.CheckLayer("LeftHand") ):
  154. return False
  155. elif( Player.Weight > (Player.MaxWeight - 80) ):
  156. Misc.SendMessage("Peso Eccessivo")
  157. return False
  158. else:
  159. return True
  160.  
  161. def LumberTree(i):
  162. Journal.Clear()
  163. Ascia = Player.GetItemOnLayer("LeftHand")
  164.  
  165. if Target.HasTarget():
  166. Misc.SendMessage("--> Blocco rilevato target residuo, cancello!", 77)
  167. Target.Cancel()
  168. Misc.Pause(500)
  169. else:
  170. Misc.NoOperation()
  171.  
  172. Misc.SendMessage("SITUAZIONE OTTIMALE")
  173. Items.UseItem(Ascia)
  174. Target.WaitForTarget(5000)
  175. Target.TargetExecute(treeposx[i],treeposy[i],treeposz[i],treegfx[i])
  176.  
  177. def mod(num):
  178. if num < 0:
  179. num = -1*num
  180. if num > 0:
  181. num = num
  182. return num;
  183.  
  184. def Goto(x,y,z):
  185.  
  186. x0 = Player.Position.X
  187. y0 = Player.Position.Y
  188. z0 = Player.Position.Z
  189.  
  190. dx = mod(x0-x)
  191. dy = mod(y0-y)
  192.  
  193. blockcount = 0
  194.  
  195. d = distanza(dx,dy)
  196.  
  197. while( 1 ): #il ciclo รจ vero fino a che sono lontano.
  198.  
  199.  
  200. if( d > 32 ): #VA MODIFICATA UNA COSA
  201. Misc.SendMessage("VADO NEL MEZZO")
  202. tileinfo = Statics.GetStaticsTileInfo(x, y, Player.Map)
  203. i = 0
  204.  
  205. xmedio = (x+x0)/2
  206. ymedio = (y+y0)/2
  207.  
  208.  
  209. Goto((x+x0)/2,(y+y0)/2,z0)
  210.  
  211. Misc.Pause(1000)
  212.  
  213.  
  214.  
  215. Player.PathFindTo(x,y,z)
  216. xa = Player.Position.X
  217. ya = Player.Position.Y
  218. za = Player.Position.Z
  219.  
  220. Misc.SendMessage("X: "+str(xa)+" Y: "+str(ya)+" Z: "+str(za))
  221.  
  222. dx = mod(xa-x)
  223. dy = mod(ya-y)
  224.  
  225. #blockcount = blockcount + 1
  226. #Misc.SendMessage("BLOCK COUNT : "+str(blockcount))
  227. d = distanza(dx,dy)
  228.  
  229. Misc.Pause(3000)
  230.  
  231. if( d < 1.6 ):
  232. break
  233.  
  234.  
  235. def Scan():
  236. global TreeNumber
  237.  
  238. x = Player.Position.X
  239. y = Player.Position.Y
  240.  
  241. global xfin
  242. global yfin
  243.  
  244. global xmed
  245. global ymed
  246.  
  247. xfin = x + larghezzax
  248. yfin = y + larghezzay
  249.  
  250. while (x <= xfin):
  251. y = Player.Position.Y ####QUADRATO DA ME VERSO SUD EST
  252.  
  253. while (y <= yfin):
  254.  
  255. tileinfo = Statics.GetStaticsTileInfo(x, y, Player.Map)
  256. if tileinfo.Count > 0:
  257. for tile in tileinfo:
  258. for spot in TreeStaticID:
  259. if (tile.StaticID == spot):
  260. if(Player.Position.Z == tile.StaticZ):
  261. treeposx.Add(x)
  262. treeposy.Add(y)
  263. treeposz.Add(tile.StaticZ)
  264. treegfx.Add(tile.StaticID)
  265. else:
  266. Misc.NoOperation()
  267.  
  268. y = y + 1
  269. x = x + 1
  270.  
  271. TreeNumber = treeposx.Count
  272.  
  273. xmed = (x + xfin)/2
  274. ymed = (y + yfin)/2
  275.  
  276.  
  277. Misc.SendMessage("SPOT "+str(len(treeposx))+" ")
  278. Misc.SendMessage("XFINE "+str(xfin)+" YFINE "+str(yfin)+" ")
  279.  
  280.  
  281. ###############################################START#######################################
  282.  
  283. #Parametri del quadrato in cui cerca gli alberi.
  284.  
  285. Goto(3686, 2526, 0)
  286.  
  287. Scan()
  288. Banca()
  289.  
  290. Ascia = Player.GetItemOnLayer("LeftHand")
  291.  
  292. while 1:
  293.  
  294. xa = Player.Position.X
  295. ya = Player.Position.Y
  296. za = Player.Position.Z
  297.  
  298. Misc.SendMessage("X: "+str(xa)+" Y: "+str(ya)+" Z: "+str(za))
  299.  
  300. Misc.Pause(1000)
  301.  
  302. global i
  303. i = 0
  304.  
  305. while(i < TreeNumber):
  306.  
  307. Journal.Clear()
  308.  
  309. #Goto(827,1459,0)
  310. Goto(treeposx[i],treeposy[i],treeposz[i])
  311. Misc.SendMessage("ALBERO: "+str(i+1))
  312.  
  313. if( Gumps.HasGump ):
  314. Misc.Beep()
  315. Misc.Pause(500)
  316. Misc.Beep()
  317. Misc.Pause(500)
  318. Misc.Beep()
  319. Misc.Pause(500)
  320. Misc.Beep()
  321. Misc.Pause(500)
  322. Misc.Beep()
  323. Misc.Pause(500)
  324.  
  325.  
  326. while(checkJ()):
  327.  
  328. LumberTree(i)
  329.  
  330. if( Player.Hits != Player.HitsMax ):
  331. Cura()
  332.  
  333. if( CondizioniBanca() ):
  334. Banca()
  335.  
  336. i = i + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement