fork download
  1. header = """<Profile>
  2. <Name>Favor - __CITEM__ - __ZONE__</Name>
  3. <Order>
  4. <If Condition="not IsOnMap(__MAPID__)">
  5. <TeleportTo AetheryteId="__AETHERYTE__" />
  6. </If>
  7. <FlyTo XYZ="__SPOT1__" Altitude="__ALTITUDEARRIVAL__" MountId="45" Radius="1.0" />
  8. <While Condition="True">
  9. <If Condition="not IsOnMap(__MAPID__)">
  10. <TeleportTo AetheryteId="__AETHERYTE__" />
  11. </If>"""
  12. ender = """ </While>
  13. </Order>
  14. </Profile>"""
  15. gather =""" <Gather loops="2">
  16. <GatherObject>__SPOTNAME__</GatherObject>
  17. <HotSpots>
  18. <HotSpot Radius="150" XYZ="__SPOT__" name="__SPOTNAME__" />
  19. </HotSpots>
  20. __ITEMS__
  21. </Gather>"""
  22. flyto = """ <FlyTo XYZ="__SPOT__" Altitude="__ALTITUDE__" MountId="45" Radius="1.0" />"""
  23. itemtotal = """<ItemNames>
  24. __ITEMLST__ </ItemNames>"""
  25. singleitem = """ <ItemName>__NITEM__</ItemName>
  26. """
  27.  
  28. def generateProfile(spots, altitude, altForArrival, normalItems, concealedItems, spotNameNormal, spotNameConcealed, zoneID, AetheryteId):
  29. h = header
  30. h=h.replace("__CITEM__", concealedItems[0])
  31. h=h.replace("__MAPID__", zoneID)
  32. h=h.replace("__ALTITUDEARRIVAL__", altForArrival)
  33. h=h.replace("__SPOT1__", spots[0])
  34. h=h.replace("__AETHERYTE__", AetheryteId)
  35. spotstr = ""
  36. for spot in spots:
  37. spotstr+=getGatherSpot(spot, altitude, normalItems, concealedItems, spotNameNormal, spotNameConcealed)
  38. spotstr+="\n"
  39.  
  40. return h+spotstr+ender
  41.  
  42. def getGatherSpot(spot, altitude, normalItems, concealedItems, spotNameNormal, spotNameConcealed):
  43. ft = flyto
  44. ft = ft.replace("__SPOT__", spot)
  45. ft = ft.replace("__ALTITUDE__", altitude)
  46. ngather = getSingleGather(spot, normalItems, spotNameNormal)
  47. cgather = getSingleGather(spot, concealedItems, spotNameConcealed)
  48. return ft+"\n\n"+ngather+"\n\n"+cgather
  49.  
  50. def getSingleGather(spot, items, spotName):
  51. s = gather
  52. s = s.replace("__SPOT__", spot)
  53. s = s.replace("__SPOTNAME__", spotName)
  54. itemstr = itemtotal
  55. itemlist = ""
  56. for item in items:
  57. sitem = singleitem
  58. sitem = sitem.replace("__NITEM__", item)
  59. itemlist=itemlist+sitem
  60. itemstr = itemstr.replace("__ITEMLST__", itemlist)
  61. s = s.replace("__ITEMS__", itemstr)
  62. return s
  63.  
  64.  
  65. print generateProfile(spots=["518.2427, -111.9493, 429.0835", "723.8118, -97.36623, 453.2475", "667.0069, -124.9072, 325.6782"],
  66. altitude="-92",
  67. altForArrival="-85",
  68. normalItems=["Aurum Regis Sand"],
  69. concealedItems=["Violet Roundstone", "Violet Ooid"],
  70. spotNameNormal="Mineral Deposit",
  71. spotNameConcealed="Concealed Mineral Deposit",
  72. zoneID="401",
  73. AetheryteId="72")
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
<Profile>
	<Name>Favor - Violet Roundstone - __ZONE__</Name>
	<Order>
		<If Condition="not IsOnMap(401)">
			<TeleportTo AetheryteId="72" />
		</If>
			<FlyTo XYZ="518.2427, -111.9493, 429.0835" Altitude="-85" MountId="45" Radius="1.0" />
			<While Condition="True">
			<If Condition="not IsOnMap(401)">
				<TeleportTo AetheryteId="72" />
			</If>			<FlyTo XYZ="518.2427, -111.9493, 429.0835" Altitude="-92" MountId="45" Radius="1.0" />

			<Gather loops="2">
				<GatherObject>Mineral Deposit</GatherObject>
				<HotSpots>
					<HotSpot Radius="150" XYZ="518.2427, -111.9493, 429.0835" name="Mineral Deposit" />
				</HotSpots>
				<ItemNames>
					<ItemName>Aurum Regis Sand</ItemName>
				</ItemNames>
			</Gather>

			<Gather loops="2">
				<GatherObject>Concealed Mineral Deposit</GatherObject>
				<HotSpots>
					<HotSpot Radius="150" XYZ="518.2427, -111.9493, 429.0835" name="Concealed Mineral Deposit" />
				</HotSpots>
				<ItemNames>
					<ItemName>Violet Roundstone</ItemName>
					<ItemName>Violet Ooid</ItemName>
				</ItemNames>
			</Gather>
			<FlyTo XYZ="723.8118, -97.36623, 453.2475" Altitude="-92" MountId="45" Radius="1.0" />

			<Gather loops="2">
				<GatherObject>Mineral Deposit</GatherObject>
				<HotSpots>
					<HotSpot Radius="150" XYZ="723.8118, -97.36623, 453.2475" name="Mineral Deposit" />
				</HotSpots>
				<ItemNames>
					<ItemName>Aurum Regis Sand</ItemName>
				</ItemNames>
			</Gather>

			<Gather loops="2">
				<GatherObject>Concealed Mineral Deposit</GatherObject>
				<HotSpots>
					<HotSpot Radius="150" XYZ="723.8118, -97.36623, 453.2475" name="Concealed Mineral Deposit" />
				</HotSpots>
				<ItemNames>
					<ItemName>Violet Roundstone</ItemName>
					<ItemName>Violet Ooid</ItemName>
				</ItemNames>
			</Gather>
			<FlyTo XYZ="667.0069, -124.9072, 325.6782" Altitude="-92" MountId="45" Radius="1.0" />

			<Gather loops="2">
				<GatherObject>Mineral Deposit</GatherObject>
				<HotSpots>
					<HotSpot Radius="150" XYZ="667.0069, -124.9072, 325.6782" name="Mineral Deposit" />
				</HotSpots>
				<ItemNames>
					<ItemName>Aurum Regis Sand</ItemName>
				</ItemNames>
			</Gather>

			<Gather loops="2">
				<GatherObject>Concealed Mineral Deposit</GatherObject>
				<HotSpots>
					<HotSpot Radius="150" XYZ="667.0069, -124.9072, 325.6782" name="Concealed Mineral Deposit" />
				</HotSpots>
				<ItemNames>
					<ItemName>Violet Roundstone</ItemName>
					<ItemName>Violet Ooid</ItemName>
				</ItemNames>
			</Gather>
		</While>
	</Order>
</Profile>