Advertisement
Nair

Untitled

Sep 26th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.03 KB | None | 0 0
  1.  
  2. 1    Var­ depot­ As­ New­ CMyShip(979800);
  3. 2    Var­ deutfleet­ As­ New­ CMyFleet(55449);­
  4. 3    Var­ ship­ As­ CMyShip;
  5. 4    Var­ erzfleet­ As­ New­ CMyFleet(55448);
  6. 5    Var­ oreTransport­ As­ New­ CMyShip(978631);
  7. 6    
  8. 7    For­ (Each­ ship­ In­ deutfleet.Ships)­ {
  9. 8    ­ ­
  10. 9    ­ ­ If­ (ship.MapPosition­ <>­ depot.MapPosition)­ {
  11. 10   ­ ­ ­ ­ WriteLine(ship.Name­ &­ "­ is­ in­ the­ wrong­ place");
  12. 11   ­ ­ }­ Else­ {
  13. 12   ­ ­ ­ ­ While­ (ship.BussardCollectorHeating­ <­ ship.Definition.BussardCollectorCapacity)­ {­
  14. 13   ­ ­ ­ ­ ­ ­ If­ (ship.Docked)­ {­ ship.Action.Undock();­ }­
  15. 14   ­ ­ ­ ­ ­ ­ ship.Action.CollectDeuterium(ship.Energy);­
  16. 15   ­ ­ ­ ­ ­ ­ ship.Action.DockTo(depot.ShipID);
  17. 16   ­ ­ ­ ­ ­ ­
  18. 17   ­ ­ ­ ­ ­ ­ If­ (ship.Docked)­ {­
  19. 18   ­ ­ ­ ­ ­ ­ ­ ­ If­ (ship.StockRoom.Amount(EGoodsType.Deuterium)­ >­ 0)­ {­
  20. 19   ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ship.Action.TransferToShip(depot.ShipID,­ ship.StockRoom.Amount(EGoodsType.Deuterium),­ EBeamResource.Deuterium);­ //Save­ some­ Deuterium­ -­ the­ rest­ transport­ to­ the­ station
  21. 20   ­ ­ ­ ­ ­ ­ ­ ­ }­
  22. 21   ­ ­ ­ ­ ­ ­ }­ Else­ {
  23. 22   ­ ­ ­ ­ ­ ­ ­ ­ WriteLine(ship.ShipID­ &­ "can't­ dock");­
  24. 23   ­ ­ ­ ­ ­ ­ }
  25. 24   ­ ­ ­ ­ }
  26. 25   ­ ­ }
  27. 26   ­ ­ If­ (ship.WarpCore­ <­ 800)­ {
  28. 27   ­ ­ ­ ­ ship.Action.TransferFromShip(depot.ShipID800­ -­ ship.WarpCore,­ EBeamResource.Warpcore)
  29. 28   ­ ­ }
  30. 29   }
  31. 30  
  32. 31   WriteLine(depot.Name­ &­ ":"­ &­ depot.StockRoom.Amount(EGoodsType.Deuterium)­ &­ "­ Deuterium,­ "­ &­ depot.WarpCore­ &­ "­ Warpcore");
  33. 32   If­ (depot.WarpCore­ <­ 3000)­ {
  34. 33   ­ ­ WriteLine('Warning­ Warpcore­ Low­ '­ &­ depot.WarpCore)
  35. 34   }
  36. 35   Var­ c1­ As­ New­ CMyColony(89882);
  37. 36   Var­ c2­ As­ New­ CMyColony(89880);
  38. 37   Var­ c3­ As­ New­ CMyColony(89881);
  39. 38  
  40. 39   Var­ colonies[]­ As­ CMyColony­ =­ {­ c1,­ c2,­ c3­ };
  41. 40   Var­ colony­ As­ CMyColony;
  42. 41   Var­ i­ As­ Integer­ =­ colonies.Length;
  43. 42  
  44. 43   For­ (Each­ ship­ In­ erzfleet.Ships)­ {
  45. 44   ­ ­ ship.Action.CollectOre(ship.Energy)
  46. 45   ­ ­ If­ (ship.StockRoom.Amount(EGoodsType.IridiumOre)­ >­ 0)­ {
  47. 46   ­ ­ ­ ­ ship.Action.TransferToShip(978631,­ ship.StockRoom.Amount(EGoodsType.IridiumOre),­ EGoodsType.IridiumOre)
  48. 47   ­ ­ }
  49. 48   }
  50. 49  
  51. 50   If­ (oreTransport.StockRoom.Amount(EGoodsType.IridiumOre)­ >­ 450)­ {
  52. 51   ­ ­ For­ (Each­ colony­ In­ colonies)­ {
  53. 52   ­ ­ ­ ­ oreTransport.Action.FlyTo('@'­ &­ colony.Coordinates.X­ &­ '|'­ &­ colony.Coordinates.Y)
  54. 53   ­ ­ ­ ­ oreTransport.Action.TransferToColony(colony.SectorID,­ oreTransport.StockRoom.Amount(EGoodsType.IridiumOre)­ /­ i,­ EBeamResource.IridiumOre);
  55. 54   ­ ­ ­ ­ i--;­
  56. 55   ­ ­ }
  57. 56   ­ ­ oreTransport.Action.FlyTo('@'­ &­ colonies[0].Coordinates.X­ &­ '|'­ &­ colonies[0].Coordinates.Y);
  58. 57  
  59. 58   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement