Documentation ¶
Index ¶
- Constants
- Variables
- func ActivateCelestialItemHandler(c echo.Context) error
- func BuildBuildingHandler(c echo.Context) error
- func BuildCancelableHandler(c echo.Context) error
- func BuildDefenseHandler(c echo.Context) error
- func BuildHandler(c echo.Context) error
- func BuildProductionHandler(c echo.Context) error
- func BuildShipsHandler(c echo.Context) error
- func BuildTechnologyHandler(c echo.Context) error
- func BuyOfferOfTheDayHandler(c echo.Context) error
- func CalcFlightTime(origin, destination ogame.Coordinate, universeSize, nbSystems int64, ...) (secs, fuel int64)
- func CalcFlightTimeWithBaseSpeed(origin, destination ogame.Coordinate, universeSize, nbSystems int64, ...) (secs int64)
- func CancelBuildingHandler(c echo.Context) error
- func CancelFleetHandler(c echo.Context) error
- func CancelResearchHandler(c echo.Context) error
- func CelestialAbandonHandler(c echo.Context) error
- func ConstructionsBeingBuiltHandler(c echo.Context) error
- func ConvertIntoCoordinate(w Wrapper, v IntoCoordinate) (ogame.Coordinate, error)
- func DebugGalaxy(opt *Options)
- func DeleteEspionageMessagesHandler(c echo.Context) error
- func DeleteMessageHandler(c echo.Context) error
- func DeleteMessagesFromTabHandler(c echo.Context) error
- func Distance(c1, c2 ogame.Coordinate, universeSize, nbSystems, systemsSkip int64, ...) (distance int64)
- func DoAuctionHandler(c echo.Context) error
- func GalaxyInfosHandler(c echo.Context) error
- func GetAlliancePageContentHandler(c echo.Context) error
- func GetAttacksHandler(c echo.Context) error
- func GetAuctionHandler(c echo.Context) error
- func GetCaptchaChallengeHandler(c echo.Context) error
- func GetCaptchaHandler(c echo.Context) error
- func GetCaptchaSolverHandler(c echo.Context) error
- func GetCelestialItemsHandler(c echo.Context) error
- func GetCharacterClassHandler(c echo.Context) error
- func GetClientWithProxy(proxyAddr, proxyUsername, proxyPassword, proxyType string, config *tls.Config) (*http.Client, error)
- func GetDefenseHandler(c echo.Context) error
- func GetEmpireHandler(c echo.Context) error
- func GetEspionageReportForHandler(c echo.Context) error
- func GetEspionageReportHandler(c echo.Context) error
- func GetEspionageReportMessagesHandler(c echo.Context) error
- func GetFacilitiesHandler(c echo.Context) error
- func GetFleetSpeedForMission(serverData gameforge.ServerData, missionID ogame.MissionID) int64
- func GetFleetsHandler(c echo.Context) error
- func GetFromGameHandler(c echo.Context) error
- func GetLanguageHandler(c echo.Context) error
- func GetLfBuildingsHandler(c echo.Context) error
- func GetLfResearchHandler(c echo.Context) error
- func GetMoonByCoordHandler(c echo.Context) error
- func GetMoonHandler(c echo.Context) error
- func GetMoonsHandler(c echo.Context) error
- func GetPlanetByCoordHandler(c echo.Context) error
- func GetPlanetHandler(c echo.Context) error
- func GetPlanetsHandler(c echo.Context) error
- func GetPriceHandler(c echo.Context) error
- func GetProductionHandler(c echo.Context) error
- func GetPublicIPHandler(c echo.Context) error
- func GetRequirementsHandler(c echo.Context) error
- func GetResearchHandler(c echo.Context) error
- func GetResourceSettingsHandler(c echo.Context) error
- func GetResourcesBuildingsHandler(c echo.Context) error
- func GetResourcesDetailsHandler(c echo.Context) error
- func GetResourcesHandler(c echo.Context) error
- func GetServerDataHandler(c echo.Context) error
- func GetServerHandler(c echo.Context) error
- func GetShipsHandler(c echo.Context) error
- func GetSlotsHandler(c echo.Context) error
- func GetStaticHEADHandler(c echo.Context) error
- func GetStaticHandler(c echo.Context) error
- func GetUniverseNameHandler(c echo.Context) error
- func GetUniverseSpeedFleetHandler(c echo.Context) error
- func GetUniverseSpeedHandler(c echo.Context) error
- func GetUserInfosHandler(c echo.Context) error
- func GetUsernameHandler(c echo.Context) error
- func HasAdmiralHandler(c echo.Context) error
- func HasCommanderHandler(c echo.Context) error
- func HasEngineerHandler(c echo.Context) error
- func HasGeologistHandler(c echo.Context) error
- func HasTechnocratHandler(c echo.Context) error
- func HomeHandler(c echo.Context) error
- func IsAjaxPage(vals url.Values) bool
- func IsEmpirePage(vals url.Values) bool
- func IsKnowFullPage(vals url.Values) bool
- func IsUnderAttackByIDHandler(c echo.Context) error
- func IsUnderAttackHandler(c echo.Context) error
- func IsVacationModeHandler(c echo.Context) error
- func JumpGateHandler(c echo.Context) error
- func LoginHandler(c echo.Context) error
- func LogoutHandler(c echo.Context) error
- func PageContentHandler(c echo.Context) error
- func PhalanxHandler(c echo.Context) error
- func PostToGameHandler(c echo.Context) error
- func SendDiscoveryHandler(c echo.Context) error
- func SendFleetHandler(c echo.Context) error
- func SendIPMHandler(c echo.Context) error
- func SendMessageHandler(c echo.Context) error
- func ServerTimeHandler(c echo.Context) error
- func ServerURLHandler(c echo.Context) error
- func ServerVersionHandler(c echo.Context) error
- func SetResourceSettingsHandler(c echo.Context) error
- func SetUserAgentHandler(c echo.Context) error
- func SkipCacheFullPage(opt *Options)
- func SkipInterceptor(opt *Options)
- func SkipRetry(opt *Options)
- func TasksHandler(c echo.Context) error
- func TeardownHandler(c echo.Context) error
- func TechsHandler(c echo.Context) error
- type APIResp
- type CaptchaChallenge
- type Celestial
- type ChatPostResp
- type CheckTargetResponse
- type FleetBuilder
- func (f *FleetBuilder) AddShips(id ogame.ID, nbr int64) *FleetBuilder
- func (f *FleetBuilder) FlightTime() (secs, fuel int64)
- func (f *FleetBuilder) OnError(clb func(error)) *FleetBuilder
- func (f *FleetBuilder) OnSuccess(clb func(ogame.Fleet)) *FleetBuilder
- func (f *FleetBuilder) SendNow() (ogame.Fleet, error)
- func (f *FleetBuilder) SetAllCrystal() *FleetBuilder
- func (f *FleetBuilder) SetAllDeuterium() *FleetBuilder
- func (f *FleetBuilder) SetAllMetal() *FleetBuilder
- func (f *FleetBuilder) SetAllResources() *FleetBuilder
- func (f *FleetBuilder) SetAllShips() *FleetBuilder
- func (f *FleetBuilder) SetCrystal(crystal int64) *FleetBuilder
- func (f *FleetBuilder) SetDestination(v IntoCoordinate) *FleetBuilder
- func (f *FleetBuilder) SetDeuterium(deuterium int64) *FleetBuilder
- func (f *FleetBuilder) SetDuration(holdingTime int64) *FleetBuilder
- func (f *FleetBuilder) SetMetal(metal int64) *FleetBuilder
- func (f *FleetBuilder) SetMinimumDeuterium(minimumDeuterium int64) *FleetBuilder
- func (f *FleetBuilder) SetMission(mission ogame.MissionID) *FleetBuilder
- func (f *FleetBuilder) SetOrigin(v IntoCelestial) *FleetBuilder
- func (f *FleetBuilder) SetRecallIn(secs int64) *FleetBuilder
- func (f *FleetBuilder) SetResources(resources ogame.Resources) *FleetBuilder
- func (f *FleetBuilder) SetShips(ships ogame.ShipsInfos) *FleetBuilder
- func (f *FleetBuilder) SetSpeed(speed ogame.Speed) *FleetBuilder
- func (f *FleetBuilder) SetTx(tx Prioritizable) *FleetBuilder
- func (f *FleetBuilder) SetUnionID(unionID int64) *FleetBuilder
- type FleetBuilderFactory
- type GalaxyPageContent
- type IShipsInfos
- type IntoCelestial
- type IntoCoordinate
- type IntoMoon
- type IntoPlanet
- type MessageSuccess
- type Moon
- func (m Moon) ActivateItem(ref string) error
- func (m Moon) Build(id ogame.ID, nbr int64) error
- func (m Moon) BuildBuilding(buildingID ogame.ID) error
- func (m Moon) BuildDefense(defenseID ogame.ID, nbr int64) error
- func (m Moon) BuildTechnology(technologyID ogame.ID) error
- func (m Moon) CancelBuilding() error
- func (m Moon) CancelLfBuilding() error
- func (m Moon) CancelResearch() error
- func (m Moon) ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
- func (m Moon) EnsureFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, ...) (ogame.Fleet, error)
- func (m Moon) GetDefense(options ...Option) (ogame.DefensesInfos, error)
- func (m Moon) GetFacilities(options ...Option) (ogame.Facilities, error)
- func (m Moon) GetItems() ([]ogame.Item, error)
- func (m Moon) GetLfBuildings(options ...Option) (ogame.LfBuildings, error)
- func (m Moon) GetLfResearch(options ...Option) (ogame.LfResearches, error)
- func (m Moon) GetProduction() ([]ogame.Quantifiable, int64, error)
- func (m Moon) GetResources() (ogame.Resources, error)
- func (m Moon) GetResourcesBuildings(options ...Option) (ogame.ResourcesBuildings, error)
- func (m Moon) GetResourcesDetails() (ogame.ResourcesDetails, error)
- func (m Moon) GetShips(options ...Option) (ogame.ShipsInfos, error)
- func (m Moon) GetTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ...)
- func (m Moon) Phalanx(coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
- func (m Moon) SendFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, ...) (ogame.Fleet, error)
- func (m Moon) TearDown(buildingID ogame.ID) error
- type OGame
- func (b *OGame) Abandon(v IntoPlanet) error
- func (b *OGame) ActivateItem(ref string, celestialID ogame.CelestialID) error
- func (b *OGame) AddAccount(number int, lang string) (*gameforge.AddAccountRes, error)
- func (b *OGame) Begin() Prioritizable
- func (b *OGame) BeginNamed(name string) Prioritizable
- func (b *OGame) Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
- func (b *OGame) BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error
- func (b *OGame) BuildCancelable(celestialID ogame.CelestialID, id ogame.ID) error
- func (b *OGame) BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error
- func (b *OGame) BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
- func (b *OGame) BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error
- func (b *OGame) BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error
- func (b *OGame) BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error
- func (b *OGame) BuyOfferOfTheDay() error
- func (b *OGame) BuyResetTree(planetID ogame.PlanetID, tier int64) error
- func (b *OGame) BytesDownloaded() int64
- func (b *OGame) BytesUploaded() int64
- func (b *OGame) CalcFlightTime(origin, destination ogame.Coordinate, speed float64, ships ogame.ShipsInfos, ...) (secs, fuel int64)
- func (b *OGame) CancelBuilding(celestialID ogame.CelestialID) error
- func (b *OGame) CancelFleet(fleetID ogame.FleetID) error
- func (b *OGame) CancelLfBuilding(celestialID ogame.CelestialID) error
- func (b *OGame) CancelResearch(celestialID ogame.CelestialID) error
- func (b *OGame) CharacterClass() ogame.CharacterClass
- func (b *OGame) CheckTarget(ships ogame.ShipsInfos, coordinate ogame.Coordinate, options ...Option) (CheckTargetResponse, error)
- func (b *OGame) CollectAllMarketplaceMessages() error
- func (b *OGame) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error
- func (b *OGame) ConstructionTime(id ogame.ID, nbr int64, facilities ogame.Facilities) time.Duration
- func (b *OGame) ConstructionsBeingBuilt(celestialID ogame.CelestialID) (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
- func (b *OGame) CountColonies() (int64, int64)
- func (b *OGame) CreateUnion(fleet ogame.Fleet, users []string) (int64, error)
- func (b *OGame) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error
- func (b *OGame) DeleteMessage(msgID int64) error
- func (b *OGame) DestroyRockets(planetID ogame.PlanetID, abm, ipm int64) error
- func (b *OGame) Disable()
- func (b *OGame) Distance(origin, destination ogame.Coordinate) int64
- func (b *OGame) DoAuction(bid map[ogame.CelestialID]ogame.Resources) error
- func (b *OGame) Done()
- func (b *OGame) Enable()
- func (b *OGame) EnsureFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, ...) (ogame.Fleet, error)
- func (b *OGame) FleetDeutSaveFactor() float64
- func (b *OGame) FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ...) (secs, fuel int64)
- func (b *OGame) FreeResetTree(planetID ogame.PlanetID, tier int64) error
- func (b *OGame) GalaxyInfos(galaxy, system int64, options ...Option) (ogame.SystemInfos, error)
- func (b *OGame) GetActiveItems(celestialID ogame.CelestialID) ([]ogame.ActiveItem, error)
- func (b *OGame) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)
- func (b *OGame) GetAttacks(opts ...Option) ([]ogame.AttackEvent, error)
- func (b *OGame) GetAuction() (ogame.Auction, error)
- func (b *OGame) GetAvailableDiscoveries(opts ...Option) int64
- func (b *OGame) GetCachedAllianceClass() (ogame.AllianceClass, error)
- func (b *OGame) GetCachedCelestial(v IntoCelestial) (Celestial, error)
- func (b *OGame) GetCachedCelestials() []Celestial
- func (b *OGame) GetCachedLfBonuses() (ogame.LfBonuses, error)
- func (b *OGame) GetCachedMoon(v IntoMoon) (Moon, error)
- func (b *OGame) GetCachedMoons() []Moon
- func (b *OGame) GetCachedPlanet(v IntoPlanet) (Planet, error)
- func (b *OGame) GetCachedPlanets() []Planet
- func (b *OGame) GetCachedPlayer() ogame.UserInfos
- func (b *OGame) GetCachedPreferences() ogame.Preferences
- func (b *OGame) GetCachedResearch() ogame.Researches
- func (b *OGame) GetCelestial(v IntoCelestial) (Celestial, error)
- func (b *OGame) GetCelestials() ([]Celestial, error)
- func (b *OGame) GetClient() *httpclient.Client
- func (b *OGame) GetCombatReportSummaryFor(coord ogame.Coordinate) (ogame.CombatReportSummary, error)
- func (b *OGame) GetDMCosts(celestialID ogame.CelestialID) (ogame.DMCosts, error)
- func (b *OGame) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error)
- func (b *OGame) GetDevice() *device.Device
- func (b *OGame) GetEmpire(celestialType ogame.CelestialType) ([]ogame.EmpireCelestial, error)
- func (b *OGame) GetEmpireJSON(celestialType ogame.CelestialType) (any, error)
- func (b *OGame) GetEspionageReport(msgID int64) (ogame.EspionageReport, error)
- func (b *OGame) GetEspionageReportFor(coord ogame.Coordinate) (ogame.EspionageReport, error)
- func (b *OGame) GetEspionageReportMessages(maxPage int64) ([]ogame.EspionageReportSummary, error)
- func (b *OGame) GetExpeditionMessageAt(t time.Time) (ogame.ExpeditionMessage, error)
- func (b *OGame) GetExpeditionMessages(maxPage int64) ([]ogame.ExpeditionMessage, error)
- func (b *OGame) GetExtractor() extractor.Extractor
- func (b *OGame) GetFacilities(celestialID ogame.CelestialID, options ...Option) (ogame.Facilities, error)
- func (b *OGame) GetFleetDispatch(celestialID ogame.CelestialID, options ...Option) (ogame.FleetDispatchInfos, error)
- func (b *OGame) GetFleets(opts ...Option) ([]ogame.Fleet, ogame.Slots)
- func (b *OGame) GetFleetsFromEventList() []ogame.Fleet
- func (b *OGame) GetItems(celestialID ogame.CelestialID) ([]ogame.Item, error)
- func (b *OGame) GetLanguage() string
- func (b *OGame) GetLfBonuses() (ogame.LfBonuses, error)
- func (b *OGame) GetLfBuildings(celestialID ogame.CelestialID, opts ...Option) (ogame.LfBuildings, error)
- func (b *OGame) GetLfResearch(celestialID ogame.CelestialID, opts ...Option) (ogame.LfResearches, error)
- func (b *OGame) GetLfResearchDetails(celestialID ogame.CelestialID, opts ...Option) (ogame.LfResearchDetails, error)
- func (b *OGame) GetLoginClient() *httpclient.Client
- func (b *OGame) GetMoon(v IntoMoon) (Moon, error)
- func (b *OGame) GetMoons() ([]Moon, error)
- func (b *OGame) GetNbSystems() int64
- func (b *OGame) GetPageContent(vals url.Values) ([]byte, error)
- func (b *OGame) GetPlanet(v IntoPlanet) (Planet, error)
- func (b *OGame) GetPlanets() ([]Planet, error)
- func (b *OGame) GetPositionsAvailableForDiscoveryFleet(galaxy int64, system int64, opts ...Option) ([]ogame.Coordinate, error)
- func (b *OGame) GetProduction(celestialID ogame.CelestialID) ([]ogame.Quantifiable, int64, error)
- func (b *OGame) GetPublicIP() (string, error)
- func (b *OGame) GetResearch() (ogame.Researches, error)
- func (b *OGame) GetResearchSpeed() int64
- func (b *OGame) GetResourceSettings(planetID ogame.PlanetID, options ...Option) (ogame.ResourceSettings, error)
- func (b *OGame) GetResources(celestialID ogame.CelestialID) (ogame.Resources, error)
- func (b *OGame) GetResourcesBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.ResourcesBuildings, error)
- func (b *OGame) GetResourcesDetails(celestialID ogame.CelestialID) (ogame.ResourcesDetails, error)
- func (b *OGame) GetResourcesProductions(planetID ogame.PlanetID) (ogame.Resources, error)
- func (b *OGame) GetResourcesProductionsLight(resBuildings ogame.ResourcesBuildings, researches ogame.Researches, ...) ogame.Resources
- func (b *OGame) GetServer() gameforge.Server
- func (b *OGame) GetServerData() gameforge.ServerData
- func (b *OGame) GetSession() string
- func (b *OGame) GetShips(celestialID ogame.CelestialID, options ...Option) (ogame.ShipsInfos, error)
- func (b *OGame) GetSlots() (ogame.Slots, error)
- func (b *OGame) GetState() (bool, string)
- func (b *OGame) GetTasks() taskRunner.TasksOverview
- func (b *OGame) GetTechs(celestialID ogame.CelestialID) (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ...)
- func (b *OGame) GetUniverseName() string
- func (b *OGame) GetUniverseSpeed() int64
- func (b *OGame) GetUniverseSpeedFleet() int64
- func (b *OGame) GetUserInfos() (ogame.UserInfos, error)
- func (b *OGame) GetUsername() string
- func (b *OGame) HeadersForPage(url string) (http.Header, error)
- func (b *OGame) Highscore(category, typ, page int64) (ogame.Highscore, error)
- func (b *OGame) IsConnected() bool
- func (b *OGame) IsDonutGalaxy() bool
- func (b *OGame) IsDonutSystem() bool
- func (b *OGame) IsEnabled() bool
- func (b *OGame) IsLocked() bool
- func (b *OGame) IsLoggedIn() bool
- func (b *OGame) IsPioneers() bool
- func (b *OGame) IsUnderAttack(opts ...Option) (bool, error)
- func (b *OGame) IsV10() bool
- func (b *OGame) IsV104() bool
- func (b *OGame) IsV11() bool
- func (b *OGame) IsV7() bool
- func (b *OGame) IsV8() bool
- func (b *OGame) IsV9() bool
- func (b *OGame) IsVGreaterThanOrEqual(compareVersion string) bool
- func (b *OGame) IsVacationModeEnabled() bool
- func (b *OGame) JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (success bool, rechargeCountdown int64, err error)
- func (b *OGame) JumpGateDestinations(origin ogame.MoonID) (moonIDs []ogame.MoonID, rechargeCountdown int64, err error)
- func (b *OGame) Location() *time.Location
- func (b *OGame) Login() error
- func (b *OGame) LoginWithBearerToken(token string) (bool, error)
- func (b *OGame) LoginWithExistingCookies() (bool, error)
- func (b *OGame) Logout()
- func (b *OGame) OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, ...) error
- func (b *OGame) OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, ...) error
- func (b *OGame) OnStateChange(clb func(locked bool, actor string))
- func (b *OGame) Phalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
- func (b *OGame) PostPageContent(vals, payload url.Values) ([]byte, error)
- func (b *OGame) Quiet(quiet bool)
- func (b *OGame) ReconnectChat() bool
- func (b *OGame) RecruitOfficer(typ, days int64) error
- func (b *OGame) RegisterAuctioneerCallback(fn func(packet any))
- func (b *OGame) RegisterChatCallback(fn func(msg ogame.ChatMsg))
- func (b *OGame) RegisterHTMLInterceptor(fn func(method, url string, params, payload url.Values, pageHTML []byte))
- func (b *OGame) RegisterWSCallback(id string, fn func(msg []byte))
- func (b *OGame) RemoveWSCallback(id string)
- func (b *OGame) SelectLfResearchArtifacts(planetID ogame.PlanetID, slotNumber int64, techID ogame.ID) error
- func (b *OGame) SelectLfResearchRandom(planetID ogame.PlanetID, slotNumber int64) error
- func (b *OGame) SelectLfResearchSelect(planetID ogame.PlanetID, slotNumber int64) error
- func (b *OGame) SendDiscoveryFleet(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) error
- func (b *OGame) SendDiscoveryFleet2(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) (ogame.Fleet, error)
- func (b *OGame) SendFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, ...) (ogame.Fleet, error)
- func (b *OGame) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)
- func (b *OGame) SendMessage(playerID int64, message string) error
- func (b *OGame) SendMessageAlliance(associationID int64, message string) error
- func (b *OGame) ServerTime() (time.Time, error)
- func (b *OGame) ServerURL() string
- func (b *OGame) ServerVersion() string
- func (b *OGame) SetClient(client *httpclient.Client)
- func (b *OGame) SetGetServerDataWrapper(...)
- func (b *OGame) SetInitiator(initiator string) Prioritizable
- func (b *OGame) SetLogger(logger *log.Logger)
- func (b *OGame) SetLoginWrapper(newWrapper func(func() (bool, error)) error)
- func (b *OGame) SetOGameCredentials(username, password, otpSecret, bearerToken string)
- func (b *OGame) SetPreferences(p ogame.Preferences) error
- func (b *OGame) SetPreferencesLang(lang string) error
- func (b *OGame) SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool, ...) error
- func (b *OGame) SetResourceSettings(planetID ogame.PlanetID, settings ogame.ResourceSettings) error
- func (b *OGame) SetVacationMode() error
- func (b *OGame) SystemDistance(system1, system2 int64) int64
- func (b *OGame) TearDown(celestialID ogame.CelestialID, id ogame.ID) error
- func (b *OGame) TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)
- func (b *OGame) Tx(clb func(tx Prioritizable) error) error
- func (b *OGame) TxNamed(name string, clb func(tx Prioritizable) error) error
- func (b *OGame) UnsafePhalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
- func (b *OGame) UseDM(typ ogame.DMType, celestialID ogame.CelestialID) error
- func (b *OGame) ValidateAccount(code string) error
- func (b *OGame) WithPriority(priority taskRunner.Priority) Prioritizable
- type OGameError
- type Option
- type Options
- type Params
- type Planet
- func (p Planet) ActivateItem(ref string) error
- func (p Planet) Build(id ogame.ID, nbr int64) error
- func (p Planet) BuildBuilding(buildingID ogame.ID) error
- func (p Planet) BuildCancelable(id ogame.ID) error
- func (p Planet) BuildDefense(defenseID ogame.ID, nbr int64) error
- func (p Planet) BuildShips(shipID ogame.ID, nbr int64) error
- func (p Planet) BuildTechnology(technologyID ogame.ID) error
- func (p Planet) CancelBuilding() error
- func (p Planet) CancelLfBuilding() error
- func (p Planet) CancelResearch() error
- func (p Planet) ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
- func (p Planet) EnsureFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, ...) (ogame.Fleet, error)
- func (p Planet) FlightTime(destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, ...) (secs, fuel int64)
- func (p Planet) GetDefense(options ...Option) (ogame.DefensesInfos, error)
- func (p Planet) GetFacilities(options ...Option) (ogame.Facilities, error)
- func (p Planet) GetItems() ([]ogame.Item, error)
- func (p Planet) GetLfBuildings(options ...Option) (ogame.LfBuildings, error)
- func (p Planet) GetLfResearch(options ...Option) (ogame.LfResearches, error)
- func (p Planet) GetMoon() *Moon
- func (p Planet) GetProduction() ([]ogame.Quantifiable, int64, error)
- func (p Planet) GetResourceSettings(options ...Option) (ogame.ResourceSettings, error)
- func (p Planet) GetResources() (ogame.Resources, error)
- func (p Planet) GetResourcesBuildings(options ...Option) (ogame.ResourcesBuildings, error)
- func (p Planet) GetResourcesDetails() (ogame.ResourcesDetails, error)
- func (p Planet) GetResourcesProductions() (ogame.Resources, error)
- func (p Planet) GetShips(options ...Option) (ogame.ShipsInfos, error)
- func (p Planet) GetTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ...)
- func (p Planet) SendFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, ...) (ogame.Fleet, error)
- func (p Planet) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)
- func (p Planet) String() string
- func (p Planet) TearDown(buildingID ogame.ID) error
- type Prioritizable
- type Prioritize
- func (b *Prioritize) Abandon(v IntoPlanet) error
- func (b *Prioritize) ActivateItem(ref string, celestialID ogame.CelestialID) error
- func (b *Prioritize) Begin() Prioritizable
- func (b *Prioritize) BeginNamed(name string) Prioritizable
- func (b *Prioritize) Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
- func (b *Prioritize) BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error
- func (b *Prioritize) BuildCancelable(celestialID ogame.CelestialID, id ogame.ID) error
- func (b *Prioritize) BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error
- func (b *Prioritize) BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
- func (b *Prioritize) BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error
- func (b *Prioritize) BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error
- func (b *Prioritize) BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error
- func (b *Prioritize) BuyOfferOfTheDay() error
- func (b *Prioritize) BuyResetTree(planetID ogame.PlanetID, tier int64) error
- func (b *Prioritize) CancelBuilding(celestialID ogame.CelestialID) error
- func (b *Prioritize) CancelFleet(fleetID ogame.FleetID) error
- func (b *Prioritize) CancelLfBuilding(celestialID ogame.CelestialID) error
- func (b *Prioritize) CancelResearch(celestialID ogame.CelestialID) error
- func (b *Prioritize) CheckTarget(ships ogame.ShipsInfos, coord ogame.Coordinate, options ...Option) (CheckTargetResponse, error)
- func (b *Prioritize) CollectAllMarketplaceMessages() error
- func (b *Prioritize) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error
- func (b *Prioritize) ConstructionsBeingBuilt(celestialID ogame.CelestialID) (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
- func (b *Prioritize) CreateUnion(fleet ogame.Fleet, users []string) (int64, error)
- func (b *Prioritize) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error
- func (b *Prioritize) DeleteMessage(msgID int64) error
- func (b *Prioritize) DestroyRockets(planetID ogame.PlanetID, abm, ipm int64) error
- func (b *Prioritize) DoAuction(bid map[ogame.CelestialID]ogame.Resources) error
- func (b *Prioritize) Done()
- func (b *Prioritize) EnsureFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, ...) (ogame.Fleet, error)
- func (b *Prioritize) FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ...) (secs, fuel int64)
- func (b *Prioritize) FreeResetTree(planetID ogame.PlanetID, tier int64) error
- func (b *Prioritize) GalaxyInfos(galaxy, system int64, options ...Option) (ogame.SystemInfos, error)
- func (b *Prioritize) GetActiveItems(celestialID ogame.CelestialID) ([]ogame.ActiveItem, error)
- func (b *Prioritize) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)
- func (b *Prioritize) GetAttacks(opts ...Option) ([]ogame.AttackEvent, error)
- func (b *Prioritize) GetAuction() (ogame.Auction, error)
- func (b *Prioritize) GetAvailableDiscoveries(opts ...Option) int64
- func (b *Prioritize) GetCachedAllianceClass() (ogame.AllianceClass, error)
- func (b *Prioritize) GetCachedLfBonuses() (ogame.LfBonuses, error)
- func (b *Prioritize) GetCachedResearch() ogame.Researches
- func (b *Prioritize) GetCelestial(v IntoCelestial) (Celestial, error)
- func (b *Prioritize) GetCelestials() ([]Celestial, error)
- func (b *Prioritize) GetCombatReportSummaryFor(coord ogame.Coordinate) (ogame.CombatReportSummary, error)
- func (b *Prioritize) GetDMCosts(celestialID ogame.CelestialID) (ogame.DMCosts, error)
- func (b *Prioritize) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error)
- func (b *Prioritize) GetEmpire(celestialType ogame.CelestialType) ([]ogame.EmpireCelestial, error)
- func (b *Prioritize) GetEmpireJSON(celestialType ogame.CelestialType) (any, error)
- func (b *Prioritize) GetEspionageReport(msgID int64) (ogame.EspionageReport, error)
- func (b *Prioritize) GetEspionageReportFor(coord ogame.Coordinate) (ogame.EspionageReport, error)
- func (b *Prioritize) GetEspionageReportMessages(maxPage int64) ([]ogame.EspionageReportSummary, error)
- func (b *Prioritize) GetExpeditionMessageAt(t time.Time) (ogame.ExpeditionMessage, error)
- func (b *Prioritize) GetExpeditionMessages(maxPage int64) ([]ogame.ExpeditionMessage, error)
- func (b *Prioritize) GetFacilities(celestialID ogame.CelestialID, options ...Option) (ogame.Facilities, error)
- func (b *Prioritize) GetFleetDispatch(celestialID ogame.CelestialID, options ...Option) (ogame.FleetDispatchInfos, error)
- func (b *Prioritize) GetFleets(opts ...Option) ([]ogame.Fleet, ogame.Slots)
- func (b *Prioritize) GetFleetsFromEventList() []ogame.Fleet
- func (b *Prioritize) GetItems(celestialID ogame.CelestialID) ([]ogame.Item, error)
- func (b *Prioritize) GetLfBonuses() (ogame.LfBonuses, error)
- func (b *Prioritize) GetLfBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.LfBuildings, error)
- func (b *Prioritize) GetLfResearch(celestialID ogame.CelestialID, options ...Option) (ogame.LfResearches, error)
- func (b *Prioritize) GetLfResearchDetails(celestialID ogame.CelestialID, options ...Option) (ogame.LfResearchDetails, error)
- func (b *Prioritize) GetMoon(v IntoMoon) (Moon, error)
- func (b *Prioritize) GetMoons() ([]Moon, error)
- func (b *Prioritize) GetPageContent(vals url.Values) ([]byte, error)
- func (b *Prioritize) GetPlanet(v IntoPlanet) (Planet, error)
- func (b *Prioritize) GetPlanets() ([]Planet, error)
- func (b *Prioritize) GetPositionsAvailableForDiscoveryFleet(galaxy int64, system int64, opts ...Option) ([]ogame.Coordinate, error)
- func (b *Prioritize) GetProduction(celestialID ogame.CelestialID) ([]ogame.Quantifiable, int64, error)
- func (b *Prioritize) GetResearch() (ogame.Researches, error)
- func (b *Prioritize) GetResourceSettings(planetID ogame.PlanetID, options ...Option) (ogame.ResourceSettings, error)
- func (b *Prioritize) GetResources(celestialID ogame.CelestialID) (ogame.Resources, error)
- func (b *Prioritize) GetResourcesBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.ResourcesBuildings, error)
- func (b *Prioritize) GetResourcesDetails(celestialID ogame.CelestialID) (ogame.ResourcesDetails, error)
- func (b *Prioritize) GetResourcesProductions(planetID ogame.PlanetID) (ogame.Resources, error)
- func (b *Prioritize) GetResourcesProductionsLight(resBuildings ogame.ResourcesBuildings, researches ogame.Researches, ...) ogame.Resources
- func (b *Prioritize) GetShips(celestialID ogame.CelestialID, options ...Option) (ogame.ShipsInfos, error)
- func (b *Prioritize) GetSlots() (ogame.Slots, error)
- func (b *Prioritize) GetTechs(celestialID ogame.CelestialID) (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ...)
- func (b *Prioritize) GetUserInfos() (ogame.UserInfos, error)
- func (b *Prioritize) HeadersForPage(url string) (http.Header, error)
- func (b *Prioritize) Highscore(category, typ, page int64) (ogame.Highscore, error)
- func (b *Prioritize) IsUnderAttack(opts ...Option) (bool, error)
- func (b *Prioritize) JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (bool, int64, error)
- func (b *Prioritize) JumpGateDestinations(origin ogame.MoonID) ([]ogame.MoonID, int64, error)
- func (b *Prioritize) Login() error
- func (b *Prioritize) LoginWithBearerToken(token string) (bool, error)
- func (b *Prioritize) LoginWithExistingCookies() (bool, error)
- func (b *Prioritize) Logout()
- func (b *Prioritize) OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, ...) error
- func (b *Prioritize) OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, ...) error
- func (b *Prioritize) Phalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
- func (b *Prioritize) PostPageContent(vals, payload url.Values) ([]byte, error)
- func (b *Prioritize) RecruitOfficer(typ, days int64) error
- func (b *Prioritize) SelectLfResearchArtifacts(planetID ogame.PlanetID, slotNumber int64, techID ogame.ID) error
- func (b *Prioritize) SelectLfResearchRandom(planetID ogame.PlanetID, slotNumber int64) error
- func (b *Prioritize) SelectLfResearchSelect(planetID ogame.PlanetID, slotNumber int64) error
- func (b *Prioritize) SendDiscoveryFleet(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) error
- func (b *Prioritize) SendDiscoveryFleet2(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) (ogame.Fleet, error)
- func (b *Prioritize) SendFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, ...) (ogame.Fleet, error)
- func (b *Prioritize) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)
- func (b *Prioritize) SendMessage(playerID int64, message string) error
- func (b *Prioritize) SendMessageAlliance(associationID int64, message string) error
- func (b *Prioritize) ServerTime() (time.Time, error)
- func (b *Prioritize) SetInitiator(initiator string) Prioritizable
- func (b *Prioritize) SetPreferences(p ogame.Preferences) error
- func (b *Prioritize) SetPreferencesLang(lang string) error
- func (b *Prioritize) SetResourceSettings(planetID ogame.PlanetID, settings ogame.ResourceSettings) error
- func (b *Prioritize) SetTaskDoneCh(ch chan struct{})
- func (b *Prioritize) SetVacationMode() error
- func (b *Prioritize) TearDown(celestialID ogame.CelestialID, id ogame.ID) error
- func (b *Prioritize) TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)
- func (b *Prioritize) Tx(clb func(Prioritizable) error) error
- func (b *Prioritize) TxNamed(name string, clb func(Prioritizable) error) error
- func (b *Prioritize) UnsafePhalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
- func (b *Prioritize) UseDM(typ ogame.DMType, celestialID ogame.CelestialID) error
- type ShipsInfos
- func (s *ShipsInfos) ByID(id ogame.ID) int64
- func (s *ShipsInfos) Cargo(techs ogame.IResearches, lfBonuses ogame.LfBonuses, ...) int64
- func (s *ShipsInfos) GetCargo() (out int64)
- func (s *ShipsInfos) Set(id ogame.ID, nbr int64)
- func (s *ShipsInfos) Speed() (out int64)
- func (s *ShipsInfos) ToQuantifiables() []ogame.Quantifiable
- type Wrapper
Constants ¶
const ( OverviewPageName = "overview" PreferencesPageName = "preferences" ResourceSettingsPageName = "resourceSettings" DefensesPageName = "defenses" LfBuildingsPageName = "lfbuildings" LfResearchPageName = "lfresearch" SuppliesPageName = "supplies" FacilitiesPageName = "facilities" FleetdispatchPageName = "fleetdispatch" ShipyardPageName = "shipyard" MovementPageName = "movement" ResearchPageName = "research" LfBonusesPageName = "lfbonuses" PlanetlayerPageName = "planetlayer" LogoutPageName = "logout" TraderOverviewPageName = "traderOverview" GalaxyPageName = "galaxy" AlliancePageName = "alliance" PremiumPageName = "premium" ShopPageName = "shop" RewardsPageName = "rewards" HighscorePageName = "highscore" BuddiesPageName = "buddies" MessagesPageName = "messages" ChatPageName = "chat" FetchTechsName = "fetchTechs" FetchResourcesPageName = "fetchResources" // ajax pages RocketlayerPageName = "rocketlayer" FetchEventboxAjaxPageName = "fetchEventbox" FetchResourcesAjaxPageName = "fetchResources" GalaxyContentAjaxPageName = "galaxyContent" GalaxyAjaxPageName = "galaxy" EventListAjaxPageName = "eventList" AjaxChatAjaxPageName = "ajaxChat" NoticesAjaxPageName = "notices" RepairlayerAjaxPageName = "repairlayer" TechtreeAjaxPageName = "techtree" PhalanxAjaxPageName = "phalanx" JumpgatelayerAjaxPageName = "jumpgatelayer" FederationlayerAjaxPageName = "federationlayer" UnionchangeAjaxPageName = "unionchange" ChangenickAjaxPageName = "changenick" PlanetlayerAjaxPageName = "planetlayer" TraderlayerAjaxPageName = "traderlayer" PlanetRenameAjaxPageName = "planetRename" AllianceOverviewAjaxPageName = "allianceOverview" SupportAjaxPageName = "support" BuffActivationAjaxPageName = "buffActivation" AuctioneerAjaxPageName = "auctioneer" HighscoreContentAjaxPageName = "highscoreContent" LfResearchLayerPageName = "lfresearchlayer" LfResearchResetLayerPageName = "lfresearchresetlayer" )
Page names
const ( EspionageMessagesTabID ogame.MessagesTabID = 20 CombatReportsMessagesTabID ogame.MessagesTabID = 21 ExpeditionsMessagesTabID ogame.MessagesTabID = 22 UnionsTransportMessagesTabID ogame.MessagesTabID = 23 OtherMessagesTabID ogame.MessagesTabID = 24 MarketplacePurchasesMessagesTabID ogame.MessagesTabID = 26 MarketplaceSalesMessagesTabID ogame.MessagesTabID = 27 )
Variables ¶
var DefaultGetServerDataWrapper = func(getServerDataFn func() (gameforge.ServerData, error)) (gameforge.ServerData, error) {
return getServerDataFn()
}
DefaultGetServerDataWrapper ...
var DefaultLoginWrapper = func(loginFn func() (bool, error)) error {
_, err := loginFn()
return err
}
DefaultLoginWrapper ...
var ErrBuild = errors.New("failed to build")
var ErrIntoCelestial = errors.New("unable to find celestial")
var ErrInvalidOrigin = errors.New("invalid origin")
Functions ¶
func ActivateCelestialItemHandler ¶
ActivateCelestialItemHandler ...
func BuildBuildingHandler ¶
BuildBuildingHandler ...
func BuildCancelableHandler ¶
BuildCancelableHandler ...
func BuildProductionHandler ¶
BuildProductionHandler ...
func BuildTechnologyHandler ¶
BuildTechnologyHandler ...
func BuyOfferOfTheDayHandler ¶
BuyOfferOfTheDayHandler ...
func CalcFlightTime ¶
func CalcFlightTime(origin, destination ogame.Coordinate, universeSize, nbSystems int64, donutGalaxy, donutSystem bool, fleetDeutSaveFactor, speed float64, universeSpeedFleet int64, ships ogame.ShipsInfos, techs ogame.Researches, lfBonuses ogame.LfBonuses, characterClass ogame.CharacterClass, allianceClass ogame.AllianceClass, systemsSkip int64) (secs, fuel int64)
CalcFlightTime ... Systems that are empty/inactive can be skipped for distance calculation (server settings: fleetIgnoreEmptySystems, fleetIgnoreInactiveSystems) https://board.en.ogame.gameforge.com/index.php?thread/838751-flight-time-consumption-ignores-empty-inactive-systems speed: 1 -> 100% | 0.5 -> 50% | 0.05 -> 5%
func CalcFlightTimeWithBaseSpeed ¶
func CalcFlightTimeWithBaseSpeed(origin, destination ogame.Coordinate, universeSize, nbSystems int64, donutGalaxy, donutSystem bool, speed float64, baseSpeed, universeSpeedFleet, systemsSkip int64) (secs int64)
CalcFlightTimeWithBaseSpeed ... baseSpeed is the speed of the slowest ship in a fleet speed: 1 -> 100% | 0.5 -> 50% | 0.05 -> 5%
func CancelBuildingHandler ¶
CancelBuildingHandler ...
func CancelResearchHandler ¶
CancelResearchHandler ...
func CelestialAbandonHandler ¶
CelestialAbandonHandler ...
func ConstructionsBeingBuiltHandler ¶
ConstructionsBeingBuiltHandler ...
func ConvertIntoCoordinate ¶
func ConvertIntoCoordinate(w Wrapper, v IntoCoordinate) (ogame.Coordinate, error)
ConvertIntoCoordinate helper that turns any type into a coordinate
func DeleteEspionageMessagesHandler ¶
DeleteEspionageMessagesHandler ...
func DeleteMessageHandler ¶
DeleteMessageHandler ...
func DeleteMessagesFromTabHandler ¶
DeleteMessagesFromTabHandler ...
func Distance ¶
func Distance(c1, c2 ogame.Coordinate, universeSize, nbSystems, systemsSkip int64, donutGalaxy, donutSystem bool) (distance int64)
Distance returns the distance between two coordinates
func DoAuctionHandler ¶
DoAuctionHandler (`celestialID=metal:crystal:deuterium` eg: `123456=123:456:789`)
func GetAlliancePageContentHandler ¶
GetAlliancePageContentHandler ...
func GetCaptchaChallengeHandler ¶
GetCaptchaChallengeHandler ...
func GetCaptchaSolverHandler ¶
GetCaptchaSolverHandler ...
func GetCelestialItemsHandler ¶
GetCelestialItemsHandler ...
func GetCharacterClassHandler ¶
GetCharacterClassHandler ...
func GetClientWithProxy ¶
func GetClientWithProxy(proxyAddr, proxyUsername, proxyPassword, proxyType string, config *tls.Config) (*http.Client, error)
GetClientWithProxy ...
func GetEspionageReportForHandler ¶
GetEspionageReportForHandler ...
func GetEspionageReportHandler ¶
GetEspionageReportHandler ...
func GetEspionageReportMessagesHandler ¶
GetEspionageReportMessagesHandler ...
func GetFacilitiesHandler ¶
GetFacilitiesHandler ...
func GetFleetSpeedForMission ¶
func GetFleetSpeedForMission(serverData gameforge.ServerData, missionID ogame.MissionID) int64
GetFleetSpeedForMission ...
func GetLfBuildingsHandler ¶
GetLfBuildingsHandler ...
func GetLfResearchHandler ¶
GetLfResearchHandler ...
func GetMoonByCoordHandler ¶
GetMoonByCoordHandler ...
func GetPlanetByCoordHandler ¶
GetPlanetByCoordHandler ...
func GetProductionHandler ¶
GetProductionHandler ...
func GetRequirementsHandler ¶
GetRequirementsHandler ...
func GetResourceSettingsHandler ¶
GetResourceSettingsHandler ...
func GetResourcesBuildingsHandler ¶
GetResourcesBuildingsHandler ...
func GetResourcesDetailsHandler ¶
GetResourcesDetailsHandler ...
func GetServerDataHandler ¶
GetServerDataHandler ...
func GetStaticHEADHandler ¶
GetStaticHEADHandler ...
func GetUniverseNameHandler ¶
GetUniverseNameHandler ...
func GetUniverseSpeedFleetHandler ¶
GetUniverseSpeedFleetHandler ...
func GetUniverseSpeedHandler ¶
GetUniverseSpeedHandler ...
func HasTechnocratHandler ¶
HasTechnocratHandler ...
func IsAjaxPage ¶
IsAjaxPage either the requested page is a partial/ajax page
func IsEmpirePage ¶
func IsUnderAttackHandler ¶
IsUnderAttackHandler ...
func IsVacationModeHandler ¶
IsVacationModeHandler ...
func PageContentHandler ¶
PageContentHandler ... curl 127.0.0.1:1234/bot/page-content -d 'page=overview&cp=123'
func SendDiscoveryHandler ¶
SendDiscoveryHandler ... curl 127.0.0.1:1234/bot/planets/123/send-discovery -d 'galaxy=1&system=1&type=1&position=1'
func SendFleetHandler ¶
SendFleetHandler ... curl 127.0.0.1:1234/bot/planets/123/send-fleet -d 'ships=203,1&ships=204,10&speed=10&galaxy=1&system=1&type=1&position=1&mission=3&metal=1&crystal=2&deuterium=3'
func SendMessageHandler ¶
SendMessageHandler ... curl 127.0.0.1:1234/bot/send-message -d 'playerID=123&message="Sup boi!"'
func ServerVersionHandler ¶
ServerVersionHandler ...
func SetResourceSettingsHandler ¶
SetResourceSettingsHandler ... curl 127.0.0.1:1234/bot/planets/123/resource-settings -d 'metalMine=100&crystalMine=100&deuteriumSynthesizer=100&solarPlant=100&fusionReactor=100&solarSatellite=100'
func SetUserAgentHandler ¶
SetUserAgentHandler deprecated
func SkipCacheFullPage ¶
func SkipCacheFullPage(opt *Options)
SkipCacheFullPage option to skip caching full page information
func SkipInterceptor ¶
func SkipInterceptor(opt *Options)
SkipInterceptor option to skip html interceptors
func TasksHandler ¶
TasksHandler return how many tasks are queued in the heap.
Types ¶
type CaptchaChallenge ¶
CaptchaChallenge ...
type Celestial ¶
type Celestial interface { ogame.Celestial ActivateItem(string) error Build(id ogame.ID, nbr int64) error BuildBuilding(buildingID ogame.ID) error BuildDefense(defenseID ogame.ID, nbr int64) error BuildTechnology(technologyID ogame.ID) error CancelBuilding() error CancelLfBuilding() error CancelResearch() error ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64) EnsureFleet(ogame.ShipsInfos, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error) GetDefense(...Option) (ogame.DefensesInfos, error) GetFacilities(...Option) (ogame.Facilities, error) GetItems() ([]ogame.Item, error) GetLfBuildings(...Option) (ogame.LfBuildings, error) GetLfResearch(...Option) (ogame.LfResearches, error) GetProduction() ([]ogame.Quantifiable, int64, error) GetResources() (ogame.Resources, error) GetResourcesBuildings(...Option) (ogame.ResourcesBuildings, error) GetResourcesDetails() (ogame.ResourcesDetails, error) GetShips(...Option) (ogame.ShipsInfos, error) GetTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error) SendFleet(ogame.ShipsInfos, ogame.Speed, ogame.Coordinate, ogame.MissionID, ogame.Resources, int64, int64) (ogame.Fleet, error) TearDown(buildingID ogame.ID) error }
Celestial superset of ogame.Celestial. Add methods that can be called for a planet or moon.
func ConvertIntoCelestial ¶
func ConvertIntoCelestial(w Wrapper, v IntoCelestial) (Celestial, error)
ConvertIntoCelestial helper that turns any type into a Celestial
type ChatPostResp ¶
type ChatPostResp struct { Status string `json:"status"` ID int `json:"id"` SenderID int `json:"senderId"` TargetID int `json:"targetId"` Text string `json:"text"` Date int64 `json:"date"` NewToken string `json:"newToken"` }
ChatPostResp ...
type CheckTargetResponse ¶
type CheckTargetResponse struct { Status string `json:"status"` Orders struct { Num1 bool `json:"1"` Num2 bool `json:"2"` Num3 bool `json:"3"` Num4 bool `json:"4"` Num5 bool `json:"5"` Num6 bool `json:"6"` Num7 bool `json:"7"` Num8 bool `json:"8"` Num9 bool `json:"9"` Num15 bool `json:"15"` } `json:"orders"` TargetInhabited bool `json:"targetInhabited"` TargetIsStrong bool `json:"targetIsStrong"` TargetIsOutlaw bool `json:"targetIsOutlaw"` TargetIsBuddyOrAllyMember bool `json:"targetIsBuddyOrAllyMember"` TargetPlayerID int `json:"targetPlayerId"` TargetPlayerName string `json:"targetPlayerName"` TargetPlayerColorClass string `json:"targetPlayerColorClass"` TargetPlayerRankIcon string `json:"targetPlayerRankIcon"` PlayerIsOutlaw bool `json:"playerIsOutlaw"` TargetPlanet struct { Galaxy int `json:"galaxy"` System int `json:"system"` Position int `json:"position"` Type int `json:"type"` Name string `json:"name"` } `json:"targetPlanet"` Errors []OGameError `json:"errors"` TargetOk bool `json:"targetOk"` Components []any `json:"components"` EmptySystems int64 `json:"emptySystems"` InactiveSystems int64 `json:"inactiveSystems"` NewAjaxToken string `json:"newAjaxToken"` }
CheckTargetResponse ...
type FleetBuilder ¶
type FleetBuilder struct {
// contains filtered or unexported fields
}
FleetBuilder ...
func (*FleetBuilder) AddShips ¶
func (f *FleetBuilder) AddShips(id ogame.ID, nbr int64) *FleetBuilder
AddShips ...
func (*FleetBuilder) FlightTime ¶
func (f *FleetBuilder) FlightTime() (secs, fuel int64)
FlightTime ...
func (*FleetBuilder) OnError ¶
func (f *FleetBuilder) OnError(clb func(error)) *FleetBuilder
OnError register an error callback
func (*FleetBuilder) OnSuccess ¶
func (f *FleetBuilder) OnSuccess(clb func(ogame.Fleet)) *FleetBuilder
OnSuccess register a success callback
func (*FleetBuilder) SendNow ¶
func (f *FleetBuilder) SendNow() (ogame.Fleet, error)
SendNow send the fleet with defined configurations
func (*FleetBuilder) SetAllCrystal ¶
func (f *FleetBuilder) SetAllCrystal() *FleetBuilder
SetAllCrystal will send all crystal from the origin
func (*FleetBuilder) SetAllDeuterium ¶
func (f *FleetBuilder) SetAllDeuterium() *FleetBuilder
SetAllDeuterium will send all deuterium from the origin
func (*FleetBuilder) SetAllMetal ¶
func (f *FleetBuilder) SetAllMetal() *FleetBuilder
SetAllMetal will send all metal from the origin
func (*FleetBuilder) SetAllResources ¶
func (f *FleetBuilder) SetAllResources() *FleetBuilder
SetAllResources will send all resources from the origin
func (*FleetBuilder) SetAllShips ¶
func (f *FleetBuilder) SetAllShips() *FleetBuilder
SetAllShips ...
func (*FleetBuilder) SetCrystal ¶
func (f *FleetBuilder) SetCrystal(crystal int64) *FleetBuilder
SetCrystal ...
func (*FleetBuilder) SetDestination ¶
func (f *FleetBuilder) SetDestination(v IntoCoordinate) *FleetBuilder
SetDestination ...
func (*FleetBuilder) SetDeuterium ¶
func (f *FleetBuilder) SetDeuterium(deuterium int64) *FleetBuilder
SetDeuterium ...
func (*FleetBuilder) SetDuration ¶
func (f *FleetBuilder) SetDuration(holdingTime int64) *FleetBuilder
SetDuration set expedition duration
func (*FleetBuilder) SetMetal ¶
func (f *FleetBuilder) SetMetal(metal int64) *FleetBuilder
SetMetal ...
func (*FleetBuilder) SetMinimumDeuterium ¶
func (f *FleetBuilder) SetMinimumDeuterium(minimumDeuterium int64) *FleetBuilder
SetMinimumDeuterium set minimum deuterium to keep on celestial
func (*FleetBuilder) SetMission ¶
func (f *FleetBuilder) SetMission(mission ogame.MissionID) *FleetBuilder
SetMission ...
func (*FleetBuilder) SetOrigin ¶
func (f *FleetBuilder) SetOrigin(v IntoCelestial) *FleetBuilder
SetOrigin ...
func (*FleetBuilder) SetRecallIn ¶
func (f *FleetBuilder) SetRecallIn(secs int64) *FleetBuilder
SetRecallIn ...
func (*FleetBuilder) SetResources ¶
func (f *FleetBuilder) SetResources(resources ogame.Resources) *FleetBuilder
SetResources ...
func (*FleetBuilder) SetShips ¶
func (f *FleetBuilder) SetShips(ships ogame.ShipsInfos) *FleetBuilder
SetShips ...
func (*FleetBuilder) SetSpeed ¶
func (f *FleetBuilder) SetSpeed(speed ogame.Speed) *FleetBuilder
SetSpeed ...
func (*FleetBuilder) SetUnionID ¶
func (f *FleetBuilder) SetUnionID(unionID int64) *FleetBuilder
SetUnionID set union id to join
type FleetBuilderFactory ¶
type FleetBuilderFactory struct {
// contains filtered or unexported fields
}
FleetBuilderFactory ...
func NewFleetBuilderFactory ¶
func NewFleetBuilderFactory(b Wrapper) *FleetBuilderFactory
NewFleetBuilderFactory ...
func (FleetBuilderFactory) NewFleet ¶
func (f FleetBuilderFactory) NewFleet() *FleetBuilder
NewFleet ...
type GalaxyPageContent ¶
type GalaxyPageContent struct { System struct { GalaxyContent []struct { Position int64 `json:"position"` AvailableMissions []struct { CanSend any `json:"canSend,omitempty"` MissionType ogame.MissionID `json:"missionType,omitempty"` } `json:"availableMissions"` } `json:"galaxyContent"` } `json:"system"` Token string `json:"token"` }
type IShipsInfos ¶
type IntoCelestial ¶
type IntoCelestial any
IntoCelestial any types that can be turned into a Celestial
type IntoCoordinate ¶
type IntoCoordinate any
IntoCoordinate any types that can be turned into a Coordinate
type MessageSuccess ¶
type MessageSuccess struct { Buff string `json:"buff"` Status string `json:"status"` Duration int `json:"duration"` Extendable bool `json:"extendable"` TotalDuration int `json:"totalDuration"` Tooltip string `json:"tooltip"` Reload bool `json:"reload"` BuffID string `json:"buffId"` Item struct { Name string `json:"name"` Image string `json:"image"` ImageLarge string `json:"imageLarge"` Title string `json:"title"` Effect string `json:"effect"` Ref string `json:"ref"` Rarity string `json:"rarity"` Amount int `json:"amount"` AmountFree int `json:"amount_free"` AmountBought int `json:"amount_bought"` Category []string `json:"category"` Currency string `json:"currency"` Costs string `json:"costs"` IsReduced bool `json:"isReduced"` Buyable bool `json:"buyable"` CanBeActivated bool `json:"canBeActivated"` CanBeBoughtAndActivated bool `json:"canBeBoughtAndActivated"` IsAnUpgrade bool `json:"isAnUpgrade"` IsCharacterClassItem bool `json:"isCharacterClassItem"` HasEnoughCurrency bool `json:"hasEnoughCurrency"` Cooldown int `json:"cooldown"` Duration int `json:"duration"` DurationExtension any `json:"durationExtension"` TotalTime int `json:"totalTime"` TimeLeft int `json:"timeLeft"` Status string `json:"status"` Extendable bool `json:"extendable"` FirstStatus string `json:"firstStatus"` ToolTip string `json:"toolTip"` BuyTitle string `json:"buyTitle"` ActivationTitle string `json:"activationTitle"` MoonOnlyItem bool `json:"moonOnlyItem"` } `json:"item"` Message string `json:"message"` }
type Moon ¶
Moon ogame moon object
func ConvertIntoMoon ¶
ConvertIntoMoon helper that turns any type into a Moon
func (Moon) ActivateItem ¶
ActivateItem activate an item
func (Moon) BuildBuilding ¶
BuildBuilding ensure what is being built is a building
func (Moon) BuildDefense ¶
BuildDefense builds a defense unit
func (Moon) BuildTechnology ¶
BuildTechnology ensure that we're trying to build a technology
func (Moon) CancelBuilding ¶
CancelBuilding cancel the construction of a building
func (Moon) CancelLfBuilding ¶
CancelLfBuilding cancel the construction of a lifeform building
func (Moon) CancelResearch ¶
CancelResearch cancel the research
func (Moon) ConstructionsBeingBuilt ¶
func (m Moon) ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)
func (Moon) EnsureFleet ¶
func (m Moon) EnsureFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
EnsureFleet either sends all the requested ships or fail
func (Moon) GetDefense ¶
func (m Moon) GetDefense(options ...Option) (ogame.DefensesInfos, error)
GetDefense gets all the defenses units information
func (Moon) GetFacilities ¶
func (m Moon) GetFacilities(options ...Option) (ogame.Facilities, error)
GetFacilities gets the moon facilities
func (Moon) GetLfBuildings ¶
func (m Moon) GetLfBuildings(options ...Option) (ogame.LfBuildings, error)
GetLfBuildings gets the lifeform buildings levels
func (Moon) GetLfResearch ¶
func (m Moon) GetLfResearch(options ...Option) (ogame.LfResearches, error)
GetLfResearch gets the lifeform techs levels
func (Moon) GetProduction ¶
func (m Moon) GetProduction() ([]ogame.Quantifiable, int64, error)
GetProduction get what is in the production queue. (ships & defense being built)
func (Moon) GetResources ¶
GetResources gets moon resources
func (Moon) GetResourcesBuildings ¶
func (m Moon) GetResourcesBuildings(options ...Option) (ogame.ResourcesBuildings, error)
GetResourcesBuildings gets the resources buildings levels
func (Moon) GetResourcesDetails ¶
func (m Moon) GetResourcesDetails() (ogame.ResourcesDetails, error)
GetResourcesDetails gets resources details
func (Moon) GetShips ¶
func (m Moon) GetShips(options ...Option) (ogame.ShipsInfos, error)
GetShips gets all ships units information
func (Moon) GetTechs ¶
func (m Moon) GetTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error)
GetTechs gets (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches)
func (Moon) Phalanx ¶
func (m Moon) Phalanx(coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
Phalanx uses 5000 deuterium to scan a coordinate
type OGame ¶
type OGame struct { sync.Mutex Player ogame.UserInfos CachedPreferences ogame.Preferences Universe string Username string // contains filtered or unexported fields }
OGame is a client for ogame.org. It is safe for concurrent use by multiple goroutines (thread-safe)
func NewNoLogin ¶
func NewNoLogin(username, password, otpSecret, bearerToken, universe, lang string, playerID int64, device *device.Device) (*OGame, error)
NewNoLogin does not auto login.
func NewWithParams ¶
NewWithParams create a new OGame instance with full control over the possible parameters
func (*OGame) ActivateItem ¶
func (b *OGame) ActivateItem(ref string, celestialID ogame.CelestialID) error
ActivateItem activate an item
func (*OGame) AddAccount ¶
AddAccount add a new account (server) to your list of accounts
func (*OGame) Begin ¶
func (b *OGame) Begin() Prioritizable
Begin start a transaction. Once this function is called, "Done" must be called to release the lock.
func (*OGame) BeginNamed ¶
func (b *OGame) BeginNamed(name string) Prioritizable
BeginNamed begins a new transaction with a name. "Done" must be called to release the lock.
func (*OGame) BuildBuilding ¶
BuildBuilding ensure what is being built is a building
func (*OGame) BuildCancelable ¶
BuildCancelable builds any cancelable ogame objects (building, technology)
func (*OGame) BuildDefense ¶
BuildDefense builds a defense unit
func (*OGame) BuildProduction ¶
BuildProduction builds any line production ogame objects (ship, defence)
func (*OGame) BuildShips ¶
BuildShips builds a ship unit
func (*OGame) BuildTechnology ¶
BuildTechnology ensure that we're trying to build a technology
func (*OGame) BuyMarketplace ¶
func (b *OGame) BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error
BuyMarketplace buy an item on the marketplace
func (*OGame) BuyOfferOfTheDay ¶
BuyOfferOfTheDay buys the offer of the day.
func (*OGame) BuyResetTree ¶
BuyResetTree reset a lifeform research tier tree using darkmatter
func (*OGame) BytesDownloaded ¶
BytesDownloaded returns the amount of bytes downloaded
func (*OGame) BytesUploaded ¶
BytesUploaded returns the amount of bytes uploaded
func (*OGame) CalcFlightTime ¶
func (b *OGame) CalcFlightTime(origin, destination ogame.Coordinate, speed float64, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)
CalcFlightTime calculates the flight time and the fuel consumption
func (*OGame) CancelBuilding ¶
func (b *OGame) CancelBuilding(celestialID ogame.CelestialID) error
CancelBuilding cancel the construction of a building on a specified planet
func (*OGame) CancelFleet ¶
CancelFleet cancel a fleet
func (*OGame) CancelLfBuilding ¶
func (b *OGame) CancelLfBuilding(celestialID ogame.CelestialID) error
CancelLfBuilding cancel the construction of a lifeform building on a specified planet
func (*OGame) CancelResearch ¶
func (b *OGame) CancelResearch(celestialID ogame.CelestialID) error
CancelResearch cancel the research
func (*OGame) CharacterClass ¶
func (b *OGame) CharacterClass() ogame.CharacterClass
CharacterClass returns the bot character class
func (*OGame) CheckTarget ¶
func (b *OGame) CheckTarget(ships ogame.ShipsInfos, coordinate ogame.Coordinate, options ...Option) (CheckTargetResponse, error)
CheckTarget ...
func (*OGame) CollectAllMarketplaceMessages ¶
CollectAllMarketplaceMessages collect all marketplace messages
func (*OGame) CollectMarketplaceMessage ¶
func (b *OGame) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error
CollectMarketplaceMessage collect marketplace message
func (*OGame) ConstructionTime ¶
ConstructionTime get duration to build something
func (*OGame) ConstructionsBeingBuilt ¶
func (b *OGame) ConstructionsBeingBuilt(celestialID ogame.CelestialID) (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)
func (*OGame) CountColonies ¶
CountColonies returns colonies count/possible
func (*OGame) CreateUnion ¶
CreateUnion creates a union
func (*OGame) DeleteAllMessagesFromTab ¶
func (b *OGame) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error
DeleteAllMessagesFromTab deletes all messages from a tab in the mail box
func (*OGame) DeleteMessage ¶
DeleteMessage deletes a message from the mail box
func (*OGame) DestroyRockets ¶
DestroyRockets destroys anti-ballistic & inter-planetary missiles
func (*OGame) Distance ¶
func (b *OGame) Distance(origin, destination ogame.Coordinate) int64
Distance return distance between two coordinates
func (*OGame) EnsureFleet ¶
func (b *OGame) EnsureFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
EnsureFleet either sends all the requested ships or fail
func (*OGame) FleetDeutSaveFactor ¶
FleetDeutSaveFactor returns the fleet deut save factor
func (*OGame) FlightTime ¶
func (b *OGame) FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)
FlightTime calculate flight time and fuel needed
func (*OGame) FreeResetTree ¶
FreeResetTree reset a lifeform research tier tree
func (*OGame) GalaxyInfos ¶
GalaxyInfos get information of all planets and moons of a solar system
func (*OGame) GetActiveItems ¶
func (b *OGame) GetActiveItems(celestialID ogame.CelestialID) ([]ogame.ActiveItem, error)
GetActiveItems ...
func (*OGame) GetAllResources ¶
GetAllResources gets the resources of all planets and moons
func (*OGame) GetAttacks ¶
func (b *OGame) GetAttacks(opts ...Option) ([]ogame.AttackEvent, error)
GetAttacks get enemy fleets attacking you
func (*OGame) GetAvailableDiscoveries ¶
GetAvailableDiscoveries ...
func (*OGame) GetCachedAllianceClass ¶
func (b *OGame) GetCachedAllianceClass() (ogame.AllianceClass, error)
GetCachedAllianceClass returns the bot alliance class
func (*OGame) GetCachedCelestial ¶
func (b *OGame) GetCachedCelestial(v IntoCelestial) (Celestial, error)
GetCachedCelestial return celestial from cached value
func (*OGame) GetCachedCelestials ¶
GetCachedCelestials get all cached celestials
func (*OGame) GetCachedLfBonuses ¶
GetCachedLfBonuses returns cached lifeform bonuses
func (*OGame) GetCachedMoon ¶
GetCachedMoon return moon from cached value
func (*OGame) GetCachedMoons ¶
GetCachedMoons return moons from cached value
func (*OGame) GetCachedPlanet ¶
func (b *OGame) GetCachedPlanet(v IntoPlanet) (Planet, error)
GetCachedPlanet return planet from cached value
func (*OGame) GetCachedPlanets ¶
GetCachedPlanets return planets from cached value
func (*OGame) GetCachedPlayer ¶
GetCachedPlayer returns cached player infos
func (*OGame) GetCachedPreferences ¶
func (b *OGame) GetCachedPreferences() ogame.Preferences
GetCachedPreferences returns cached preferences
func (*OGame) GetCachedResearch ¶
func (b *OGame) GetCachedResearch() ogame.Researches
GetCachedResearch returns cached researches
func (*OGame) GetCelestial ¶
func (b *OGame) GetCelestial(v IntoCelestial) (Celestial, error)
GetCelestial get the player's planet/moon using the coordinate
func (*OGame) GetCelestials ¶
GetCelestials get the player's planets & moons
func (*OGame) GetClient ¶
func (b *OGame) GetClient() *httpclient.Client
GetClient get the http client used by the bot
func (*OGame) GetCombatReportSummaryFor ¶
func (b *OGame) GetCombatReportSummaryFor(coord ogame.Coordinate) (ogame.CombatReportSummary, error)
GetCombatReportSummaryFor gets the latest combat report for a given coordinate
func (*OGame) GetDMCosts ¶
GetDMCosts returns fast build with DM information
func (*OGame) GetDefense ¶
func (b *OGame) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error)
GetDefense gets all the defenses units information of a planet Fails if planetID is invalid
func (*OGame) GetEmpire ¶
func (b *OGame) GetEmpire(celestialType ogame.CelestialType) ([]ogame.EmpireCelestial, error)
GetEmpire gets all planets/moons information resources/supplies/facilities/ships/researches
func (*OGame) GetEmpireJSON ¶
func (b *OGame) GetEmpireJSON(celestialType ogame.CelestialType) (any, error)
GetEmpireJSON retrieves JSON from Empire page (Commander only).
func (*OGame) GetEspionageReport ¶
func (b *OGame) GetEspionageReport(msgID int64) (ogame.EspionageReport, error)
GetEspionageReport gets a detailed espionage report
func (*OGame) GetEspionageReportFor ¶
func (b *OGame) GetEspionageReportFor(coord ogame.Coordinate) (ogame.EspionageReport, error)
GetEspionageReportFor gets the latest espionage report for a given coordinate
func (*OGame) GetEspionageReportMessages ¶
func (b *OGame) GetEspionageReportMessages(maxPage int64) ([]ogame.EspionageReportSummary, error)
GetEspionageReportMessages gets the summary of each espionage reports
func (*OGame) GetExpeditionMessageAt ¶
GetExpeditionMessageAt gets the expedition message for time t
func (*OGame) GetExpeditionMessages ¶
func (b *OGame) GetExpeditionMessages(maxPage int64) ([]ogame.ExpeditionMessage, error)
GetExpeditionMessages gets the expedition messages
func (*OGame) GetExtractor ¶
GetExtractor gets extractor object
func (*OGame) GetFacilities ¶
func (b *OGame) GetFacilities(celestialID ogame.CelestialID, options ...Option) (ogame.Facilities, error)
GetFacilities gets all facilities information of a planet
func (*OGame) GetFleetDispatch ¶
func (b *OGame) GetFleetDispatch(celestialID ogame.CelestialID, options ...Option) (ogame.FleetDispatchInfos, error)
GetFleetDispatch extract information available on the fleetdispatch page
func (*OGame) GetFleetsFromEventList ¶
GetFleetsFromEventList get the player's own fleets activities
func (*OGame) GetLanguage ¶
GetLanguage get ogame server language
func (*OGame) GetLfBonuses ¶
GetLfBonuses returns cached lifeform bonuses
func (*OGame) GetLfBuildings ¶
func (b *OGame) GetLfBuildings(celestialID ogame.CelestialID, opts ...Option) (ogame.LfBuildings, error)
GetLfBuildings ...
func (*OGame) GetLfResearch ¶
func (b *OGame) GetLfResearch(celestialID ogame.CelestialID, opts ...Option) (ogame.LfResearches, error)
GetLfResearch ...
func (*OGame) GetLfResearchDetails ¶
func (b *OGame) GetLfResearchDetails(celestialID ogame.CelestialID, opts ...Option) (ogame.LfResearchDetails, error)
GetLfResearchDetails ...
func (*OGame) GetLoginClient ¶
func (b *OGame) GetLoginClient() *httpclient.Client
GetLoginClient get the http client used by the bot for login operations
func (*OGame) GetNbSystems ¶
GetNbSystems gets the number of systems
func (*OGame) GetPageContent ¶
GetPageContent gets the html for a specific ogame page
func (*OGame) GetPlanet ¶
func (b *OGame) GetPlanet(v IntoPlanet) (Planet, error)
GetPlanet gets infos for planetID Fails if planetID is invalid
func (*OGame) GetPlanets ¶
GetPlanets returns the user planets
func (*OGame) GetPositionsAvailableForDiscoveryFleet ¶
func (b *OGame) GetPositionsAvailableForDiscoveryFleet(galaxy int64, system int64, opts ...Option) ([]ogame.Coordinate, error)
GetPositionsAvailableForDiscoveryFleet ...
func (*OGame) GetProduction ¶
func (b *OGame) GetProduction(celestialID ogame.CelestialID) ([]ogame.Quantifiable, int64, error)
GetProduction get what is in the production queue. (ships & defense being built)
func (*OGame) GetPublicIP ¶
GetPublicIP get the public IP used by the bot
func (*OGame) GetResearch ¶
func (b *OGame) GetResearch() (ogame.Researches, error)
GetResearch gets the player researches information
func (*OGame) GetResearchSpeed ¶
GetResearchSpeed gets the research speed
func (*OGame) GetResourceSettings ¶
func (b *OGame) GetResourceSettings(planetID ogame.PlanetID, options ...Option) (ogame.ResourceSettings, error)
GetResourceSettings gets the resources settings for specified planetID
func (*OGame) GetResources ¶
GetResources gets user resources
func (*OGame) GetResourcesBuildings ¶
func (b *OGame) GetResourcesBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.ResourcesBuildings, error)
GetResourcesBuildings gets the resources buildings levels
func (*OGame) GetResourcesDetails ¶
func (b *OGame) GetResourcesDetails(celestialID ogame.CelestialID) (ogame.ResourcesDetails, error)
GetResourcesDetails gets user resources
func (*OGame) GetResourcesProductions ¶
GetResourcesProductions gets the planet resources production
func (*OGame) GetResourcesProductionsLight ¶
func (b *OGame) GetResourcesProductionsLight(resBuildings ogame.ResourcesBuildings, researches ogame.Researches, resSettings ogame.ResourceSettings, temp ogame.Temperature) ogame.Resources
GetResourcesProductionsLight gets the planet resources production
func (*OGame) GetServerData ¶
func (b *OGame) GetServerData() gameforge.ServerData
GetServerData get ogame server data information that the bot is connected to
func (*OGame) GetShips ¶
func (b *OGame) GetShips(celestialID ogame.CelestialID, options ...Option) (ogame.ShipsInfos, error)
GetShips gets all ships units information of a planet
func (*OGame) GetTasks ¶
func (b *OGame) GetTasks() taskRunner.TasksOverview
GetTasks return how many tasks are queued in the heap.
func (*OGame) GetTechs ¶
func (b *OGame) GetTechs(celestialID ogame.CelestialID) (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error)
GetTechs gets a celestial supplies/facilities/ships/researches
func (*OGame) GetUniverseName ¶
GetUniverseName get the name of the universe the bot is playing into
func (*OGame) GetUniverseSpeed ¶
GetUniverseSpeed shortcut to get ogame universe speed
func (*OGame) GetUniverseSpeedFleet ¶
GetUniverseSpeedFleet shortcut to get ogame universe speed fleet
func (*OGame) GetUserInfos ¶
GetUserInfos gets the user information
func (*OGame) GetUsername ¶
GetUsername get the username that was used to login on ogame server
func (*OGame) HeadersForPage ¶
HeadersForPage gets the headers for a specific ogame page
func (*OGame) IsConnected ¶
IsConnected returns true if the bot is currently connected (communication between the bot and OGame is possible), otherwise false
func (*OGame) IsDonutGalaxy ¶
IsDonutGalaxy shortcut to get ogame galaxy donut config
func (*OGame) IsDonutSystem ¶
IsDonutSystem shortcut to get ogame system donut config
func (*OGame) IsLoggedIn ¶
IsLoggedIn returns true if the bot is currently logged-in, otherwise false
func (*OGame) IsPioneers ¶
IsPioneers either or not the bot use lobby-pioneers
func (*OGame) IsUnderAttack ¶
IsUnderAttack returns true if the user is under attack, false otherwise
func (*OGame) IsVGreaterThanOrEqual ¶
IsVGreaterThanOrEqual ...
func (*OGame) IsVacationModeEnabled ¶
IsVacationModeEnabled returns either or not the bot is in vacation mode
func (*OGame) JumpGate ¶
func (b *OGame) JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (success bool, rechargeCountdown int64, err error)
JumpGate sends ships through a jump gate.
func (*OGame) JumpGateDestinations ¶
func (b *OGame) JumpGateDestinations(origin ogame.MoonID) (moonIDs []ogame.MoonID, rechargeCountdown int64, err error)
JumpGateDestinations returns available destinations for jump gate.
func (*OGame) LoginWithBearerToken ¶
LoginWithBearerToken to ogame server reusing existing token
func (*OGame) LoginWithExistingCookies ¶
LoginWithExistingCookies to ogame server reusing existing cookies
func (*OGame) OfferBuyMarketplace ¶
func (b *OGame) OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error
OfferBuyMarketplace buy offer on marketplace
func (*OGame) OfferSellMarketplace ¶
func (b *OGame) OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error
OfferSellMarketplace sell offer on marketplace
func (*OGame) OnStateChange ¶
OnStateChange register a callback that is notified when the bot state changes
func (*OGame) Phalanx ¶
func (b *OGame) Phalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
Phalanx scan a coordinate from a moon to get fleets information IMPORTANT: My account was instantly banned when I scanned an invalid coordinate. IMPORTANT: This function DOES validate that the coordinate is a valid planet in range of phalanx
and that you have enough deuterium.
func (*OGame) PostPageContent ¶
PostPageContent make a post request to ogame server This is useful when simulating a web browser
func (*OGame) RecruitOfficer ¶
RecruitOfficer recruit an officer. Typ 2: Commander, 3: Admiral, 4: Engineer, 5: Geologist, 6: Technocrat Days: 7 or 90
func (*OGame) RegisterAuctioneerCallback ¶
RegisterAuctioneerCallback register a callback that is called when auctioneer packets are received
func (*OGame) RegisterChatCallback ¶
RegisterChatCallback register a callback that is called when chat messages are received
func (*OGame) RegisterHTMLInterceptor ¶
func (b *OGame) RegisterHTMLInterceptor(fn func(method, url string, params, payload url.Values, pageHTML []byte))
RegisterHTMLInterceptor ...
func (*OGame) RegisterWSCallback ¶
RegisterWSCallback ...
func (*OGame) SelectLfResearchArtifacts ¶
func (b *OGame) SelectLfResearchArtifacts(planetID ogame.PlanetID, slotNumber int64, techID ogame.ID) error
SelectLfResearchArtifacts select a lifeform research using artifacts
func (*OGame) SelectLfResearchRandom ¶
SelectLfResearchRandom select a random lifeform research
func (*OGame) SelectLfResearchSelect ¶
SelectLfResearchSelect select a lifeform research
func (*OGame) SendDiscoveryFleet ¶
func (b *OGame) SendDiscoveryFleet(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) error
SendDiscoveryFleet ...
func (*OGame) SendDiscoveryFleet2 ¶
func (b *OGame) SendDiscoveryFleet2(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) (ogame.Fleet, error)
SendDiscoveryFleet2 ...
func (*OGame) SendFleet ¶
func (b *OGame) SendFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
SendFleet sends a fleet
func (*OGame) SendIPM ¶
func (b *OGame) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)
SendIPM sends IPM
func (*OGame) SendMessage ¶
SendMessage sends a message to playerID
func (*OGame) SendMessageAlliance ¶
SendMessageAlliance sends a message to associationID
func (*OGame) ServerTime ¶
ServerTime returns server time Timezone is OGT (OGame Time zone)
func (*OGame) ServerVersion ¶
ServerVersion returns OGame version
func (*OGame) SetClient ¶
func (b *OGame) SetClient(client *httpclient.Client)
SetClient set the http client used by the bot
func (*OGame) SetGetServerDataWrapper ¶
func (b *OGame) SetGetServerDataWrapper(newWrapper func(func() (gameforge.ServerData, error)) (gameforge.ServerData, error))
SetGetServerDataWrapper ...
func (*OGame) SetInitiator ¶
func (b *OGame) SetInitiator(initiator string) Prioritizable
SetInitiator ...
func (*OGame) SetLoginWrapper ¶
SetLoginWrapper ...
func (*OGame) SetOGameCredentials ¶
SetOGameCredentials sets ogame credentials for the bot
func (*OGame) SetPreferences ¶
func (b *OGame) SetPreferences(p ogame.Preferences) error
SetPreferences ...
func (*OGame) SetPreferencesLang ¶
SetPreferencesLang ...
func (*OGame) SetProxy ¶
func (b *OGame) SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool, config *tls.Config) error
SetProxy this will change the bot http transport object. proxyType can be "http" or "socks5". An empty proxyAddress will reset the client transport to default value.
func (*OGame) SetResourceSettings ¶
SetResourceSettings set the resources settings on a planet
func (*OGame) SetVacationMode ¶
SetVacationMode puts account in vacation mode
func (*OGame) SystemDistance ¶
SystemDistance return the distance between two systems
func (*OGame) TechnologyDetails ¶
func (b *OGame) TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)
TechnologyDetails extract details from ajax window when clicking supplies/facilities/techs/lf...
func (*OGame) Tx ¶
func (b *OGame) Tx(clb func(tx Prioritizable) error) error
Tx locks the bot during the transaction and ensure the lock is released afterward
func (*OGame) TxNamed ¶
func (b *OGame) TxNamed(name string, clb func(tx Prioritizable) error) error
TxNamed locks the bot during the transaction and ensure the lock is released afterward
func (*OGame) UnsafePhalanx ¶
func (b *OGame) UnsafePhalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
UnsafePhalanx same as Phalanx but does not perform any input validation.
func (*OGame) ValidateAccount ¶
ValidateAccount validate a gameforge account
func (*OGame) WithPriority ¶
func (b *OGame) WithPriority(priority taskRunner.Priority) Prioritizable
WithPriority ...
type OGameError ¶
OGameError ogame struct for errors
type Option ¶
type Option func(*Options)
Option functions to be passed to public interface to change behaviors
func ChangePlanet ¶
func ChangePlanet(celestialID ogame.CelestialID) Option
ChangePlanet set the cp parameter
type Options ¶
type Options struct { DebugGalaxy bool SkipInterceptor bool SkipRetry bool SkipCacheFullPage bool ChangePlanet ogame.CelestialID // cp parameter Delay time.Duration }
Options ...
type Params ¶
type Params struct { Username string Password string BearerToken string // Gameforge auth bearer token OTPSecret string Universe string Lang string PlayerID int64 AutoLogin bool Proxy string ProxyUsername string ProxyPassword string ProxyType string ProxyLoginOnly bool TLSConfig *tls.Config Lobby string APINewHostname string Device *device.Device CaptchaCallback solvers.CaptchaCallback }
Params parameters for more fine-grained initialization
type Planet ¶
Planet ogame planet object
func ConvertIntoPlanet ¶
func ConvertIntoPlanet(w Wrapper, v IntoPlanet) (Planet, error)
ConvertIntoPlanet helper that turns any type into a Planet
func (Planet) ActivateItem ¶
ActivateItem activate an item
func (Planet) BuildBuilding ¶
BuildBuilding ensure what is being built is a building
func (Planet) BuildCancelable ¶
BuildCancelable builds any cancelable ogame objects (building, technology)
func (Planet) BuildDefense ¶
BuildDefense builds a defense unit
func (Planet) BuildShips ¶
BuildShips builds a ship unit
func (Planet) BuildTechnology ¶
BuildTechnology ensure that we're trying to build a technology
func (Planet) CancelBuilding ¶
CancelBuilding cancel the construction of a building
func (Planet) CancelLfBuilding ¶
CancelLfBuilding cancel the construction of a lifeform building
func (Planet) CancelResearch ¶
CancelResearch cancel the research
func (Planet) ConstructionsBeingBuilt ¶
func (p Planet) ConstructionsBeingBuilt() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)
func (Planet) EnsureFleet ¶
func (p Planet) EnsureFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
EnsureFleet either sends all the requested ships or fail
func (Planet) FlightTime ¶
func (p Planet) FlightTime(destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)
FlightTime calculate flight time and fuel needed
func (Planet) GetDefense ¶
func (p Planet) GetDefense(options ...Option) (ogame.DefensesInfos, error)
GetDefense gets all the defenses units information
func (Planet) GetFacilities ¶
func (p Planet) GetFacilities(options ...Option) (ogame.Facilities, error)
GetFacilities gets all facilities information
func (Planet) GetLfBuildings ¶
func (p Planet) GetLfBuildings(options ...Option) (ogame.LfBuildings, error)
GetLfBuildings gets the lifeform buildings levels
func (Planet) GetLfResearch ¶
func (p Planet) GetLfResearch(options ...Option) (ogame.LfResearches, error)
GetLfResearch gets the lifeform techs levels
func (Planet) GetProduction ¶
func (p Planet) GetProduction() ([]ogame.Quantifiable, int64, error)
GetProduction get what is in the production queue. (ships & defense being built)
func (Planet) GetResourceSettings ¶
func (p Planet) GetResourceSettings(options ...Option) (ogame.ResourceSettings, error)
GetResourceSettings gets the resources settings for specified planetID
func (Planet) GetResources ¶
GetResources gets user resources
func (Planet) GetResourcesBuildings ¶
func (p Planet) GetResourcesBuildings(options ...Option) (ogame.ResourcesBuildings, error)
GetResourcesBuildings gets the resources buildings levels
func (Planet) GetResourcesDetails ¶
func (p Planet) GetResourcesDetails() (ogame.ResourcesDetails, error)
GetResourcesDetails gets resources details
func (Planet) GetResourcesProductions ¶
GetResourcesProductions gets the resources production
func (Planet) GetShips ¶
func (p Planet) GetShips(options ...Option) (ogame.ShipsInfos, error)
GetShips gets all ships units information
func (Planet) GetTechs ¶
func (p Planet) GetTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error)
GetTechs gets (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches)
func (Planet) SendFleet ¶
func (p Planet) SendFleet(ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
SendFleet sends a fleet
type Prioritizable ¶
type Prioritizable interface { Abandon(IntoPlanet) error ActivateItem(string, ogame.CelestialID) error Begin() Prioritizable BeginNamed(name string) Prioritizable BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error BuyOfferOfTheDay() error BuyResetTree(planetID ogame.PlanetID, tier int64) error CancelFleet(ogame.FleetID) error CheckTarget(ogame.ShipsInfos, ogame.Coordinate, ...Option) (CheckTargetResponse, error) CollectAllMarketplaceMessages() error CollectMarketplaceMessage(ogame.MarketplaceMessage) error CreateUnion(fleet ogame.Fleet, unionUsers []string) (int64, error) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error DeleteMessage(msgID int64) error DoAuction(bid map[ogame.CelestialID]ogame.Resources) error Done() FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, mission ogame.MissionID) (secs, fuel int64) FreeResetTree(planetID ogame.PlanetID, tier int64) error GalaxyInfos(galaxy, system int64, opts ...Option) (ogame.SystemInfos, error) GetActiveItems(ogame.CelestialID) ([]ogame.ActiveItem, error) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error) GetAttacks(...Option) ([]ogame.AttackEvent, error) GetAuction() (ogame.Auction, error) GetAvailableDiscoveries(...Option) int64 GetCachedAllianceClass() (ogame.AllianceClass, error) GetCachedLfBonuses() (ogame.LfBonuses, error) GetCachedResearch() ogame.Researches GetCelestial(IntoCelestial) (Celestial, error) GetCelestials() ([]Celestial, error) GetCombatReportSummaryFor(ogame.Coordinate) (ogame.CombatReportSummary, error) GetDMCosts(ogame.CelestialID) (ogame.DMCosts, error) GetEmpire(ogame.CelestialType) ([]ogame.EmpireCelestial, error) GetEmpireJSON(ogame.CelestialType) (any, error) GetEspionageReport(msgID int64) (ogame.EspionageReport, error) GetEspionageReportFor(ogame.Coordinate) (ogame.EspionageReport, error) GetEspionageReportMessages(maxPage int64) ([]ogame.EspionageReportSummary, error) GetExpeditionMessageAt(time.Time) (ogame.ExpeditionMessage, error) GetExpeditionMessages(maxPage int64) ([]ogame.ExpeditionMessage, error) GetFleetDispatch(ogame.CelestialID, ...Option) (ogame.FleetDispatchInfos, error) GetFleets(...Option) ([]ogame.Fleet, ogame.Slots) GetFleetsFromEventList() []ogame.Fleet GetItems(ogame.CelestialID) ([]ogame.Item, error) GetLfBonuses() (ogame.LfBonuses, error) GetMoon(IntoMoon) (Moon, error) GetMoons() ([]Moon, error) GetPageContent(url.Values) ([]byte, error) GetPlanet(IntoPlanet) (Planet, error) GetPlanets() ([]Planet, error) GetPositionsAvailableForDiscoveryFleet(galaxy int64, system int64, opts ...Option) ([]ogame.Coordinate, error) GetResearch() (ogame.Researches, error) GetSlots() (ogame.Slots, error) GetUserInfos() (ogame.UserInfos, error) HeadersForPage(url string) (http.Header, error) Highscore(category, typ, page int64) (ogame.Highscore, error) IsUnderAttack(opts ...Option) (bool, error) Login() error LoginWithBearerToken(token string) (bool, error) LoginWithExistingCookies() (bool, error) Logout() OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error PostPageContent(url.Values, url.Values) ([]byte, error) RecruitOfficer(typ, days int64) error SelectLfResearchArtifacts(planetID ogame.PlanetID, slotNumber int64, techID ogame.ID) error SelectLfResearchRandom(planetID ogame.PlanetID, slotNumber int64) error SelectLfResearchSelect(planetID ogame.PlanetID, slotNumber int64) error SendMessage(playerID int64, message string) error SendMessageAlliance(associationID int64, message string) error ServerTime() (time.Time, error) SetInitiator(initiator string) Prioritizable SetPreferences(ogame.Preferences) error SetPreferencesLang(lang string) error SetVacationMode() error Tx(clb func(tx Prioritizable) error) error TxNamed(name string, clb func(Prioritizable) error) error UseDM(ogame.DMType, ogame.CelestialID) error // Planet or Moon functions Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error BuildCancelable(ogame.CelestialID, ogame.ID) error BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error CancelBuilding(ogame.CelestialID) error CancelLfBuilding(ogame.CelestialID) error CancelResearch(ogame.CelestialID) error ConstructionsBeingBuilt(ogame.CelestialID) (buildingID ogame.ID, buildingCountdown int64, researchID ogame.ID, researchCountdown int64, lfBuildingID ogame.ID, lfBuildingCountdown int64, lfResearchID ogame.ID, lfResearchCountdown int64) EnsureFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error) GetDefense(ogame.CelestialID, ...Option) (ogame.DefensesInfos, error) GetFacilities(ogame.CelestialID, ...Option) (ogame.Facilities, error) GetLfBuildings(ogame.CelestialID, ...Option) (ogame.LfBuildings, error) GetLfResearch(ogame.CelestialID, ...Option) (ogame.LfResearches, error) GetLfResearchDetails(ogame.CelestialID, ...Option) (ogame.LfResearchDetails, error) GetProduction(ogame.CelestialID) ([]ogame.Quantifiable, int64, error) GetResources(ogame.CelestialID) (ogame.Resources, error) GetResourcesBuildings(ogame.CelestialID, ...Option) (ogame.ResourcesBuildings, error) GetResourcesDetails(ogame.CelestialID) (ogame.ResourcesDetails, error) GetShips(ogame.CelestialID, ...Option) (ogame.ShipsInfos, error) GetTechs(celestialID ogame.CelestialID) (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error) SendDiscoveryFleet(ogame.CelestialID, ogame.Coordinate, ...Option) error SendDiscoveryFleet2(ogame.CelestialID, ogame.Coordinate, ...Option) (ogame.Fleet, error) SendFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error) TearDown(celestialID ogame.CelestialID, id ogame.ID) error TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error) // Planet specific functions DestroyRockets(ogame.PlanetID, int64, int64) error GetResourceSettings(ogame.PlanetID, ...Option) (ogame.ResourceSettings, error) GetResourcesProductions(ogame.PlanetID) (ogame.Resources, error) GetResourcesProductionsLight(ogame.ResourcesBuildings, ogame.Researches, ogame.ResourceSettings, ogame.Temperature) ogame.Resources SendIPM(ogame.PlanetID, ogame.Coordinate, int64, ogame.ID) (int64, error) SetResourceSettings(ogame.PlanetID, ogame.ResourceSettings) error // Moon specific functions JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (bool, int64, error) JumpGateDestinations(origin ogame.MoonID) ([]ogame.MoonID, int64, error) Phalanx(ogame.MoonID, ogame.Coordinate) ([]ogame.PhalanxFleet, error) UnsafePhalanx(ogame.MoonID, ogame.Coordinate) ([]ogame.PhalanxFleet, error) }
Prioritizable list of all actions that needs to communicate with ogame server. These actions can also be prioritized.
type Prioritize ¶
type Prioritize struct {
// contains filtered or unexported fields
}
Prioritize ...
func (*Prioritize) Abandon ¶
func (b *Prioritize) Abandon(v IntoPlanet) error
Abandon a planet. Warning: this is irreversible
func (*Prioritize) ActivateItem ¶
func (b *Prioritize) ActivateItem(ref string, celestialID ogame.CelestialID) error
ActivateItem activate an item
func (*Prioritize) Begin ¶
func (b *Prioritize) Begin() Prioritizable
Begin a new transaction. "Done" must be called to release the lock.
func (*Prioritize) BeginNamed ¶
func (b *Prioritize) BeginNamed(name string) Prioritizable
BeginNamed begins a new transaction with a name. "Done" must be called to release the lock.
func (*Prioritize) Build ¶
func (b *Prioritize) Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
Build builds any ogame objects (building, technology, ship, defence)
func (*Prioritize) BuildBuilding ¶
func (b *Prioritize) BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error
BuildBuilding ensure what is being built is a building
func (*Prioritize) BuildCancelable ¶
func (b *Prioritize) BuildCancelable(celestialID ogame.CelestialID, id ogame.ID) error
BuildCancelable builds any cancelable ogame objects (building, technology)
func (*Prioritize) BuildDefense ¶
func (b *Prioritize) BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error
BuildDefense builds a defense unit
func (*Prioritize) BuildProduction ¶
func (b *Prioritize) BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error
BuildProduction builds any line production ogame objects (ship, defence)
func (*Prioritize) BuildShips ¶
func (b *Prioritize) BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error
BuildShips builds a ship unit
func (*Prioritize) BuildTechnology ¶
func (b *Prioritize) BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error
BuildTechnology ensure that we're trying to build a technology
func (*Prioritize) BuyMarketplace ¶
func (b *Prioritize) BuyMarketplace(itemID int64, celestialID ogame.CelestialID) error
BuyMarketplace buy an item on the marketplace
func (*Prioritize) BuyOfferOfTheDay ¶
func (b *Prioritize) BuyOfferOfTheDay() error
BuyOfferOfTheDay buys the offer of the day.
func (*Prioritize) BuyResetTree ¶
func (b *Prioritize) BuyResetTree(planetID ogame.PlanetID, tier int64) error
BuyResetTree reset a lifeform research tier tree using darkmatter
func (*Prioritize) CancelBuilding ¶
func (b *Prioritize) CancelBuilding(celestialID ogame.CelestialID) error
CancelBuilding cancel the construction of a building on a specified planet
func (*Prioritize) CancelFleet ¶
func (b *Prioritize) CancelFleet(fleetID ogame.FleetID) error
CancelFleet cancel a fleet
func (*Prioritize) CancelLfBuilding ¶
func (b *Prioritize) CancelLfBuilding(celestialID ogame.CelestialID) error
CancelLfBuilding cancel the construction of a lifeform building on a specified planet
func (*Prioritize) CancelResearch ¶
func (b *Prioritize) CancelResearch(celestialID ogame.CelestialID) error
CancelResearch cancel the research
func (*Prioritize) CheckTarget ¶
func (b *Prioritize) CheckTarget(ships ogame.ShipsInfos, coord ogame.Coordinate, options ...Option) (CheckTargetResponse, error)
CheckTarget ...
func (*Prioritize) CollectAllMarketplaceMessages ¶
func (b *Prioritize) CollectAllMarketplaceMessages() error
CollectAllMarketplaceMessages collect all marketplace messages
func (*Prioritize) CollectMarketplaceMessage ¶
func (b *Prioritize) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error
CollectMarketplaceMessage collect marketplace message
func (*Prioritize) ConstructionsBeingBuilt ¶
func (b *Prioritize) ConstructionsBeingBuilt(celestialID ogame.CelestialID) (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)
func (*Prioritize) CreateUnion ¶
CreateUnion creates a union
func (*Prioritize) DeleteAllMessagesFromTab ¶
func (b *Prioritize) DeleteAllMessagesFromTab(tabID ogame.MessagesTabID) error
DeleteAllMessagesFromTab ...
func (*Prioritize) DeleteMessage ¶
func (b *Prioritize) DeleteMessage(msgID int64) error
DeleteMessage deletes a message from the mail box
func (*Prioritize) DestroyRockets ¶
func (b *Prioritize) DestroyRockets(planetID ogame.PlanetID, abm, ipm int64) error
DestroyRockets destroys anti-ballistic & inter-planetary missiles
func (*Prioritize) DoAuction ¶
func (b *Prioritize) DoAuction(bid map[ogame.CelestialID]ogame.Resources) error
DoAuction ...
func (*Prioritize) Done ¶
func (b *Prioritize) Done()
Done terminate the transaction, release the lock.
func (*Prioritize) EnsureFleet ¶
func (b *Prioritize) EnsureFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
EnsureFleet either sends all the requested ships or fail
func (*Prioritize) FlightTime ¶
func (b *Prioritize) FlightTime(origin, destination ogame.Coordinate, speed ogame.Speed, ships ogame.ShipsInfos, missionID ogame.MissionID) (secs, fuel int64)
FlightTime calculate flight time and fuel needed
func (*Prioritize) FreeResetTree ¶
func (b *Prioritize) FreeResetTree(planetID ogame.PlanetID, tier int64) error
FreeResetTree reset a lifeform research tier tree
func (*Prioritize) GalaxyInfos ¶
func (b *Prioritize) GalaxyInfos(galaxy, system int64, options ...Option) (ogame.SystemInfos, error)
GalaxyInfos get information of all planets and moons of a solar system
func (*Prioritize) GetActiveItems ¶
func (b *Prioritize) GetActiveItems(celestialID ogame.CelestialID) ([]ogame.ActiveItem, error)
GetActiveItems ...
func (*Prioritize) GetAllResources ¶
func (b *Prioritize) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)
GetAllResources ...
func (*Prioritize) GetAttacks ¶
func (b *Prioritize) GetAttacks(opts ...Option) ([]ogame.AttackEvent, error)
GetAttacks get enemy fleets attacking you
func (*Prioritize) GetAuction ¶
func (b *Prioritize) GetAuction() (ogame.Auction, error)
GetAuction ...
func (*Prioritize) GetAvailableDiscoveries ¶
func (b *Prioritize) GetAvailableDiscoveries(opts ...Option) int64
GetAvailableDiscoveries ...
func (*Prioritize) GetCachedAllianceClass ¶
func (b *Prioritize) GetCachedAllianceClass() (ogame.AllianceClass, error)
GetCachedAllianceClass ...
func (*Prioritize) GetCachedLfBonuses ¶
func (b *Prioritize) GetCachedLfBonuses() (ogame.LfBonuses, error)
GetCachedLfBonuses gets the cached lifeform bonuses
func (*Prioritize) GetCachedResearch ¶
func (b *Prioritize) GetCachedResearch() ogame.Researches
GetCachedResearch gets the player cached researches information
func (*Prioritize) GetCelestial ¶
func (b *Prioritize) GetCelestial(v IntoCelestial) (Celestial, error)
GetCelestial get the player's planet/moon using the coordinate
func (*Prioritize) GetCelestials ¶
func (b *Prioritize) GetCelestials() ([]Celestial, error)
GetCelestials get the player's planets & moons
func (*Prioritize) GetCombatReportSummaryFor ¶
func (b *Prioritize) GetCombatReportSummaryFor(coord ogame.Coordinate) (ogame.CombatReportSummary, error)
GetCombatReportSummaryFor gets the latest combat report for a given coordinate
func (*Prioritize) GetDMCosts ¶
func (b *Prioritize) GetDMCosts(celestialID ogame.CelestialID) (ogame.DMCosts, error)
GetDMCosts returns fast build with DM information
func (*Prioritize) GetDefense ¶
func (b *Prioritize) GetDefense(celestialID ogame.CelestialID, options ...Option) (ogame.DefensesInfos, error)
GetDefense gets all the defenses units information of a planet Fails if planetID is invalid
func (*Prioritize) GetEmpire ¶
func (b *Prioritize) GetEmpire(celestialType ogame.CelestialType) ([]ogame.EmpireCelestial, error)
GetEmpire (Commander only)
func (*Prioritize) GetEmpireJSON ¶
func (b *Prioritize) GetEmpireJSON(celestialType ogame.CelestialType) (any, error)
GetEmpireJSON retrieves JSON from Empire page (Commander only).
func (*Prioritize) GetEspionageReport ¶
func (b *Prioritize) GetEspionageReport(msgID int64) (ogame.EspionageReport, error)
GetEspionageReport gets a detailed espionage report
func (*Prioritize) GetEspionageReportFor ¶
func (b *Prioritize) GetEspionageReportFor(coord ogame.Coordinate) (ogame.EspionageReport, error)
GetEspionageReportFor gets the latest espionage report for a given coordinate
func (*Prioritize) GetEspionageReportMessages ¶
func (b *Prioritize) GetEspionageReportMessages(maxPage int64) ([]ogame.EspionageReportSummary, error)
GetEspionageReportMessages gets the summary of each espionage reports
func (*Prioritize) GetExpeditionMessageAt ¶
func (b *Prioritize) GetExpeditionMessageAt(t time.Time) (ogame.ExpeditionMessage, error)
GetExpeditionMessageAt gets the expedition message for time t
func (*Prioritize) GetExpeditionMessages ¶
func (b *Prioritize) GetExpeditionMessages(maxPage int64) ([]ogame.ExpeditionMessage, error)
GetExpeditionMessages gets the expedition messages
func (*Prioritize) GetFacilities ¶
func (b *Prioritize) GetFacilities(celestialID ogame.CelestialID, options ...Option) (ogame.Facilities, error)
GetFacilities gets all facilities information of a planet
func (*Prioritize) GetFleetDispatch ¶
func (b *Prioritize) GetFleetDispatch(celestialID ogame.CelestialID, options ...Option) (ogame.FleetDispatchInfos, error)
GetFleetDispatch extract information available on the fleetdispatch page
func (*Prioritize) GetFleetsFromEventList ¶
func (b *Prioritize) GetFleetsFromEventList() []ogame.Fleet
GetFleetsFromEventList get the player's own fleets activities
func (*Prioritize) GetItems ¶
func (b *Prioritize) GetItems(celestialID ogame.CelestialID) ([]ogame.Item, error)
GetItems get all items information
func (*Prioritize) GetLfBonuses ¶
func (b *Prioritize) GetLfBonuses() (ogame.LfBonuses, error)
GetLfBonuses gets the lifeform bonuses
func (*Prioritize) GetLfBuildings ¶
func (b *Prioritize) GetLfBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.LfBuildings, error)
GetLfBuildings ...
func (*Prioritize) GetLfResearch ¶
func (b *Prioritize) GetLfResearch(celestialID ogame.CelestialID, options ...Option) (ogame.LfResearches, error)
GetLfResearch ...
func (*Prioritize) GetLfResearchDetails ¶
func (b *Prioritize) GetLfResearchDetails(celestialID ogame.CelestialID, options ...Option) (ogame.LfResearchDetails, error)
GetLfResearchDetails ...
func (*Prioritize) GetMoon ¶
func (b *Prioritize) GetMoon(v IntoMoon) (Moon, error)
GetMoon gets infos for moonID
func (*Prioritize) GetMoons ¶
func (b *Prioritize) GetMoons() ([]Moon, error)
GetMoons returns the user moons
func (*Prioritize) GetPageContent ¶
func (b *Prioritize) GetPageContent(vals url.Values) ([]byte, error)
GetPageContent gets the html for a specific ogame page
func (*Prioritize) GetPlanet ¶
func (b *Prioritize) GetPlanet(v IntoPlanet) (Planet, error)
GetPlanet gets infos for planetID Fails if planetID is invalid
func (*Prioritize) GetPlanets ¶
func (b *Prioritize) GetPlanets() ([]Planet, error)
GetPlanets returns the user planets
func (*Prioritize) GetPositionsAvailableForDiscoveryFleet ¶
func (b *Prioritize) GetPositionsAvailableForDiscoveryFleet(galaxy int64, system int64, opts ...Option) ([]ogame.Coordinate, error)
GetPositionsAvailableForDiscoveryFleet ...
func (*Prioritize) GetProduction ¶
func (b *Prioritize) GetProduction(celestialID ogame.CelestialID) ([]ogame.Quantifiable, int64, error)
GetProduction get what is in the production queue. (ships & defense being built)
func (*Prioritize) GetResearch ¶
func (b *Prioritize) GetResearch() (ogame.Researches, error)
GetResearch gets the player researches information
func (*Prioritize) GetResourceSettings ¶
func (b *Prioritize) GetResourceSettings(planetID ogame.PlanetID, options ...Option) (ogame.ResourceSettings, error)
GetResourceSettings gets the resources settings for specified planetID
func (*Prioritize) GetResources ¶
func (b *Prioritize) GetResources(celestialID ogame.CelestialID) (ogame.Resources, error)
GetResources gets user resources
func (*Prioritize) GetResourcesBuildings ¶
func (b *Prioritize) GetResourcesBuildings(celestialID ogame.CelestialID, options ...Option) (ogame.ResourcesBuildings, error)
GetResourcesBuildings gets the resources buildings levels
func (*Prioritize) GetResourcesDetails ¶
func (b *Prioritize) GetResourcesDetails(celestialID ogame.CelestialID) (ogame.ResourcesDetails, error)
GetResourcesDetails gets user resources
func (*Prioritize) GetResourcesProductions ¶
GetResourcesProductions gets the planet resources production
func (*Prioritize) GetResourcesProductionsLight ¶
func (b *Prioritize) GetResourcesProductionsLight(resBuildings ogame.ResourcesBuildings, researches ogame.Researches, resSettings ogame.ResourceSettings, temp ogame.Temperature) ogame.Resources
GetResourcesProductionsLight gets the planet resources production
func (*Prioritize) GetShips ¶
func (b *Prioritize) GetShips(celestialID ogame.CelestialID, options ...Option) (ogame.ShipsInfos, error)
GetShips gets all ships units information of a planet
func (*Prioritize) GetSlots ¶
func (b *Prioritize) GetSlots() (ogame.Slots, error)
GetSlots gets the player current and total slots information
func (*Prioritize) GetTechs ¶
func (b *Prioritize) GetTechs(celestialID ogame.CelestialID) (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error)
GetTechs gets a celestial supplies/facilities/ships/researches
func (*Prioritize) GetUserInfos ¶
func (b *Prioritize) GetUserInfos() (ogame.UserInfos, error)
GetUserInfos gets the user information
func (*Prioritize) HeadersForPage ¶
func (b *Prioritize) HeadersForPage(url string) (http.Header, error)
HeadersForPage gets the headers for a specific ogame page
func (*Prioritize) Highscore ¶
func (b *Prioritize) Highscore(category, typ, page int64) (ogame.Highscore, error)
Highscore ...
func (*Prioritize) IsUnderAttack ¶
func (b *Prioritize) IsUnderAttack(opts ...Option) (bool, error)
IsUnderAttack returns true if the user is under attack, false otherwise
func (*Prioritize) JumpGate ¶
func (b *Prioritize) JumpGate(origin, dest ogame.MoonID, ships ogame.ShipsInfos) (bool, int64, error)
JumpGate sends ships through a jump gate.
func (*Prioritize) JumpGateDestinations ¶
JumpGateDestinations returns available destinations for jump gate.
func (*Prioritize) Login ¶
func (b *Prioritize) Login() error
Login to ogame server Can fail with BadCredentialsError
func (*Prioritize) LoginWithBearerToken ¶
func (b *Prioritize) LoginWithBearerToken(token string) (bool, error)
LoginWithBearerToken to ogame server reusing existing token Returns either or not the bot logged in using the existing cookies
func (*Prioritize) LoginWithExistingCookies ¶
func (b *Prioritize) LoginWithExistingCookies() (bool, error)
LoginWithExistingCookies to ogame server reusing existing cookies Returns either or not the bot logged in using the existing cookies
func (*Prioritize) OfferBuyMarketplace ¶
func (b *Prioritize) OfferBuyMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error
OfferBuyMarketplace ...
func (*Prioritize) OfferSellMarketplace ¶
func (b *Prioritize) OfferSellMarketplace(itemID any, quantity, priceType, price, priceRange int64, celestialID ogame.CelestialID) error
OfferSellMarketplace ...
func (*Prioritize) Phalanx ¶
func (b *Prioritize) Phalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
Phalanx scan a coordinate from a moon to get fleets information IMPORTANT: My account was instantly banned when I scanned an invalid coordinate. IMPORTANT: This function DOES validate that the coordinate is a valid planet in range of phalanx
and that you have enough deuterium.
func (*Prioritize) PostPageContent ¶
func (b *Prioritize) PostPageContent(vals, payload url.Values) ([]byte, error)
PostPageContent make a post request to ogame server This is useful when simulating a web browser
func (*Prioritize) RecruitOfficer ¶
func (b *Prioritize) RecruitOfficer(typ, days int64) error
RecruitOfficer recruit an officer. Typ 2: Commander, 3: Admiral, 4: Engineer, 5: Geologist, 6: Technocrat Days: 7 or 90
func (*Prioritize) SelectLfResearchArtifacts ¶
func (b *Prioritize) SelectLfResearchArtifacts(planetID ogame.PlanetID, slotNumber int64, techID ogame.ID) error
SelectLfResearchArtifacts select a lifeform research using artifacts
func (*Prioritize) SelectLfResearchRandom ¶
func (b *Prioritize) SelectLfResearchRandom(planetID ogame.PlanetID, slotNumber int64) error
SelectLfResearchRandom select a random lifeform research
func (*Prioritize) SelectLfResearchSelect ¶
func (b *Prioritize) SelectLfResearchSelect(planetID ogame.PlanetID, slotNumber int64) error
SelectLfResearchSelect select a lifeform research
func (*Prioritize) SendDiscoveryFleet ¶
func (b *Prioritize) SendDiscoveryFleet(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) error
SendDiscoveryFleet sends a discovery fleet
func (*Prioritize) SendDiscoveryFleet2 ¶
func (b *Prioritize) SendDiscoveryFleet2(celestialID ogame.CelestialID, coord ogame.Coordinate, options ...Option) (ogame.Fleet, error)
SendDiscoveryFleet2 sends a discovery fleet and get back the fleet
func (*Prioritize) SendFleet ¶
func (b *Prioritize) SendFleet(celestialID ogame.CelestialID, ships ogame.ShipsInfos, speed ogame.Speed, where ogame.Coordinate, mission ogame.MissionID, resources ogame.Resources, holdingTime, unionID int64) (ogame.Fleet, error)
SendFleet sends a fleet
func (*Prioritize) SendIPM ¶
func (b *Prioritize) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)
SendIPM sends IPM
func (*Prioritize) SendMessage ¶
func (b *Prioritize) SendMessage(playerID int64, message string) error
SendMessage sends a message to playerID
func (*Prioritize) SendMessageAlliance ¶
func (b *Prioritize) SendMessageAlliance(associationID int64, message string) error
SendMessageAlliance sends a message to associationID
func (*Prioritize) ServerTime ¶
func (b *Prioritize) ServerTime() (time.Time, error)
ServerTime returns server time Timezone is OGT (OGame Time zone)
func (*Prioritize) SetInitiator ¶
func (b *Prioritize) SetInitiator(initiator string) Prioritizable
SetInitiator ...
func (*Prioritize) SetPreferences ¶
func (b *Prioritize) SetPreferences(p ogame.Preferences) error
SetPreferences ...
func (*Prioritize) SetPreferencesLang ¶
func (b *Prioritize) SetPreferencesLang(lang string) error
SetPreferencesLang ...
func (*Prioritize) SetResourceSettings ¶
func (b *Prioritize) SetResourceSettings(planetID ogame.PlanetID, settings ogame.ResourceSettings) error
SetResourceSettings set the resources settings on a planet
func (*Prioritize) SetTaskDoneCh ¶
func (b *Prioritize) SetTaskDoneCh(ch chan struct{})
SetTaskDoneCh ...
func (*Prioritize) SetVacationMode ¶
func (b *Prioritize) SetVacationMode() error
SetVacationMode puts account in vacation mode
func (*Prioritize) TearDown ¶
func (b *Prioritize) TearDown(celestialID ogame.CelestialID, id ogame.ID) error
TearDown tears down any ogame building
func (*Prioritize) TechnologyDetails ¶
func (b *Prioritize) TechnologyDetails(celestialID ogame.CelestialID, id ogame.ID) (ogame.TechnologyDetails, error)
TechnologyDetails extract details from ajax window when clicking supplies/facilities/techs/lf...
func (*Prioritize) Tx ¶
func (b *Prioritize) Tx(clb func(Prioritizable) error) error
Tx locks the bot during the transaction and ensure the lock is released afterward
func (*Prioritize) TxNamed ¶
func (b *Prioritize) TxNamed(name string, clb func(Prioritizable) error) error
TxNamed locks the bot during the transaction and ensure the lock is released afterward
func (*Prioritize) UnsafePhalanx ¶
func (b *Prioritize) UnsafePhalanx(moonID ogame.MoonID, coord ogame.Coordinate) ([]ogame.PhalanxFleet, error)
UnsafePhalanx same as Phalanx but does not perform any input validation.
func (*Prioritize) UseDM ¶
func (b *Prioritize) UseDM(typ ogame.DMType, celestialID ogame.CelestialID) error
UseDM use dark matter to fast build
type ShipsInfos ¶
type ShipsInfos struct { ogame.ShipsInfos // contains filtered or unexported fields }
ShipsInfos ...
func NewShipsInfos ¶
func NewShipsInfos(w Wrapper, shipsInfos ogame.ShipsInfos) *ShipsInfos
NewShipsInfos ...
func (*ShipsInfos) Cargo ¶
func (s *ShipsInfos) Cargo(techs ogame.IResearches, lfBonuses ogame.LfBonuses, characterClass ogame.CharacterClass, multiplier float64, probeRaids bool) int64
func (*ShipsInfos) ToQuantifiables ¶
func (s *ShipsInfos) ToQuantifiables() []ogame.Quantifiable
type Wrapper ¶
type Wrapper interface { Prioritizable AddAccount(number int, lang string) (*gameforge.AddAccountRes, error) BytesDownloaded() int64 BytesUploaded() int64 CharacterClass() ogame.CharacterClass GetCachedAllianceClass() (ogame.AllianceClass, error) ConstructionTime(id ogame.ID, nbr int64, facilities ogame.Facilities) time.Duration CountColonies() (int64, int64) Disable() Distance(origin, destination ogame.Coordinate) int64 Enable() FleetDeutSaveFactor() float64 GetCachedCelestial(IntoCelestial) (Celestial, error) GetCachedCelestials() []Celestial GetCachedMoon(IntoMoon) (Moon, error) GetCachedMoons() []Moon GetCachedPlanet(IntoPlanet) (Planet, error) GetCachedPlanets() []Planet GetCachedPlayer() ogame.UserInfos GetCachedPreferences() ogame.Preferences GetClient() *httpclient.Client GetDevice() *device.Device GetExtractor() extractor.Extractor GetLanguage() string GetNbSystems() int64 GetPublicIP() (string, error) GetResearchSpeed() int64 GetServer() gameforge.Server GetServerData() gameforge.ServerData GetSession() string GetState() (bool, string) GetTasks() taskRunner.TasksOverview GetUniverseName() string GetUniverseSpeed() int64 GetUniverseSpeedFleet() int64 GetUsername() string IsConnected() bool IsDonutGalaxy() bool IsDonutSystem() bool IsEnabled() bool IsLocked() bool IsLoggedIn() bool IsPioneers() bool IsV7() bool IsV9() bool IsVacationModeEnabled() bool Location() *time.Location OnStateChange(clb func(locked bool, actor string)) Quiet(bool) ReconnectChat() bool RegisterAuctioneerCallback(func(any)) RegisterChatCallback(func(ogame.ChatMsg)) RegisterHTMLInterceptor(func(method, url string, params, payload url.Values, pageHTML []byte)) RegisterWSCallback(string, func([]byte)) RemoveWSCallback(string) ServerURL() string ServerVersion() string SetClient(*httpclient.Client) SetGetServerDataWrapper(func(func() (gameforge.ServerData, error)) (gameforge.ServerData, error)) SetLoginWrapper(func(func() (bool, error)) error) SetOGameCredentials(username, password, otpSecret, bearerToken string) SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool, config *tls.Config) error SystemDistance(system1, system2 int64) int64 ValidateAccount(code string) error WithPriority(priority taskRunner.Priority) Prioritizable }
Wrapper all available functions to control ogame bot