Advertisement
Guest User

Untitled

a guest
May 29th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.19 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. Suono()
  136. return True
  137. elif( Player.Weight > (Player.MaxWeight - 80)):
  138. Misc.SendMessage("Peso Eccessivo")
  139. return True
  140. else:
  141. return False
  142.  
  143.  
  144. def checkJ():
  145. if( Journal.Search("not enough") ):
  146. Misc.SendMessage("Fine Albero")
  147. return False
  148. elif( not Player.CheckLayer("LeftHand") ):
  149. return False
  150. elif( Player.Weight > (Player.MaxWeight - 80) ):
  151. Misc.SendMessage("Peso Eccessivo")
  152. return False
  153. else:
  154. return True
  155.  
  156. def LumberTree(i):
  157. Journal.Clear()
  158. Ascia = Player.GetItemOnLayer("LeftHand")
  159.  
  160. if Target.HasTarget():
  161. Misc.SendMessage("--> Blocco rilevato target residuo, cancello!", 77)
  162. Target.Cancel()
  163. Misc.Pause(500)
  164. else:
  165. Misc.NoOperation()
  166.  
  167. Misc.SendMessage("SITUAZIONE OTTIMALE")
  168. Items.UseItem(Ascia)
  169. Target.WaitForTarget(5000)
  170. Target.TargetExecute(treeposx[i],treeposy[i],treeposz[i],treegfx[i])
  171.  
  172. def mod(num):
  173. if num < 0:
  174. num = -1*num
  175. if num > 0:
  176. num = num
  177. return num;
  178.  
  179. def Goto(x,y,z):
  180.  
  181. x0 = Player.Position.X
  182. y0 = Player.Position.Y
  183. z0 = Player.Position.Z
  184.  
  185. dx = mod(x0-x)
  186. dy = mod(y0-y)
  187.  
  188. blockcount = 0
  189.  
  190. d = distanza(dx,dy)
  191.  
  192. while( 1 ): #il ciclo รจ vero fino a che sono lontano.
  193.  
  194.  
  195. if( d > 32 ): #VA MODIFICATA UNA COSA
  196. Misc.SendMessage("VADO NEL MEZZO")
  197. tileinfo = Statics.GetStaticsTileInfo(x, y, Player.Map)
  198. i = 0
  199.  
  200. xmedio = (x+x0)/2
  201. ymedio = (y+y0)/2
  202.  
  203.  
  204. Goto((x+x0)/2,(y+y0)/2,z0)
  205.  
  206. Misc.Pause(1000)
  207.  
  208.  
  209.  
  210. Player.PathFindTo(x,y,z)
  211. xa = Player.Position.X
  212. ya = Player.Position.Y
  213. za = Player.Position.Z
  214.  
  215. Misc.SendMessage("X: "+str(xa)+" Y: "+str(ya)+" Z: "+str(za))
  216.  
  217. dx = mod(xa-x)
  218. dy = mod(ya-y)
  219.  
  220. #blockcount = blockcount + 1
  221. #Misc.SendMessage("BLOCK COUNT : "+str(blockcount))
  222. d = distanza(dx,dy)
  223.  
  224. Misc.Pause(3000)
  225.  
  226. if( d < 1.6 ):
  227. break
  228.  
  229. def Suono():
  230. Misc.Beep()
  231. Misc.Pause(500)
  232. Misc.Beep()
  233. Misc.Pause(500)
  234. Misc.Beep()
  235. Misc.Pause(500)
  236. Misc.Beep()
  237. Misc.Pause(500)
  238. Misc.Beep()
  239. Misc.Pause(500)
  240.  
  241.  
  242.  
  243. def Scan():
  244. global TreeNumber
  245.  
  246. x = Player.Position.X
  247. y = Player.Position.Y
  248.  
  249. global xfin
  250. global yfin
  251.  
  252. global xmed
  253. global ymed
  254.  
  255. xfin = x + larghezzax
  256. yfin = y + larghezzay
  257.  
  258. while (x <= xfin):
  259. y = Player.Position.Y ####QUADRATO DA ME VERSO SUD EST
  260.  
  261. while (y <= yfin):
  262.  
  263. tileinfo = Statics.GetStaticsTileInfo(x, y, Player.Map)
  264. if tileinfo.Count > 0:
  265. for tile in tileinfo:
  266. for spot in TreeStaticID:
  267. if (tile.StaticID == spot):
  268. if(Player.Position.Z == tile.StaticZ):
  269. treeposx.Add(x)
  270. treeposy.Add(y)
  271. treeposz.Add(tile.StaticZ)
  272. treegfx.Add(tile.StaticID)
  273. else:
  274. Misc.NoOperation()
  275.  
  276. y = y + 1
  277. x = x + 1
  278.  
  279. TreeNumber = treeposx.Count
  280.  
  281. xmed = (x + xfin)/2
  282. ymed = (y + yfin)/2
  283.  
  284.  
  285. Misc.SendMessage("SPOT "+str(len(treeposx))+" ")
  286. Misc.SendMessage("XFINE "+str(xfin)+" YFINE "+str(yfin)+" ")
  287.  
  288.  
  289. ###############################################START#######################################
  290.  
  291. #Parametri del quadrato in cui cerca gli alberi.
  292.  
  293. Goto(3686, 2526, 0)
  294.  
  295. Scan()
  296. Banca()
  297.  
  298. Ascia = Player.GetItemOnLayer("LeftHand")
  299.  
  300. while 1:
  301.  
  302. xa = Player.Position.X
  303. ya = Player.Position.Y
  304. za = Player.Position.Z
  305.  
  306. Misc.SendMessage("X: "+str(xa)+" Y: "+str(ya)+" Z: "+str(za))
  307.  
  308. Misc.Pause(1000)
  309.  
  310. global i
  311. i = 0
  312.  
  313. while(i < TreeNumber):
  314.  
  315. Journal.Clear()
  316.  
  317. #Goto(827,1459,0)
  318. Goto(treeposx[i],treeposy[i],treeposz[i])
  319. Misc.SendMessage("ALBERO: "+str(i+1))
  320.  
  321. while(checkJ()):
  322.  
  323. LumberTree(i)
  324.  
  325. if( Gumps.HasGump() ):
  326. Suono()
  327.  
  328. if( Player.Hits != Player.HitsMax ):
  329. Cura()
  330.  
  331. if( CondizioniBanca() ):
  332. Banca()
  333.  
  334. i = i + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement