Advertisement
Guest User

szpieg2

a guest
Nov 20th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. origin = GetCachedCelestial("M:2:184:9") // Celestial from where to spy from
  2. myAlliance = "Anonimowi Wyjadacze" // Should skip this alliance
  3. spyFromSystem = 150 // Lower limit system to spy
  4. spyToSystem = 214 // Upper limit system to spy
  5. spy2send = 3 // Number of spy probes to send
  6. playersToIgnore = ["Swawolna Ola", "Wabik", "Karolinka", "Kasia", "Unavit", "w0jci3ch ", "Adik", "Gienia", "kubanczyk", "Kostka Lodu"] // Name of players to ignore
  7. alliancesToIgnore = ["MNS", "A W"] // Name of alliances to ignore
  8.  
  9. // Skip if player is inactive or player from my alliance
  10. func shouldSkip(planetInfo) {
  11. if planetInfo == nil { return true }
  12.  
  13. // Check ignored players list
  14. for playerName in playersToIgnore {
  15. if planetInfo.Player.Name == playerName {
  16. return true
  17. }
  18. }
  19.  
  20. // Check ignored alliances list
  21. for allianceName in alliancesToIgnore {
  22. if (planetInfo.Alliance != nil && planetInfo.Alliance.Name == allianceName) {
  23. return true
  24. }
  25. }
  26.  
  27. return planetInfo.Inactive || planetInfo.Vacation || (planetInfo.Alliance && planetInfo.Alliance.Name == myAlliance)
  28. }
  29.  
  30. // Sends spy probes to a coordinate
  31. func spyCoord(coord) {
  32. for {
  33. slots = GetSlots()
  34. if slots.InUse < slots.Total {
  35. fleet = NewFleet()
  36. fleet.SetOrigin(origin)
  37. fleet.SetDestination(coord)
  38. fleet.SetMission(SPY)
  39. fleet.AddShips(ESPIONAGEPROBE, spy2send)
  40. fleet, err = fleet.SendNow()
  41. Print("Sending probes to", coord)
  42. break
  43. } else {
  44. Sleep(30 * 1000) // Wait 30s
  45. }
  46. }
  47. }
  48.  
  49. // Foreach systems in the defined range, spy all active moons
  50. if spyFromSystem < 1 { spyFromSystem = 1 }
  51. if spyToSystem > 499 { spyToSystem = 499 }
  52. for system = spyFromSystem; system <= spyToSystem; system++ {
  53. systemInfos, _ = GalaxyInfos(origin.GetCoordinate().Galaxy, system)
  54. for i = 1; i <= 15; i++ {
  55. planetInfo = systemInfos.Position(i)
  56. if !shouldSkip(planetInfo) && planetInfo.Moon != nil {
  57. Print(planetInfo)
  58. pCoord = planetInfo.Coordinate
  59. mCoord = NewCoordinate(pCoord.Galaxy, pCoord.System, pCoord.Position, MOON_TYPE)
  60. spyCoord(mCoord)
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement