wrapper

package
v0.0.0-...-5ce5ac0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 57 Imported by: 0

Documentation

Index

Constants

View Source
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"
	ShareReportOverlayAjaxPageName = "shareReportOverlay"
	JumpgatelayerAjaxPageName      = "jumpgatelayer"
	FederationlayerAjaxPageName    = "federationlayer"
	UnionchangeAjaxPageName        = "unionchange"
	ChangenickAjaxPageName         = "changenick"
	PlanetlayerAjaxPageName        = "planetlayer"
	TraderlayerAjaxPageName        = "traderlayer"
	PlanetRenameAjaxPageName       = "planetRename"
	RightmenuAjaxPageName          = "rightmenu"
	AllianceOverviewAjaxPageName   = "allianceOverview"
	SupportAjaxPageName            = "support"
	BuffActivationAjaxPageName     = "buffActivation"
	AuctioneerAjaxPageName         = "auctioneer"
	HighscoreContentAjaxPageName   = "highscoreContent"
	LfResearchLayerPageName        = "lfresearchlayer"
	LfResearchResetLayerPageName   = "lfresearchresetlayer"
)

Page names

View Source
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

View Source
var DefaultGetServerDataWrapper = func(getServerDataFn func() (gameforge.ServerData, error)) (gameforge.ServerData, error) {
	return getServerDataFn()
}

DefaultGetServerDataWrapper ...

View Source
var DefaultLoginWrapper = func(loginFn func() (bool, error)) error {
	_, err := loginFn()
	return err
}

DefaultLoginWrapper ...

View Source
var ErrBuild = errors.New("failed to build")
View Source
var ErrIntoCelestial = errors.New("unable to find celestial")
View Source
var ErrInvalidOrigin = errors.New("invalid origin")

Functions

func ActivateCelestialItemHandler

func ActivateCelestialItemHandler(c echo.Context) error

ActivateCelestialItemHandler ...

func BuildBuildingHandler

func BuildBuildingHandler(c echo.Context) error

BuildBuildingHandler ...

func BuildCancelableHandler

func BuildCancelableHandler(c echo.Context) error

BuildCancelableHandler ...

func BuildDefenseHandler

func BuildDefenseHandler(c echo.Context) error

BuildDefenseHandler ...

func BuildHandler

func BuildHandler(c echo.Context) error

BuildHandler ...

func BuildProductionHandler

func BuildProductionHandler(c echo.Context) error

BuildProductionHandler ...

func BuildShipsHandler

func BuildShipsHandler(c echo.Context) error

BuildShipsHandler ...

func BuildTechnologyHandler

func BuildTechnologyHandler(c echo.Context) error

BuildTechnologyHandler ...

func BuyOfferOfTheDayHandler

func BuyOfferOfTheDayHandler(c echo.Context) error

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

func CancelBuildingHandler(c echo.Context) error

CancelBuildingHandler ...

func CancelFleetHandler

func CancelFleetHandler(c echo.Context) error

CancelFleetHandler ...

func CancelResearchHandler

func CancelResearchHandler(c echo.Context) error

CancelResearchHandler ...

func CelestialAbandonHandler

func CelestialAbandonHandler(c echo.Context) error

CelestialAbandonHandler ...

func ConstructionsBeingBuiltHandler

func ConstructionsBeingBuiltHandler(c echo.Context) error

ConstructionsBeingBuiltHandler ...

func ConvertIntoCoordinate

func ConvertIntoCoordinate(w Wrapper, v IntoCoordinate) (ogame.Coordinate, error)

ConvertIntoCoordinate helper that turns any type into a coordinate

func DebugGalaxy

func DebugGalaxy(opt *Options)

DebugGalaxy option to debug galaxy

func DeleteEspionageMessagesHandler

func DeleteEspionageMessagesHandler(c echo.Context) error

DeleteEspionageMessagesHandler ...

func DeleteMessageHandler

func DeleteMessageHandler(c echo.Context) error

DeleteMessageHandler ...

func DeleteMessagesFromTabHandler

func DeleteMessagesFromTabHandler(c echo.Context) error

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

func DoAuctionHandler(c echo.Context) error

DoAuctionHandler (`celestialID=metal:crystal:deuterium` eg: `123456=123:456:789`)

func GalaxyInfosHandler

func GalaxyInfosHandler(c echo.Context) error

GalaxyInfosHandler ...

func GetAlliancePageContentHandler

func GetAlliancePageContentHandler(c echo.Context) error

GetAlliancePageContentHandler ...

func GetAttacksHandler

func GetAttacksHandler(c echo.Context) error

GetAttacksHandler ...

func GetAuctionHandler

func GetAuctionHandler(c echo.Context) error

GetAuctionHandler ...

func GetCaptchaChallengeHandler

func GetCaptchaChallengeHandler(c echo.Context) error

GetCaptchaChallengeHandler ...

func GetCaptchaHandler

func GetCaptchaHandler(c echo.Context) error

GetCaptchaHandler ...

func GetCaptchaSolverHandler

func GetCaptchaSolverHandler(c echo.Context) error

GetCaptchaSolverHandler ...

func GetCelestialItemsHandler

func GetCelestialItemsHandler(c echo.Context) error

GetCelestialItemsHandler ...

func GetCharacterClassHandler

func GetCharacterClassHandler(c echo.Context) error

GetCharacterClassHandler ...

func GetClientWithProxy

func GetClientWithProxy(proxyAddr, proxyUsername, proxyPassword, proxyType string, config *tls.Config) (*http.Client, error)

GetClientWithProxy ...

func GetDefenseHandler

func GetDefenseHandler(c echo.Context) error

GetDefenseHandler ...

func GetEmpireHandler

func GetEmpireHandler(c echo.Context) error

GetEmpireHandler ...

func GetEspionageReportForHandler

func GetEspionageReportForHandler(c echo.Context) error

GetEspionageReportForHandler ...

func GetEspionageReportHandler

func GetEspionageReportHandler(c echo.Context) error

GetEspionageReportHandler ...

func GetEspionageReportMessagesHandler

func GetEspionageReportMessagesHandler(c echo.Context) error

GetEspionageReportMessagesHandler ...

func GetFacilitiesHandler

func GetFacilitiesHandler(c echo.Context) error

GetFacilitiesHandler ...

func GetFleetSpeedForMission

func GetFleetSpeedForMission(serverData gameforge.ServerData, missionID ogame.MissionID) int64

GetFleetSpeedForMission ...

func GetFleetsHandler

func GetFleetsHandler(c echo.Context) error

GetFleetsHandler ...

func GetFromGameHandler

func GetFromGameHandler(c echo.Context) error

GetFromGameHandler ...

func GetLanguageHandler

func GetLanguageHandler(c echo.Context) error

GetLanguageHandler ...

func GetLfBuildingsHandler

func GetLfBuildingsHandler(c echo.Context) error

GetLfBuildingsHandler ...

func GetLfResearchHandler

func GetLfResearchHandler(c echo.Context) error

GetLfResearchHandler ...

func GetMoonByCoordHandler

func GetMoonByCoordHandler(c echo.Context) error

GetMoonByCoordHandler ...

func GetMoonHandler

func GetMoonHandler(c echo.Context) error

GetMoonHandler ...

func GetMoonsHandler

func GetMoonsHandler(c echo.Context) error

GetMoonsHandler ...

func GetPlanetByCoordHandler

func GetPlanetByCoordHandler(c echo.Context) error

GetPlanetByCoordHandler ...

func GetPlanetHandler

func GetPlanetHandler(c echo.Context) error

GetPlanetHandler ...

func GetPlanetsHandler

func GetPlanetsHandler(c echo.Context) error

GetPlanetsHandler ...

func GetPriceHandler

func GetPriceHandler(c echo.Context) error

GetPriceHandler ...

func GetProductionHandler

func GetProductionHandler(c echo.Context) error

GetProductionHandler ...

func GetPublicIPHandler

func GetPublicIPHandler(c echo.Context) error

GetPublicIPHandler ...

func GetRequirementsHandler

func GetRequirementsHandler(c echo.Context) error

GetRequirementsHandler ...

func GetResearchHandler

func GetResearchHandler(c echo.Context) error

GetResearchHandler ...

func GetResourceSettingsHandler

func GetResourceSettingsHandler(c echo.Context) error

GetResourceSettingsHandler ...

func GetResourcesBuildingsHandler

func GetResourcesBuildingsHandler(c echo.Context) error

GetResourcesBuildingsHandler ...

func GetResourcesDetailsHandler

func GetResourcesDetailsHandler(c echo.Context) error

GetResourcesDetailsHandler ...

func GetResourcesHandler

func GetResourcesHandler(c echo.Context) error

GetResourcesHandler ...

func GetServerDataHandler

func GetServerDataHandler(c echo.Context) error

GetServerDataHandler ...

func GetServerHandler

func GetServerHandler(c echo.Context) error

GetServerHandler ...

func GetShipsHandler

func GetShipsHandler(c echo.Context) error

GetShipsHandler ...

func GetSlotsHandler

func GetSlotsHandler(c echo.Context) error

GetSlotsHandler ...

func GetStaticHEADHandler

func GetStaticHEADHandler(c echo.Context) error

GetStaticHEADHandler ...

func GetStaticHandler

func GetStaticHandler(c echo.Context) error

GetStaticHandler ...

func GetUniverseNameHandler

func GetUniverseNameHandler(c echo.Context) error

GetUniverseNameHandler ...

func GetUniverseSpeedFleetHandler

func GetUniverseSpeedFleetHandler(c echo.Context) error

GetUniverseSpeedFleetHandler ...

func GetUniverseSpeedHandler

func GetUniverseSpeedHandler(c echo.Context) error

GetUniverseSpeedHandler ...

func GetUserInfosHandler

func GetUserInfosHandler(c echo.Context) error

GetUserInfosHandler ...

func GetUsernameHandler

func GetUsernameHandler(c echo.Context) error

GetUsernameHandler ...

func HasAdmiralHandler

func HasAdmiralHandler(c echo.Context) error

HasAdmiralHandler ...

func HasCommanderHandler

func HasCommanderHandler(c echo.Context) error

HasCommanderHandler ...

func HasEngineerHandler

func HasEngineerHandler(c echo.Context) error

HasEngineerHandler ...

func HasGeologistHandler

func HasGeologistHandler(c echo.Context) error

HasGeologistHandler ...

func HasTechnocratHandler

func HasTechnocratHandler(c echo.Context) error

HasTechnocratHandler ...

func HomeHandler

func HomeHandler(c echo.Context) error

HomeHandler ...

func IsAjaxPage

func IsAjaxPage(vals url.Values) bool

IsAjaxPage either the requested page is a partial/ajax page

func IsEmpirePage

func IsEmpirePage(vals url.Values) bool

func IsKnowFullPage

func IsKnowFullPage(vals url.Values) bool

IsKnowFullPage ...

func IsUnderAttackByIDHandler

func IsUnderAttackByIDHandler(c echo.Context) error

func IsUnderAttackHandler

func IsUnderAttackHandler(c echo.Context) error

IsUnderAttackHandler ...

func IsVacationModeHandler

func IsVacationModeHandler(c echo.Context) error

IsVacationModeHandler ...

func JumpGateHandler

func JumpGateHandler(c echo.Context) error

JumpGateHandler ...

func LoginHandler

func LoginHandler(c echo.Context) error

LoginHandler ...

func LogoutHandler

func LogoutHandler(c echo.Context) error

LogoutHandler ...

func PageContentHandler

func PageContentHandler(c echo.Context) error

PageContentHandler ... curl 127.0.0.1:1234/bot/page-content -d 'page=overview&cp=123'

func PhalanxHandler

func PhalanxHandler(c echo.Context) error

PhalanxHandler ...

func PostToGameHandler

func PostToGameHandler(c echo.Context) error

PostToGameHandler ...

func SendDiscoveryHandler

func SendDiscoveryHandler(c echo.Context) error

SendDiscoveryHandler ... curl 127.0.0.1:1234/bot/planets/123/send-discovery -d 'galaxy=1&system=1&type=1&position=1'

func SendFleetHandler

func SendFleetHandler(c echo.Context) error

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 SendIPMHandler

func SendIPMHandler(c echo.Context) error

SendIPMHandler ...

func SendMessageHandler

func SendMessageHandler(c echo.Context) error

SendMessageHandler ... curl 127.0.0.1:1234/bot/send-message -d 'playerID=123&message="Sup boi!"'

func ServerTimeHandler

func ServerTimeHandler(c echo.Context) error

ServerTimeHandler ...

func ServerURLHandler

func ServerURLHandler(c echo.Context) error

ServerURLHandler ...

func ServerVersionHandler

func ServerVersionHandler(c echo.Context) error

ServerVersionHandler ...

func SetResourceSettingsHandler

func SetResourceSettingsHandler(c echo.Context) error

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

func SetUserAgentHandler(c echo.Context) error

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 SkipRetry

func SkipRetry(opt *Options)

SkipRetry option to skip retry

func TasksHandler

func TasksHandler(c echo.Context) error

TasksHandler return how many tasks are queued in the heap.

func TeardownHandler

func TeardownHandler(c echo.Context) error

TeardownHandler ...

func TechsHandler

func TechsHandler(c echo.Context) error

TechsHandler ...

Types

type APIResp

type APIResp struct {
	Status  string
	Code    int
	Message string
	Result  any
}

APIResp ...

func ErrorResp

func ErrorResp(code int, message string) APIResp

ErrorResp ...

func SuccessResp

func SuccessResp(data any) APIResp

SuccessResp ...

type CaptchaChallenge

type CaptchaChallenge struct {
	ID       string
	Question string
	Icons    string
}

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 NewFleetBuilder

func NewFleetBuilder(b Wrapper) *FleetBuilder

NewFleetBuilder ...

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) SetTx

func (f *FleetBuilder) SetTx(tx Prioritizable) *FleetBuilder

SetTx ...

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 IShipsInfos interface {
	ByID(id ogame.ID) int64
	Cargo(techs ogame.IResearches, lfBonuses ogame.LfBonuses, characterClass ogame.CharacterClass, multiplier float64, probeRaids bool) int64
	Set(ogame.ID, int64)
	ToQuantifiables() []ogame.Quantifiable
}

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 IntoMoon

type IntoMoon any

IntoMoon any types that can be turned into a Moon

type IntoPlanet

type IntoPlanet any

IntoPlanet any types that can be turned into a Planet

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

type Moon struct {
	ogame.Moon
	// contains filtered or unexported fields
}

Moon ogame moon object

func ConvertIntoMoon

func ConvertIntoMoon(w Wrapper, v IntoMoon) (Moon, error)

ConvertIntoMoon helper that turns any type into a Moon

func (Moon) ActivateItem

func (m Moon) ActivateItem(ref string) error

ActivateItem activate an item

func (Moon) Build

func (m Moon) Build(id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (Moon) BuildBuilding

func (m Moon) BuildBuilding(buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (Moon) BuildDefense

func (m Moon) BuildDefense(defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (Moon) BuildTechnology

func (m Moon) BuildTechnology(technologyID ogame.ID) error

BuildTechnology ensure that we're trying to build a technology

func (Moon) CancelBuilding

func (m Moon) CancelBuilding() error

CancelBuilding cancel the construction of a building

func (Moon) CancelLfBuilding

func (m Moon) CancelLfBuilding() error

CancelLfBuilding cancel the construction of a lifeform building

func (Moon) CancelResearch

func (m Moon) CancelResearch() error

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) GetItems

func (m Moon) GetItems() ([]ogame.Item, error)

GetItems get all items information

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

func (m Moon) GetResources() (ogame.Resources, error)

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

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

func (Moon) SendFleet

func (m Moon) 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

func (Moon) TearDown

func (m Moon) TearDown(buildingID ogame.ID) error

TearDown tears down any ogame building

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 New

func New(deviceInst *device.Device, universe, username, password, lang string) (*OGame, error)

New creates a new instance of OGame wrapper.

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

func NewWithParams(params Params) (*OGame, error)

NewWithParams create a new OGame instance with full control over the possible parameters

func (*OGame) Abandon

func (b *OGame) Abandon(v IntoPlanet) error

Abandon a planet

func (*OGame) ActivateItem

func (b *OGame) ActivateItem(ref string, celestialID ogame.CelestialID) error

ActivateItem activate an item

func (*OGame) AddAccount

func (b *OGame) AddAccount(number int, lang string) (*gameforge.AddAccountRes, error)

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) Build

func (b *OGame) Build(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (*OGame) BuildBuilding

func (b *OGame) BuildBuilding(celestialID ogame.CelestialID, buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (*OGame) BuildCancelable

func (b *OGame) BuildCancelable(celestialID ogame.CelestialID, id ogame.ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (*OGame) BuildDefense

func (b *OGame) BuildDefense(celestialID ogame.CelestialID, defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (*OGame) BuildProduction

func (b *OGame) BuildProduction(celestialID ogame.CelestialID, id ogame.ID, nbr int64) error

BuildProduction builds any line production ogame objects (ship, defence)

func (*OGame) BuildShips

func (b *OGame) BuildShips(celestialID ogame.CelestialID, shipID ogame.ID, nbr int64) error

BuildShips builds a ship unit

func (*OGame) BuildTechnology

func (b *OGame) BuildTechnology(celestialID ogame.CelestialID, technologyID ogame.ID) error

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

func (b *OGame) BuyOfferOfTheDay() error

BuyOfferOfTheDay buys the offer of the day.

func (*OGame) BuyResetTree

func (b *OGame) BuyResetTree(planetID ogame.PlanetID, tier int64) error

BuyResetTree reset a lifeform research tier tree using darkmatter

func (*OGame) BytesDownloaded

func (b *OGame) BytesDownloaded() int64

BytesDownloaded returns the amount of bytes downloaded

func (*OGame) BytesUploaded

func (b *OGame) BytesUploaded() int64

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

func (b *OGame) CancelFleet(fleetID ogame.FleetID) error

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

func (b *OGame) CollectAllMarketplaceMessages() error

CollectAllMarketplaceMessages collect all marketplace messages

func (*OGame) CollectMarketplaceMessage

func (b *OGame) CollectMarketplaceMessage(msg ogame.MarketplaceMessage) error

CollectMarketplaceMessage collect marketplace message

func (*OGame) ConstructionTime

func (b *OGame) ConstructionTime(id ogame.ID, nbr int64, facilities ogame.Facilities) time.Duration

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

func (b *OGame) CountColonies() (int64, int64)

CountColonies returns colonies count/possible

func (*OGame) CreateUnion

func (b *OGame) CreateUnion(fleet ogame.Fleet, users []string) (int64, error)

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

func (b *OGame) DeleteMessage(msgID int64) error

DeleteMessage deletes a message from the mail box

func (*OGame) DestroyRockets

func (b *OGame) DestroyRockets(planetID ogame.PlanetID, abm, ipm int64) error

DestroyRockets destroys anti-ballistic & inter-planetary missiles

func (*OGame) Disable

func (b *OGame) Disable()

Disable disables communications with OGame Server

func (*OGame) Distance

func (b *OGame) Distance(origin, destination ogame.Coordinate) int64

Distance return distance between two coordinates

func (*OGame) DoAuction

func (b *OGame) DoAuction(bid map[ogame.CelestialID]ogame.Resources) error

DoAuction ...

func (*OGame) Done

func (b *OGame) Done()

Done ...

func (*OGame) Enable

func (b *OGame) Enable()

Enable enables communications with OGame Server

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

func (b *OGame) FleetDeutSaveFactor() float64

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

func (b *OGame) FreeResetTree(planetID ogame.PlanetID, tier int64) error

FreeResetTree reset a lifeform research tier tree

func (*OGame) GalaxyInfos

func (b *OGame) GalaxyInfos(galaxy, system int64, options ...Option) (ogame.SystemInfos, error)

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

func (b *OGame) GetAllResources() (map[ogame.CelestialID]ogame.Resources, error)

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) GetAuction

func (b *OGame) GetAuction() (ogame.Auction, error)

GetAuction ...

func (*OGame) GetAvailableDiscoveries

func (b *OGame) GetAvailableDiscoveries(opts ...Option) int64

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

func (b *OGame) GetCachedCelestials() []Celestial

GetCachedCelestials get all cached celestials

func (*OGame) GetCachedLfBonuses

func (b *OGame) GetCachedLfBonuses() (ogame.LfBonuses, error)

GetCachedLfBonuses returns cached lifeform bonuses

func (*OGame) GetCachedMoon

func (b *OGame) GetCachedMoon(v IntoMoon) (Moon, error)

GetCachedMoon return moon from cached value

func (*OGame) GetCachedMoons

func (b *OGame) GetCachedMoons() []Moon

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

func (b *OGame) GetCachedPlanets() []Planet

GetCachedPlanets return planets from cached value

func (*OGame) GetCachedPlayer

func (b *OGame) GetCachedPlayer() ogame.UserInfos

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

func (b *OGame) GetCelestials() ([]Celestial, error)

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

func (b *OGame) GetDMCosts(celestialID ogame.CelestialID) (ogame.DMCosts, error)

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) GetDevice

func (b *OGame) GetDevice() *device.Device

GetDevice get the device used by the bot

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

func (b *OGame) GetExpeditionMessageAt(t time.Time) (ogame.ExpeditionMessage, error)

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

func (b *OGame) GetExtractor() extractor.Extractor

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) GetFleets

func (b *OGame) GetFleets(opts ...Option) ([]ogame.Fleet, ogame.Slots)

GetFleets get the player's own fleets activities

func (*OGame) GetFleetsFromEventList

func (b *OGame) GetFleetsFromEventList() []ogame.Fleet

GetFleetsFromEventList get the player's own fleets activities

func (*OGame) GetItems

func (b *OGame) GetItems(celestialID ogame.CelestialID) ([]ogame.Item, error)

GetItems get all items information

func (*OGame) GetLanguage

func (b *OGame) GetLanguage() string

GetLanguage get ogame server language

func (*OGame) GetLfBonuses

func (b *OGame) GetLfBonuses() (ogame.LfBonuses, error)

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) GetMoon

func (b *OGame) GetMoon(v IntoMoon) (Moon, error)

GetMoon gets infos for moonID

func (*OGame) GetMoons

func (b *OGame) GetMoons() ([]Moon, error)

GetMoons returns the user moons

func (*OGame) GetNbSystems

func (b *OGame) GetNbSystems() int64

GetNbSystems gets the number of systems

func (*OGame) GetPageContent

func (b *OGame) GetPageContent(vals url.Values) ([]byte, error)

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

func (b *OGame) GetPlanets() ([]Planet, error)

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

func (b *OGame) GetPublicIP() (string, error)

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

func (b *OGame) GetResearchSpeed() int64

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

func (b *OGame) GetResources(celestialID ogame.CelestialID) (ogame.Resources, error)

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

func (b *OGame) GetResourcesProductions(planetID ogame.PlanetID) (ogame.Resources, error)

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) GetServer

func (b *OGame) GetServer() gameforge.Server

GetServer get ogame server information that the bot is connected to

func (*OGame) GetServerData

func (b *OGame) GetServerData() gameforge.ServerData

GetServerData get ogame server data information that the bot is connected to

func (*OGame) GetSession

func (b *OGame) GetSession() string

GetSession get ogame session

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) GetSlots

func (b *OGame) GetSlots() (ogame.Slots, error)

GetSlots gets the player current and total slots information

func (*OGame) GetState

func (b *OGame) GetState() (bool, string)

GetState returns the current bot state

func (*OGame) GetTasks

func (b *OGame) GetTasks() taskRunner.TasksOverview

GetTasks return how many tasks are queued in the heap.

func (*OGame) GetTechs

GetTechs gets a celestial supplies/facilities/ships/researches

func (*OGame) GetUniverseName

func (b *OGame) GetUniverseName() string

GetUniverseName get the name of the universe the bot is playing into

func (*OGame) GetUniverseSpeed

func (b *OGame) GetUniverseSpeed() int64

GetUniverseSpeed shortcut to get ogame universe speed

func (*OGame) GetUniverseSpeedFleet

func (b *OGame) GetUniverseSpeedFleet() int64

GetUniverseSpeedFleet shortcut to get ogame universe speed fleet

func (*OGame) GetUserInfos

func (b *OGame) GetUserInfos() (ogame.UserInfos, error)

GetUserInfos gets the user information

func (*OGame) GetUsername

func (b *OGame) GetUsername() string

GetUsername get the username that was used to login on ogame server

func (*OGame) HeadersForPage

func (b *OGame) HeadersForPage(url string) (http.Header, error)

HeadersForPage gets the headers for a specific ogame page

func (*OGame) Highscore

func (b *OGame) Highscore(category, typ, page int64) (ogame.Highscore, error)

Highscore ...

func (*OGame) IsConnected

func (b *OGame) IsConnected() bool

IsConnected returns true if the bot is currently connected (communication between the bot and OGame is possible), otherwise false

func (*OGame) IsDonutGalaxy

func (b *OGame) IsDonutGalaxy() bool

IsDonutGalaxy shortcut to get ogame galaxy donut config

func (*OGame) IsDonutSystem

func (b *OGame) IsDonutSystem() bool

IsDonutSystem shortcut to get ogame system donut config

func (*OGame) IsEnabled

func (b *OGame) IsEnabled() bool

IsEnabled returns true if the bot is enabled, otherwise false

func (*OGame) IsLocked

func (b *OGame) IsLocked() bool

IsLocked returns either or not the bot is currently locked

func (*OGame) IsLoggedIn

func (b *OGame) IsLoggedIn() bool

IsLoggedIn returns true if the bot is currently logged-in, otherwise false

func (*OGame) IsPioneers

func (b *OGame) IsPioneers() bool

IsPioneers either or not the bot use lobby-pioneers

func (*OGame) IsUnderAttack

func (b *OGame) IsUnderAttack(opts ...Option) (bool, error)

IsUnderAttack returns true if the user is under attack, false otherwise

func (*OGame) IsV10

func (b *OGame) IsV10() bool

IsV10 ...

func (*OGame) IsV104

func (b *OGame) IsV104() bool

IsV104 ...

func (*OGame) IsV11

func (b *OGame) IsV11() bool

IsV11 ...

func (*OGame) IsV7

func (b *OGame) IsV7() bool

IsV7 ...

func (*OGame) IsV8

func (b *OGame) IsV8() bool

IsV8 ...

func (*OGame) IsV9

func (b *OGame) IsV9() bool

IsV9 ...

func (*OGame) IsVGreaterThanOrEqual

func (b *OGame) IsVGreaterThanOrEqual(compareVersion string) bool

IsVGreaterThanOrEqual ...

func (*OGame) IsVacationModeEnabled

func (b *OGame) IsVacationModeEnabled() bool

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) Location

func (b *OGame) Location() *time.Location

Location returns bot Time zone.

func (*OGame) Login

func (b *OGame) Login() error

Login to ogame server Can fails with BadCredentialsError

func (*OGame) LoginWithBearerToken

func (b *OGame) LoginWithBearerToken(token string) (bool, error)

LoginWithBearerToken to ogame server reusing existing token

func (*OGame) LoginWithExistingCookies

func (b *OGame) LoginWithExistingCookies() (bool, error)

LoginWithExistingCookies to ogame server reusing existing cookies

func (*OGame) Logout

func (b *OGame) Logout()

Logout the bot from ogame server

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

func (b *OGame) OnStateChange(clb func(locked bool, actor string))

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

func (b *OGame) PostPageContent(vals, payload url.Values) ([]byte, error)

PostPageContent make a post request to ogame server This is useful when simulating a web browser

func (*OGame) Quiet

func (b *OGame) Quiet(quiet bool)

Quiet mode will not show any informative output

func (*OGame) ReconnectChat

func (b *OGame) ReconnectChat() bool

ReconnectChat ...

func (*OGame) RecruitOfficer

func (b *OGame) 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 (*OGame) RegisterAuctioneerCallback

func (b *OGame) RegisterAuctioneerCallback(fn func(packet any))

RegisterAuctioneerCallback register a callback that is called when auctioneer packets are received

func (*OGame) RegisterChatCallback

func (b *OGame) RegisterChatCallback(fn func(msg ogame.ChatMsg))

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

func (b *OGame) RegisterWSCallback(id string, fn func(msg []byte))

RegisterWSCallback ...

func (*OGame) RemoveWSCallback

func (b *OGame) RemoveWSCallback(id string)

RemoveWSCallback ...

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

func (b *OGame) SelectLfResearchRandom(planetID ogame.PlanetID, slotNumber int64) error

SelectLfResearchRandom select a random lifeform research

func (*OGame) SelectLfResearchSelect

func (b *OGame) SelectLfResearchSelect(planetID ogame.PlanetID, slotNumber int64) error

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

func (b *OGame) SendMessage(playerID int64, message string) error

SendMessage sends a message to playerID

func (*OGame) SendMessageAlliance

func (b *OGame) SendMessageAlliance(associationID int64, message string) error

SendMessageAlliance sends a message to associationID

func (*OGame) ServerTime

func (b *OGame) ServerTime() (time.Time, error)

ServerTime returns server time Timezone is OGT (OGame Time zone)

func (*OGame) ServerURL

func (b *OGame) ServerURL() string

ServerURL get the ogame server specific url

func (*OGame) ServerVersion

func (b *OGame) ServerVersion() string

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) SetLogger

func (b *OGame) SetLogger(logger *log.Logger)

SetLogger set a custom logger for the bot

func (*OGame) SetLoginWrapper

func (b *OGame) SetLoginWrapper(newWrapper func(func() (bool, error)) error)

SetLoginWrapper ...

func (*OGame) SetOGameCredentials

func (b *OGame) SetOGameCredentials(username, password, otpSecret, bearerToken string)

SetOGameCredentials sets ogame credentials for the bot

func (*OGame) SetPreferences

func (b *OGame) SetPreferences(p ogame.Preferences) error

SetPreferences ...

func (*OGame) SetPreferencesLang

func (b *OGame) SetPreferencesLang(lang string) error

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

func (b *OGame) SetResourceSettings(planetID ogame.PlanetID, settings ogame.ResourceSettings) error

SetResourceSettings set the resources settings on a planet

func (*OGame) SetVacationMode

func (b *OGame) SetVacationMode() error

SetVacationMode puts account in vacation mode

func (*OGame) SystemDistance

func (b *OGame) SystemDistance(system1, system2 int64) int64

SystemDistance return the distance between two systems

func (*OGame) TearDown

func (b *OGame) TearDown(celestialID ogame.CelestialID, id ogame.ID) error

TearDown tears down any ogame building

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) UseDM

func (b *OGame) UseDM(typ ogame.DMType, celestialID ogame.CelestialID) error

UseDM use dark matter to fast build

func (*OGame) ValidateAccount

func (b *OGame) ValidateAccount(code string) error

ValidateAccount validate a gameforge account

func (*OGame) WithPriority

func (b *OGame) WithPriority(priority taskRunner.Priority) Prioritizable

WithPriority ...

type OGameError

type OGameError struct {
	Message string `json:"message"`
	Error   int    `json:"error"`
}

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

func Delay

func Delay(dur time.Duration) Option

Delay delays a page load; simulating slow request/response from ogame server

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

type Planet struct {
	ogame.Planet

	Moon *Moon
	// contains filtered or unexported fields
}

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

func (p Planet) ActivateItem(ref string) error

ActivateItem activate an item

func (Planet) Build

func (p Planet) Build(id ogame.ID, nbr int64) error

Build builds any ogame objects (building, technology, ship, defence)

func (Planet) BuildBuilding

func (p Planet) BuildBuilding(buildingID ogame.ID) error

BuildBuilding ensure what is being built is a building

func (Planet) BuildCancelable

func (p Planet) BuildCancelable(id ogame.ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (Planet) BuildDefense

func (p Planet) BuildDefense(defenseID ogame.ID, nbr int64) error

BuildDefense builds a defense unit

func (Planet) BuildShips

func (p Planet) BuildShips(shipID ogame.ID, nbr int64) error

BuildShips builds a ship unit

func (Planet) BuildTechnology

func (p Planet) BuildTechnology(technologyID ogame.ID) error

BuildTechnology ensure that we're trying to build a technology

func (Planet) CancelBuilding

func (p Planet) CancelBuilding() error

CancelBuilding cancel the construction of a building

func (Planet) CancelLfBuilding

func (p Planet) CancelLfBuilding() error

CancelLfBuilding cancel the construction of a lifeform building

func (Planet) CancelResearch

func (p Planet) CancelResearch() error

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) GetItems

func (p Planet) GetItems() ([]ogame.Item, error)

GetItems get all items 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) GetMoon

func (p Planet) GetMoon() *Moon

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

func (p Planet) GetResources() (ogame.Resources, error)

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

func (p Planet) GetResourcesProductions() (ogame.Resources, error)

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

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

func (Planet) SendIPM

func (p Planet) SendIPM(planetID ogame.PlanetID, coord ogame.Coordinate, nbr int64, priority ogame.ID) (int64, error)

SendIPM send interplanetary missiles

func (Planet) String

func (p Planet) String() string

String ..

func (Planet) TearDown

func (p Planet) TearDown(buildingID ogame.ID) error

TearDown tears down any ogame building

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

func (b *Prioritize) CreateUnion(fleet ogame.Fleet, users []string) (int64, error)

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) GetFleets

func (b *Prioritize) GetFleets(opts ...Option) ([]ogame.Fleet, ogame.Slots)

GetFleets get the player's own fleets activities

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

func (b *Prioritize) GetResourcesProductions(planetID ogame.PlanetID) (ogame.Resources, error)

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

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

func (b *Prioritize) JumpGateDestinations(origin ogame.MoonID) ([]ogame.MoonID, int64, error)

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) Logout

func (b *Prioritize) Logout()

Logout the bot from ogame server

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) ByID

func (s *ShipsInfos) ByID(id ogame.ID) int64

func (*ShipsInfos) Cargo

func (s *ShipsInfos) Cargo(techs ogame.IResearches, lfBonuses ogame.LfBonuses, characterClass ogame.CharacterClass, multiplier float64, probeRaids bool) int64

func (*ShipsInfos) GetCargo

func (s *ShipsInfos) GetCargo() (out int64)

GetCargo ...

func (*ShipsInfos) Set

func (s *ShipsInfos) Set(id ogame.ID, nbr int64)

func (*ShipsInfos) Speed

func (s *ShipsInfos) Speed() (out int64)

Speed ...

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL