ogame

package module
v0.0.0-...-b456618 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 48 Imported by: 1

README

Build Status codecov discord

OGame automation toolkit


Discord: https://discord.gg/4dZtZpz


ogame library

Verify attack example
package main

import "fmt"
import "os"
import "github.com/0xE232FE/ogame"

func main() {
	universe := os.Getenv("UNIVERSE") // eg: Bellatrix
	username := os.Getenv("USERNAME") // eg: email@gmail.com
	password := os.Getenv("PASSWORD") // eg: *****
	language := os.Getenv("LANGUAGE") // eg: en
	bot, err := ogame.New(universe, username, password, language)
	if err != nil {
		panic(err)
	}
	attacked, _ := bot.IsUnderAttack()
	fmt.Println(attacked) // False
}
How to get started
  • Ensure you have go 1.12 or above go version
  • Copy and paste the above example in a file main.go
  • Create your own module go mod init my_project
  • Install dependencies go mod vendor
  • Run the code go run main.go
Available methods
IsV7() bool
GetExtractor() Extractor
SetOGameCredentials(username, password, otpSecret string)
SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool) error
SetLoginWrapper(func(func() error) error)
GetClient() *OGameClient
Enable()
Disable()
IsEnabled() bool
Quiet(bool)
GetTasks() TasksOverview
Tx(clb func(tx *Prioritize) error) error
Begin() *Prioritize
BeginNamed(name string) *Prioritize
WithPriority(priority int) *Prioritize
GetPublicIP() (string, error)
OnStateChange(clb func(locked bool, actor string))
GetState() (bool, string)
IsLocked() bool
GetSession() string
AddAccount(number int, lang string) (NewAccount, error)
GetServer() Server
GetServerData() ServerData
SetUserAgent(newUserAgent string)
ServerURL() string
GetLanguage() string
GetPageContent(url.Values) ([]byte, error)
GetAlliancePageContent(url.Values) ([]byte, error)
PostPageContent(url.Values, url.Values) ([]byte, error)
LoginWithExistingCookies() (bool, error)
Login() error
Logout()
IsLoggedIn() bool
IsConnected() bool
GetUsername() string
GetUniverseName() string
GetUniverseSpeed() int64
GetUniverseSpeedFleet() int64
GetResearchSpeed() int64
GetNbSystems() int64
IsDonutGalaxy() bool
IsDonutSystem() bool
FleetDeutSaveFactor() float64
ServerVersion() string
ServerTime() time.Time
Location() *time.Location
IsUnderAttack() (bool, error)
GetUserInfos() UserInfos
SendMessage(playerID int64, message string) error
SendMessageAlliance(associationID int64, message string) error
ReconnectChat() bool
GetFleets(...Option) ([]Fleet, Slots)
GetFleetsFromEventList() []Fleet
CancelFleet(FleetID) error
GetAttacks() ([]AttackEvent, error)
GalaxyInfos(galaxy, system int64, opts ...Option) (SystemInfos, error)
GetCachedResearch() Researches
GetResearch() Researches
GetCachedPlanets() []Planet
GetCachedMoons() []Moon
GetCachedCelestials() []Celestial
GetCachedCelestial(interface{}) Celestial
GetCachedPlayer() UserInfos
GetCachedPreferences() Preferences
IsVacationModeEnabled() bool
GetPlanets() []Planet
GetPlanet(interface{}) (Planet, error)
GetMoons() []Moon
GetMoon(interface{}) (Moon, error)
GetCelestial(interface{}) (Celestial, error)
GetCelestials() ([]Celestial, error)
Abandon(interface{}) error
CollectAllMarketplaceMessages() error
CollectMarketplaceMessage(MarketplaceMessage) error
GetExpeditionMessages() ([]ExpeditionMessage, error)
GetExpeditionMessageAt(time.Time) (ExpeditionMessage, error)
GetEspionageReportMessages() ([]EspionageReportSummary, error)
GetEspionageReportFor(Coordinate) (EspionageReport, error)
GetEspionageReport(msgID int64) (EspionageReport, error)
GetCombatReportSummaryFor(Coordinate) (CombatReportSummary, error)
DeleteMessage(msgID int64) error
DeleteAllMessagesFromTab(tabID int64) error
Distance(origin, destination Coordinate) int64
FlightTime(origin, destination Coordinate, speed Speed, ships ShipsInfos) (secs, fuel int64)
RegisterWSCallback(string, func([]byte))
RemoveWSCallback(string)
RegisterChatCallback(func(ChatMsg))
RegisterAuctioneerCallback(func([]byte))
RegisterHTMLInterceptor(func(method, url string, params, payload url.Values, pageHTML []byte))
GetSlots() Slots
BuyOfferOfTheDay() error
BytesDownloaded() int64
BytesUploaded() int64
CreateUnion(fleet Fleet, unionUsers []string) (int64, error)
GetEmpire(nbr int64) (interface{}, error)
HeadersForPage(url string) (http.Header, error)
CharacterClass() CharacterClass
GetAuction() (Auction, error)
DoAuction(bid map[CelestialID]Resources) error
Highscore(category, typ, page int64) (Highscore, error)
GetAllResources() (map[CelestialID]Resources, error)
GetDMCosts(CelestialID) (DMCosts, error)
UseDM(string, CelestialID) error
GetItems(CelestialID) ([]Item, error)
ActivateItem(string, CelestialID) error

// Planet or Moon functions
GetResources(CelestialID) (Resources, error)
GetResourcesDetails(CelestialID) (ResourcesDetails, error)
SendFleet(celestialID CelestialID, ships []Quantifiable, speed Speed, where Coordinate, mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)
EnsureFleet(celestialID CelestialID, ships []Quantifiable, speed Speed, where Coordinate, mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)
Build(celestialID CelestialID, id ID, nbr int64) error
BuildCancelable(CelestialID, ID) error
BuildProduction(celestialID CelestialID, id ID, nbr int64) error
BuildBuilding(celestialID CelestialID, buildingID ID) error
BuildDefense(celestialID CelestialID, defenseID ID, nbr int64) error
BuildShips(celestialID CelestialID, shipID ID, nbr int64) error
CancelBuilding(CelestialID) error
TearDown(celestialID CelestialID, id ID) error
ConstructionsBeingBuilt(CelestialID) (buildingID ID, buildingCountdown int64, researchID ID, researchCountdown int64)
GetProduction(CelestialID) ([]Quantifiable, int64, error)
GetFacilities(CelestialID) (Facilities, error)
GetDefense(CelestialID) (DefensesInfos, error)
GetShips(CelestialID) (ShipsInfos, error)
GetResourcesBuildings(CelestialID) (ResourcesBuildings, error)
CancelResearch(CelestialID) error
BuildTechnology(celestialID CelestialID, technologyID ID) error

// Planet specific functions
GetResourceSettings(PlanetID) (ResourceSettings, error)
SetResourceSettings(PlanetID, ResourceSettings) error
SendIPM(PlanetID, Coordinate, int64, ID) (int64, error)
//GetResourcesProductionRatio(PlanetID) (float64, error)
GetResourcesProductions(PlanetID) (Resources, error)
GetResourcesProductionsLight(ResourcesBuildings, Researches, ResourceSettings, Temperature) Resources

// Moon specific functions
Phalanx(MoonID, Coordinate) ([]Fleet, error)
UnsafePhalanx(MoonID, Coordinate) ([]Fleet, error)
JumpGate(origin, dest MoonID, ships ShipsInfos) (bool, int64, error)
JumpGateDestinations(origin MoonID) ([]MoonID, int64, error)
Full documentation

https://godoc.org/github.com/0xE232FE/ogame


ogamed service

Download ogamed binary here
Full documentation here

./ogamed --universe=Zibal --username=email@email.com --password=secret --language=en
$ curl 127.0.0.1:8080/bot/is-under-attack
{"Status":"ok","Code":200,"Message":"","Result":false}

$ curl 127.0.0.1:8080/bot/send-message -d 'playerID=123&message="Sup boi!"'
{"Status":"ok","Code":200,"Message":"","Result":null}

$ curl 127.0.0.1:8080/bot/user-infos
{"Status":"ok","Code":200,"Message":"","Result":{"PlayerID":106734,"PlayerName":"Commodore Nomad","Points":43825,"Rank":1130,"Total":1675,"HonourPoints":0}}
POST /bot/set-user-agent
GET  /bot/server-url
POST /bot/page-content
GET  /bot/login
GET  /bot/logout
GET  /bot/server/speed
GET  /bot/server/version
GET  /bot/server/time
GET  /bot/is-under-attack
GET  /bot/user-infos
POST /bot/send-message
GET  /bot/fleets
POST /bot/fleets/:fleetID/cancel
POST /bot/delete-report/:messageID
POST /bot/delete-all-espionage-reports
POST /bot/delete-all-reports/:tabIndex
GET  /bot/attacks
GET  /bot/galaxy-infos/:galaxy/:system
GET  /bot/get-research
GET  /bot/price/:ogameID/:nbr
GET  /bot/planets
GET  /bot/planets/:galaxy/:system/:position
GET  /bot/planets/:planetID
GET  /bot/planets/:planetID/resource-settings
POST /bot/planets/:planetID/resource-settings
GET  /bot/planets/:planetID/resources-buildings
GET  /bot/planets/:planetID/defence
GET  /bot/planets/:planetID/ships
GET  /bot/planets/:planetID/facilities
POST /bot/planets/:planetID/build/:ogameID/:nbr
POST /bot/planets/:planetID/build/cancelable/:ogameID
POST /bot/planets/:planetID/build/production/:ogameID/:nbr
POST /bot/planets/:planetID/build/building/:ogameID
POST /bot/planets/:planetID/build/technology/:ogameID
POST /bot/planets/:planetID/build/defence/:ogameID/:nbr
POST /bot/planets/:planetID/build/ships/:ogameID/:nbr
GET  /bot/planets/:planetID/production
GET  /bot/planets/:planetID/constructions
POST /bot/planets/:planetID/cancel-building
POST /bot/planets/:planetID/cancel-research
GET  /bot/planets/:planetID/resources
POST /bot/planets/:planetID/send-fleet
POST /bot/planets/:planetID/send-ipm
POST /bot/planets/:planetID/teardown/:ogameID
GET  /bot/moons/:moonID/phalanx/:galaxy/:system/:position
GET  /bot/get-auction
POST /bot/do-auction

docker container

If you have Docker, and you are looking for a docker image just update the .env file specifying the universe name, credentials and language.

OGAMED_HOST=0.0.0.0
OGAMED_UNIVERSE=Bellatrix
OGAMED_USERNAME=email@gmail.com
OGAMED_PASSWORD=*****
OGAMED_LANGUAGE=en

.env file contains all the environment variables used by ogamed service.

Create and run the container:

docker-compose up -d

Check the container logs to see if the service is correctly connected to the server:

docker logs ogame

The container can be invoked as usual as a service or as a library.

Documentation

Index

Constants

View Source
const (
	NoClass    CharacterClass = 0
	Collector  CharacterClass = 1
	General    CharacterClass = 2
	Discoverer CharacterClass = 3

	PlanetType CelestialType = 1
	DebrisType CelestialType = 2
	MoonType   CelestialType = 3

	//Buildings
	MetalMineID                    ID = 1
	CrystalMineID                  ID = 2
	DeuteriumSynthesizerID         ID = 3
	SolarPlantID                   ID = 4
	FusionReactorID                ID = 12
	MetalStorageID                 ID = 22
	CrystalStorageID               ID = 23
	DeuteriumTankID                ID = 24
	ShieldedMetalDenID             ID = 25
	UndergroundCrystalDenID        ID = 26
	SeabedDeuteriumDenID           ID = 27
	AllianceDepotID                ID = 34 // Facilities
	RoboticsFactoryID              ID = 14
	ShipyardID                     ID = 21
	ResearchLabID                  ID = 31
	MissileSiloID                  ID = 44
	NaniteFactoryID                ID = 15
	TerraformerID                  ID = 33
	SpaceDockID                    ID = 36
	LunarBaseID                    ID = 41 // Moon facilities
	SensorPhalanxID                ID = 42
	JumpGateID                     ID = 43
	RocketLauncherID               ID = 401 // Defense
	LightLaserID                   ID = 402
	HeavyLaserID                   ID = 403
	GaussCannonID                  ID = 404
	IonCannonID                    ID = 405
	PlasmaTurretID                 ID = 406
	SmallShieldDomeID              ID = 407
	LargeShieldDomeID              ID = 408
	AntiBallisticMissilesID        ID = 502
	InterplanetaryMissilesID       ID = 503
	SmallCargoID                   ID = 202 // Ships
	LargeCargoID                   ID = 203
	LightFighterID                 ID = 204
	HeavyFighterID                 ID = 205
	CruiserID                      ID = 206
	BattleshipID                   ID = 207
	ColonyShipID                   ID = 208
	RecyclerID                     ID = 209
	EspionageProbeID               ID = 210
	BomberID                       ID = 211
	SolarSatelliteID               ID = 212
	DestroyerID                    ID = 213
	DeathstarID                    ID = 214
	BattlecruiserID                ID = 215
	CrawlerID                      ID = 217
	ReaperID                       ID = 218
	PathfinderID                   ID = 219
	EspionageTechnologyID          ID = 106 // Research
	ComputerTechnologyID           ID = 108
	WeaponsTechnologyID            ID = 109
	ShieldingTechnologyID          ID = 110
	ArmourTechnologyID             ID = 111
	EnergyTechnologyID             ID = 113
	HyperspaceTechnologyID         ID = 114
	CombustionDriveID              ID = 115
	ImpulseDriveID                 ID = 117
	HyperspaceDriveID              ID = 118
	LaserTechnologyID              ID = 120
	IonTechnologyID                ID = 121
	PlasmaTechnologyID             ID = 122
	IntergalacticResearchNetworkID ID = 123
	AstrophysicsID                 ID = 124
	GravitonTechnologyID           ID = 199

	// Missions
	Attack             MissionID = 1
	GroupedAttack      MissionID = 2
	Transport          MissionID = 3
	Park               MissionID = 4
	ParkInThatAlly     MissionID = 5
	Spy                MissionID = 6
	Colonize           MissionID = 7
	RecycleDebrisField MissionID = 8
	Destroy            MissionID = 9
	MissileAttack      MissionID = 10
	Expedition         MissionID = 15

	// Speeds
	TenPercent     Speed = 1
	TwentyPercent  Speed = 2
	ThirtyPercent  Speed = 3
	FourtyPercent  Speed = 4
	FiftyPercent   Speed = 5
	SixtyPercent   Speed = 6
	SeventyPercent Speed = 7
	EightyPercent  Speed = 8
	NinetyPercent  Speed = 9
	HundredPercent Speed = 10
)

OGame constants

View Source
const (
	OverviewPage         = "overview"
	PreferencesPage      = "preferences"
	ResourceSettingsPage = "resourceSettings"
	DefensesPage         = "defenses"
	SuppliesPage         = "supplies"
	FacilitiesPage       = "facilities"
	FleetdispatchPage    = "fleetdispatch"
	ShipyardPage         = "shipyard"
	MovementPage         = "movement"
	ResearchPage         = "research"
	PlanetlayerPage      = "planetlayer"
	LogoutPage           = "logout"
	JumpgatelayerPage    = "jumpgatelayer"
	FetchResourcesPage   = "fetchResources"
	TraderOverviewPage   = "traderOverview"
	GalaxyPage           = "galaxy"
	AlliancePage         = "alliance"
	PremiumPage          = "premium"
	ShopPage             = "shop"
	RewardsPage          = "rewards"
	HighscorePage        = "highscore"
	BuddiesPage          = "buddies"
	MessagesPage         = "messages"
	ChatPage             = "chat"

	// ajax pages
	FetchEventboxAjaxPage      = "fetchEventbox"
	FetchResourcesAjaxPage     = "fetchResources"
	GalaxyContentAjaxPage      = "galaxyContent"
	EventListAjaxPage          = "eventList"
	AjaxChatAjaxPage           = "ajaxChat"
	NoticesAjaxPage            = "notices"
	RepairlayerAjaxPage        = "repairlayer"
	TechtreeAjaxPage           = "techtree"
	PhalanxAjaxPage            = "phalanx"
	ShareReportOverlayAjaxPage = "shareReportOverlay"
	JumpgatelayerAjaxPage      = "jumpgatelayer"
	FederationlayerAjaxPage    = "federationlayer"
	UnionchangeAjaxPage        = "unionchange"
	ChangenickAjaxPage         = "changenick"
	PlanetlayerAjaxPage        = "planetlayer"
	TraderlayerAjaxPage        = "traderlayer"
	PlanetRenameAjaxPage       = "planetRename"
	RightmenuAjaxPage          = "rightmenu"
	AllianceOverviewAjaxPage   = "allianceOverview"
	SupportAjaxPage            = "support"
	BuffActivationAjaxPage     = "buffActivation"
	AuctioneerAjaxPage         = "auctioneer"
	HighscoreContentAjaxPage   = "highscoreContent"
)

Page names

View Source
const (
	Low       = 1
	Normal    = 2
	Important = 3
	Critical  = 4
)

Priorities

Variables

View Source
var (
	ErrUnionNotFound                      = errors.New("union not found")
	ErrAccountInVacationMode              = errors.New("account in vacation mode")
	ErrNoShipSelected                     = errors.New("no ships to send")
	ErrNotEnoughShips                     = errors.New("not enough ships to send")
	ErrUninhabitedPlanet                  = errors.New("uninhabited planet")
	ErrNoDebrisField                      = errors.New("no debris field")
	ErrPlayerInVacationMode               = errors.New("player in vacation mode")
	ErrAdminOrGM                          = errors.New("admin or GM")
	ErrNoAstrophysics                     = errors.New("you have to research Astrophysics first")
	ErrNoobProtection                     = errors.New("noob protection")
	ErrPlayerTooStrong                    = errors.New("this planet can not be attacked as the player is to strong")
	ErrNoMoonAvailable                    = errors.New("no moon available")
	ErrNoRecyclerAvailable                = errors.New("no recycler available")
	ErrNoEventsRunning                    = errors.New("there are currently no events running")
	ErrPlanetAlreadyReservedForRelocation = errors.New("this planet has already been reserved for a relocation")
)

Send fleet errors

View Source
var (
	AllianceDepot                = newAllianceDepot() // Buildings
	CrystalMine                  = newCrystalMine()
	CrystalStorage               = newCrystalStorage()
	DeuteriumSynthesizer         = newDeuteriumSynthesizer()
	DeuteriumTank                = newDeuteriumTank()
	FusionReactor                = newFusionReactor()
	MetalMine                    = newMetalMine()
	MetalStorage                 = newMetalStorage()
	MissileSilo                  = newMissileSilo()
	NaniteFactory                = newNaniteFactory()
	ResearchLab                  = newResearchLab()
	RoboticsFactory              = newRoboticsFactory()
	SeabedDeuteriumDen           = newSeabedDeuteriumDen()
	ShieldedMetalDen             = newShieldedMetalDen()
	Shipyard                     = newShipyard()
	SolarPlant                   = newSolarPlant()
	SpaceDock                    = newSpaceDock()
	LunarBase                    = newLunarBase()
	SensorPhalanx                = newSensorPhalanx()
	JumpGate                     = newJumpGate()
	Terraformer                  = newTerraformer()
	UndergroundCrystalDen        = newUndergroundCrystalDen()
	SolarSatellite               = newSolarSatellite()
	AntiBallisticMissiles        = newAntiBallisticMissiles() // Defense
	GaussCannon                  = newGaussCannon()
	HeavyLaser                   = newHeavyLaser()
	InterplanetaryMissiles       = newInterplanetaryMissiles()
	IonCannon                    = newIonCannon()
	LargeShieldDome              = newLargeShieldDome()
	LightLaser                   = newLightLaser()
	PlasmaTurret                 = newPlasmaTurret()
	RocketLauncher               = newRocketLauncher()
	SmallShieldDome              = newSmallShieldDome()
	Battlecruiser                = newBattlecruiser() // Ships
	Battleship                   = newBattleship()
	Bomber                       = newBomber()
	ColonyShip                   = newColonyShip()
	Cruiser                      = newCruiser()
	Deathstar                    = newDeathstar()
	Destroyer                    = newDestroyer()
	EspionageProbe               = newEspionageProbe()
	HeavyFighter                 = newHeavyFighter()
	LargeCargo                   = newLargeCargo()
	LightFighter                 = newLightFighter()
	Recycler                     = newRecycler()
	SmallCargo                   = newSmallCargo()
	Crawler                      = newCrawler()
	Reaper                       = newReaper()
	Pathfinder                   = newPathfinder()
	ArmourTechnology             = newArmourTechnology() // Technologies
	Astrophysics                 = newAstrophysics()
	CombustionDrive              = newCombustionDrive()
	ComputerTechnology           = newComputerTechnology()
	EnergyTechnology             = newEnergyTechnology()
	EspionageTechnology          = newEspionageTechnology()
	GravitonTechnology           = newGravitonTechnology()
	HyperspaceDrive              = newHyperspaceDrive()
	HyperspaceTechnology         = newHyperspaceTechnology()
	ImpulseDrive                 = newImpulseDrive()
	IntergalacticResearchNetwork = newIntergalacticResearchNetwork()
	IonTechnology                = newIonTechnology()
	LaserTechnology              = newLaserTechnology()
	PlasmaTechnology             = newPlasmaTechnology()
	ShieldingTechnology          = newShieldingTechnology()
	WeaponsTechnology            = newWeaponsTechnology()
)

All ogame objects

Buildings array of all buildings/facilities objects

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

DefaultLoginWrapper ...

Defenses array of all defenses objects

View Source
var ErrAccountBlocked = errors.New("account is blocked")

ErrAccountBlocked returned when account is banned

View Source
var ErrAccountNotFound = errors.New("account not found")

ErrAccountNotFound returned when the account is not found

View Source
var ErrAllSlotsInUse = errors.New("all slots are in use")

ErrAllSlotsInUse returned when all slots are in use

View Source
var ErrBadCredentials = errors.New("bad credentials")

ErrBadCredentials returned when the provided credentials are invalid

View Source
var ErrBotInactive = errors.New("bot is not active")

ErrBotInactive returned when the bot is not active

View Source
var ErrBotLoggedOut = errors.New("bot is logged out")

ErrBotLoggedOut returned when the bot is logged out (manually logged out)

View Source
var ErrDeactivateHidePictures = errors.New("deactivate 'Hide pictures in reports'")

ErrDeactivateHidePictures returned when "Hide pictures in reports" is activated

View Source
var ErrEventsBoxNotDisplayed = errors.New("eventList box is not displayed")

ErrEventsBoxNotDisplayed returned when trying to get attacks from a full page without event box

View Source
var ErrFailedExecuteCallback = errors.New("failed to execute callback")

ErrFailedExecuteCallback returned when "withRetry" failed to execute callback

View Source
var ErrInvalidPlanetID = errors.New("invalid planet id")

ErrInvalidPlanetID returned when a planet id is invalid

View Source
var ErrMobileView = errors.New("mobile view not supported")

ErrMobileView returned when the bot is in mobile view

View Source
var ErrNotLogged = errors.New("not logged")

ErrNotLogged returned when the bot is not logged

View Source
var ErrOTPInvalid = errors.New("otp invalid")

ErrOTPInvalid returned when the otp is invalid

View Source
var ErrOTPRequired = errors.New("otp required")

ErrOTPRequired returned when the otp is required

MoonBuildings arrays of moon specific buildings

View Source
var Objs = ObjsStruct{
	AllianceDepot:                AllianceDepot,
	CrystalMine:                  CrystalMine,
	CrystalStorage:               CrystalStorage,
	DeuteriumSynthesizer:         DeuteriumSynthesizer,
	DeuteriumTank:                DeuteriumTank,
	FusionReactor:                FusionReactor,
	MetalMine:                    MetalMine,
	MetalStorage:                 MetalStorage,
	MissileSilo:                  MissileSilo,
	NaniteFactory:                NaniteFactory,
	ResearchLab:                  ResearchLab,
	RoboticsFactory:              RoboticsFactory,
	SeabedDeuteriumDen:           SeabedDeuteriumDen,
	ShieldedMetalDen:             ShieldedMetalDen,
	Shipyard:                     Shipyard,
	SolarPlant:                   SolarPlant,
	SpaceDock:                    SpaceDock,
	LunarBase:                    LunarBase,
	SensorPhalanx:                SensorPhalanx,
	JumpGate:                     JumpGate,
	Terraformer:                  Terraformer,
	UndergroundCrystalDen:        UndergroundCrystalDen,
	SolarSatellite:               SolarSatellite,
	AntiBallisticMissiles:        AntiBallisticMissiles,
	GaussCannon:                  GaussCannon,
	HeavyLaser:                   HeavyLaser,
	InterplanetaryMissiles:       InterplanetaryMissiles,
	IonCannon:                    IonCannon,
	LargeShieldDome:              LargeShieldDome,
	LightLaser:                   LightLaser,
	PlasmaTurret:                 PlasmaTurret,
	RocketLauncher:               RocketLauncher,
	SmallShieldDome:              SmallShieldDome,
	Battlecruiser:                Battlecruiser,
	Battleship:                   Battleship,
	Bomber:                       Bomber,
	ColonyShip:                   ColonyShip,
	Cruiser:                      Cruiser,
	Deathstar:                    Deathstar,
	Destroyer:                    Destroyer,
	EspionageProbe:               EspionageProbe,
	HeavyFighter:                 HeavyFighter,
	LargeCargo:                   LargeCargo,
	LightFighter:                 LightFighter,
	Recycler:                     Recycler,
	SmallCargo:                   SmallCargo,
	Crawler:                      Crawler,
	Reaper:                       Reaper,
	Pathfinder:                   Pathfinder,
	ArmourTechnology:             ArmourTechnology,
	Astrophysics:                 Astrophysics,
	CombustionDrive:              CombustionDrive,
	ComputerTechnology:           ComputerTechnology,
	EnergyTechnology:             EnergyTechnology,
	EspionageTechnology:          EspionageTechnology,
	GravitonTechnology:           GravitonTechnology,
	HyperspaceDrive:              HyperspaceDrive,
	HyperspaceTechnology:         HyperspaceTechnology,
	ImpulseDrive:                 ImpulseDrive,
	IntergalacticResearchNetwork: IntergalacticResearchNetwork,
	IonTechnology:                IonTechnology,
	LaserTechnology:              LaserTechnology,
	PlasmaTechnology:             PlasmaTechnology,
	ShieldingTechnology:          ShieldingTechnology,
	WeaponsTechnology:            WeaponsTechnology,
}

Objs all ogame objects

PlanetBuildings arrays of planet specific buildings

View Source
var SaveToFileMu sync.Mutex

Ships array of all ships objects

Technologies array of all technologies objects

Functions

func ActivateCelestialItemHandler

func ActivateCelestialItemHandler(c echo.Context) error

ActivateCelestialItemHandler ...

func AddAccountHandler

func AddAccountHandler(c echo.Context) error

AddAccountHandler ...

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 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 ConstructionsBeingBuiltHandler

func ConstructionsBeingBuiltHandler(c echo.Context) error

ConstructionsBeingBuiltHandler ...

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 Coordinate, universeSize, nbSystems 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 GetCelestialItemsHandler

func GetCelestialItemsHandler(c echo.Context) error

GetCelestialItemsHandler ...

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 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 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 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 GetResourcesHandler

func GetResourcesHandler(c echo.Context) error

GetResourcesHandler ...

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 HomeHandler

func HomeHandler(c echo.Context) error

HomeHandler ...

func I64Ptr

func I64Ptr(v int64) *int64

I64Ptr returns a pointer to int64

func IsAjaxPage

func IsAjaxPage(vals url.Values) bool

IsAjaxPage either the requested page is a partial/ajax page

func IsBuildingID

func IsBuildingID(id int64) bool

IsBuildingID helper returns if an integer is a building id

func IsDefenseID

func IsDefenseID(id int64) bool

IsDefenseID helper returns if an integer is a defense id

func IsFacilityID

func IsFacilityID(id int64) bool

IsFacilityID helper returns if an integer is a facility id

func IsKnowFullPage

func IsKnowFullPage(vals url.Values) bool

IsKnowFullPage ...

func IsResourceBuildingID

func IsResourceBuildingID(id int64) bool

IsResourceBuildingID helper returns if an integer is a resource defense id

func IsShipID

func IsShipID(id int64) bool

IsShipID helper returns if an integer is a ship id

func IsTechID

func IsTechID(id int64) bool

IsTechID helper returns if an integer is a tech id

func IsUnderAttackHandler

func IsUnderAttackHandler(c echo.Context) error

IsUnderAttackHandler ...

func JumpGateHandler

func JumpGateHandler(c echo.Context) error

JumpGateHandler ...

func LoadFromFile

func LoadFromFile(filename string) []byte

func LoginHandler

func LoginHandler(c echo.Context) error

LoginHandler ...

func LogoutHandler

func LogoutHandler(c echo.Context) error

LogoutHandler ...

func MaxInt

func MaxInt(vals ...int64) int64

MaxInt returns the minimum int64 value

func MinInt

func MinInt(vals ...int64) int64

MinInt returns the minimum int64 value

func PageContentHandler

func PageContentHandler(c echo.Context) error

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

func ParseInt

func ParseInt(val string) int64

ParseInt ...

func PhalanxHandler

func PhalanxHandler(c echo.Context) error

PhalanxHandler ...

func PostToGameHandler

func PostToGameHandler(c echo.Context) error

PostToGameHandler ...

func Register

func Register(email, password, proxyAddr, proxyUsername, proxyPassword, proxyType string) error

Register a new gameforge lobby account

func SaveToFile

func SaveToFile(filename string, by []byte)

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 ... curl 127.0.0.1:1234/bot/set-user-agent -d 'userAgent="New user agent"'

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 ...

Types

type APIResp

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

APIResp ...

func ErrorResp

func ErrorResp(code int, message string) APIResp

ErrorResp ...

func SuccessResp

func SuccessResp(data interface{}) APIResp

SuccessResp ...

type AllianceInfos

type AllianceInfos struct {
	ID     int64
	Name   string
	Rank   int64
	Member int64
}

AllianceInfos public information of an alliance in the galaxy page

type AttackEvent

type AttackEvent struct {
	ID              int64
	MissionType     MissionID
	Origin          Coordinate
	Destination     Coordinate
	DestinationName string
	ArrivalTime     time.Time
	ArriveIn        int64
	AttackerName    string
	AttackerID      int64
	UnionID         int64
	Missiles        int64
	Ships           *ShipsInfos
}

AttackEvent all information available about an enemy attack

func (AttackEvent) String

func (a AttackEvent) String() string

type Attacker

type Attacker struct {
	Weapon int
	Shield int
	Armour int
	ShipsInfos
}

Attacker ...

type Auction

type Auction struct {
	HasFinished         bool
	Endtime             int64
	NumBids             int64
	CurrentBid          int64
	AlreadyBid          int64
	MinimumBid          int64
	DeficitBid          int64
	HighestBidder       string
	HighestBidderUserID int64
	CurrentItem         string
	CurrentItemLong     string
	Inventory           int64
	Token               string
	ResourceMultiplier  struct {
		Metal     float64
		Crystal   float64
		Deuterium float64
		Honor     int64
	}
	Resources map[string]interface{}
}

Auction ...

func (Auction) String

func (a Auction) String() string

String ...

type Base

type Base struct {
	ID           ID
	Name         string
	Requirements map[ID]int64
}

Base struct for all ogame objects

func (Base) GetID

func (b Base) GetID() ID

GetID returns the ogame id of the object

func (Base) GetName

func (b Base) GetName() string

GetName returns the printable name of the object

func (Base) GetRequirements

func (b Base) GetRequirements() map[ID]int64

GetRequirements returns the requirements to have this object available

func (Base) IsAvailable

func (b Base) IsAvailable(t CelestialType, lazyResourcesBuildings LazyResourcesBuildings,
	lazyFacilities LazyFacilities, lazyResearches LazyResearches, energy int64) bool

IsAvailable returns either or not the object is available to us

type BaseBuilding

type BaseBuilding struct {
	BaseLevelable
}

BaseBuilding base struct for buildings

func (BaseBuilding) ConstructionTime

func (b BaseBuilding) ConstructionTime(level, universeSpeed int64, facilities Facilities, hasTechnocrat, isDiscoverer bool) time.Duration

ConstructionTime returns the duration it takes to build given level. Deconstruction time is the same function.

func (BaseBuilding) DeconstructionPrice

func (b BaseBuilding) DeconstructionPrice(level int64, techs Researches) Resources

DeconstructionPrice returns the price to tear down to given level

func (BaseBuilding) GetLevel

func (b BaseBuilding) GetLevel(lazyResourcesBuildings LazyResourcesBuildings, lazyFacilities LazyFacilities, _ LazyResearches) int64

GetLevel returns current level of a building

type BaseDefender

type BaseDefender struct {
	Base
	StructuralIntegrity int64
	ShieldPower         int64
	WeaponPower         int64
	RapidfireFrom       map[ID]int64
	RapidfireAgainst    map[ID]int64
	Price               Resources
}

BaseDefender base for defender units (ships, defenses)

func (BaseDefender) ConstructionTime

func (b BaseDefender) ConstructionTime(nbr, universeSpeed int64, facilities Facilities, hasTechnocrat, isDiscoverer bool) time.Duration

ConstructionTime returns the duration it takes to build nbr defender units

func (BaseDefender) GetPrice

func (b BaseDefender) GetPrice(nbr int64) Resources

GetPrice returns the price of nbr defender units

func (BaseDefender) GetRapidfireAgainst

func (b BaseDefender) GetRapidfireAgainst() map[ID]int64

GetRapidfireAgainst returns which ships/defenses we have rapid fire against

func (BaseDefender) GetRapidfireFrom

func (b BaseDefender) GetRapidfireFrom() map[ID]int64

GetRapidfireFrom returns which ships have rapid fire against the defender unit

func (BaseDefender) GetShieldPower

func (b BaseDefender) GetShieldPower(researches Researches) int64

GetShieldPower returns shield power of a defender unit

func (BaseDefender) GetStructuralIntegrity

func (b BaseDefender) GetStructuralIntegrity(researches Researches) int64

GetStructuralIntegrity returns structural integrity of a defender unit

func (BaseDefender) GetWeaponPower

func (b BaseDefender) GetWeaponPower(researches Researches) int64

GetWeaponPower returns weapon power of a defender unit

type BaseDefense

type BaseDefense struct {
	BaseDefender
}

BaseDefense base struct for defense objects

type BaseLevelable

type BaseLevelable struct {
	Base
	BaseCost       Resources
	IncreaseFactor float64
}

BaseLevelable base struct for levelable (buildings, technologies)

func (BaseLevelable) GetPrice

func (b BaseLevelable) GetPrice(level int64) Resources

GetPrice returns the price to build the given level

type BaseOgameObj

type BaseOgameObj interface {
	ConstructionTime(nbr, universeSpeed int64, facilities Facilities, hasTechnocrat, isDiscoverer bool) time.Duration
	GetID() ID
	GetName() string
	GetPrice(int64) Resources
	GetRequirements() map[ID]int64
	IsAvailable(CelestialType, LazyResourcesBuildings, LazyFacilities, LazyResearches, int64) bool
}

BaseOgameObj base interface for all ogame objects (buildings, technologies, ships, defenses)

type BaseShip

type BaseShip struct {
	BaseDefender
	BaseCargoCapacity int64
	BaseSpeed         int64
	FuelConsumption   int64
}

BaseShip base struct for ships

func (BaseShip) GetCargoCapacity

func (b BaseShip) GetCargoCapacity(techs Researches, probeRaids, isCollector bool) int64

GetCargoCapacity returns ship cargo capacity

func (BaseShip) GetFuelConsumption

func (b BaseShip) GetFuelConsumption(techs Researches, fleetDeutSaveFactor float64, isGeneral bool) int64

GetFuelConsumption returns ship fuel consumption

func (BaseShip) GetSpeed

func (b BaseShip) GetSpeed(techs Researches, isCollector, isGeneral bool) int64

GetSpeed returns speed of the ship

type BaseTechnology

type BaseTechnology struct {
	BaseLevelable
}

BaseTechnology base struct for technologies

func (BaseTechnology) ConstructionTime

func (b BaseTechnology) ConstructionTime(level, universeSpeed int64, facilities Facilities, hasTechnocrat, isDiscoverer bool) time.Duration

ConstructionTime returns the duration it takes to build given technology

func (BaseTechnology) GetLevel

func (b BaseTechnology) GetLevel(_ LazyResourcesBuildings, _ LazyFacilities, lazyResearches LazyResearches) int64

GetLevel returns current level of a technology

type Building

type Building interface {
	Levelable
	DeconstructionPrice(lvl int64, techs Researches) Resources
}

Building interface that all buildings implement

type Celestial

type Celestial interface {
	GetID() CelestialID
	GetType() CelestialType
	GetName() string
	GetDiameter() int64
	GetCoordinate() Coordinate
	GetFields() Fields
	GetResources() (Resources, error)
	GetResourcesDetails() (ResourcesDetails, error)
	GetFacilities() (Facilities, error)
	SendFleet([]Quantifiable, Speed, Coordinate, MissionID, Resources, int64, int64) (Fleet, error)
	EnsureFleet([]Quantifiable, Speed, Coordinate, MissionID, Resources, int64, int64) (Fleet, error)
	GetDefense() (DefensesInfos, error)
	GetShips() (ShipsInfos, error)
	BuildDefense(defenseID ID, nbr int64) error
	ConstructionsBeingBuilt() (ID, int64, ID, int64)
	GetProduction() ([]Quantifiable, int64, error)
	GetResourcesBuildings() (ResourcesBuildings, error)
	Build(id ID, nbr int64) error
	BuildBuilding(buildingID ID) error
	BuildTechnology(technologyID ID) error
	CancelResearch() error
	CancelBuilding() error
	TearDown(buildingID ID) error
	GetItems() ([]Item, error)
	ActivateItem(string) error
}

Celestial ...

type CelestialID

type CelestialID int64

CelestialID represent either a PlanetID or a MoonID

type CelestialType

type CelestialType int64

CelestialType destination type might be planet/moon/debris

func (CelestialType) Int

func (d CelestialType) Int() int64

Int returns an integer value of the CelestialType Deprecated: backward compatibility

func (CelestialType) Int64

func (d CelestialType) Int64() int64

Int64 returns an integer value of the CelestialType

func (CelestialType) String

func (d CelestialType) String() string

type CharacterClass

type CharacterClass int64

CharacterClass ...

type ChatMsg

type ChatMsg struct {
	SenderID      int64  `json:"senderId"`
	SenderName    string `json:"senderName"`
	AssociationID int64  `json:"associationId"`
	Text          string `json:"text"`
	ID            int64  `json:"id"`
	Date          int64  `json:"date"`
}

ChatMsg ...

func (ChatMsg) String

func (m ChatMsg) String() string

type ChatPayload

type ChatPayload struct {
	Name string    `json:"name"`
	Args []ChatMsg `json:"args"`
}

ChatPayload ...

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 []struct {
		Message string `json:"message"`
		Error   int    `json:"error"`
	} `json:"errors"`
	TargetOk   bool          `json:"targetOk"`
	Components []interface{} `json:"components"`
}

CheckTargetResponse ...

type CombatReportSummary

type CombatReportSummary struct {
	ID           int64
	APIKey       string
	Origin       *Coordinate
	Destination  Coordinate
	AttackerName string
	DefenderName string
	Loot         int64
	Metal        int64
	Crystal      int64
	Deuterium    int64
	DebrisField  int64
	CreatedAt    time.Time
}

CombatReportSummary summary of combat report

type CombatUnit

type CombatUnit struct {
	PackedInfos uint64
}

CombatUnit ...

type Config

type Config struct {
	IsLogging   bool
	Simulations int
	Workers     int
	Attacker    attackerInfo
	Defender    defenderInfo
}

Config ...

type Coordinate

type Coordinate struct {
	Galaxy   int64
	System   int64
	Position int64
	Type     CelestialType
}

Coordinate represent an ogame coordinate

func ParseCoord

func ParseCoord(str string) (coord Coordinate, err error)

ParseCoord parse a coordinate from a string

func (Coordinate) Debris

func (c Coordinate) Debris() Coordinate

Debris return a new coordinate with debris type

func (Coordinate) Equal

func (c Coordinate) Equal(v Coordinate) bool

Equal returns either two coordinates are equal or not

func (Coordinate) IsDebris

func (c Coordinate) IsDebris() bool

IsDebris return true if coordinate is a debris field

func (Coordinate) IsMoon

func (c Coordinate) IsMoon() bool

IsMoon return true if coordinate is a moon

func (Coordinate) IsPlanet

func (c Coordinate) IsPlanet() bool

IsPlanet return true if coordinate is a planet

func (Coordinate) Moon

func (c Coordinate) Moon() Coordinate

Moon return a new coordinate with moon type

func (Coordinate) Planet

func (c Coordinate) Planet() Coordinate

Planet return a new coordinate with planet type

func (Coordinate) String

func (c Coordinate) String() string

type DMCost

type DMCost struct {
	Cost                int64
	CanBuy              bool  // Either or not we have enough DM
	Complete            bool  // false means we will halve the time, true will complete
	OGameID             ID    // What we are going to build
	Nbr                 int64 // Either the amount of ships/defences or the building/research level
	BuyAndActivateToken string
	Token               string
}

DMCost ...

func (DMCost) String

func (d DMCost) String() string

String ...

type DMCosts

type DMCosts struct {
	Buildings DMCost
	Research  DMCost
	Shipyard  DMCost
}

DMCosts ...

func (DMCosts) String

func (d DMCosts) String() string

String ...

type Data

type Data struct {
	Planets                  []Planet
	Celestials               []Celestial
	LastActivePlanet         CelestialID
	PlanetActivity           map[CelestialID]int64
	PlanetResources          map[CelestialID]ResourcesDetails
	PlanetResourcesBuildings map[CelestialID]ResourcesBuildings
	PlanetFacilities         map[CelestialID]Facilities
	PlanetShipsInfos         map[CelestialID]ShipsInfos
	PlanetDefensesInfos      map[CelestialID]DefensesInfos

	PlanetConstruction                map[CelestialID]Quantifiable
	PlanetConstructionFinishAt        map[CelestialID]int64
	PlanetShipyardProductions         map[CelestialID][]Quantifiable
	PlanetShipyardProductionsFinishAt map[CelestialID]int64
	PlanetQueue                       map[CelestialID][]Quantifiable
	ResearchFinishAt                  int64

	Researches       Researches
	ResearchesActive Quantifiable
	EventboxResp     eventboxResp
	AttackEvents     []AttackEvent
	MovementFleets   []Fleet
	Slots            Slots
}

type Defender

type Defender struct {
	Metal     int
	Crystal   int
	Deuterium int
	Weapon    int
	Shield    int
	Armour    int
	ShipsInfos
	DefensesInfos
}

Defender ...

type DefenderObj

type DefenderObj interface {
	BaseOgameObj
	GetStructuralIntegrity(Researches) int64
	GetShieldPower(Researches) int64
	GetWeaponPower(Researches) int64
	GetRapidfireFrom() map[ID]int64
	GetRapidfireAgainst() map[ID]int64
}

DefenderObj base interface for all defensive units (ships, defenses)

type Defense

type Defense interface {
	DefenderObj
}

Defense interface implemented by all defenses units

type DefensesInfos

type DefensesInfos struct {
	RocketLauncher         int64
	LightLaser             int64
	HeavyLaser             int64
	GaussCannon            int64
	IonCannon              int64
	PlasmaTurret           int64
	SmallShieldDome        int64
	LargeShieldDome        int64
	AntiBallisticMissiles  int64
	InterplanetaryMissiles int64
}

DefensesInfos represent a planet defenses information

func (DefensesInfos) AttackableValue

func (d DefensesInfos) AttackableValue() int64

AttackableValue returns the value of the defenses that can be attacked

func (DefensesInfos) ByID

func (d DefensesInfos) ByID(id ID) int64

ByID get number of defenses by defense id

func (*DefensesInfos) Set

func (d *DefensesInfos) Set(id ID, val int64)

Set sets the defenses value using the defense id

func (DefensesInfos) String

func (d DefensesInfos) String() string

type EspionageReport

type EspionageReport struct {
	Resources
	ID                           int64
	Username                     string
	LastActivity                 int64
	CounterEspionage             int64
	APIKey                       string
	HasFleetInformation          bool // Either or not we sent enough probes to get the fleet information
	HasDefensesInformation       bool // Either or not we sent enough probes to get the defenses information
	HasBuildingsInformation      bool // Either or not we sent enough probes to get the buildings information
	HasResearchesInformation     bool // Either or not we sent enough probes to get the researches information
	HonorableTarget              bool
	IsBandit                     bool
	IsStarlord                   bool
	IsInactive                   bool
	IsLongInactive               bool
	MetalMine                    *int64 // ResourcesBuildings
	CrystalMine                  *int64
	DeuteriumSynthesizer         *int64
	SolarPlant                   *int64
	FusionReactor                *int64
	SolarSatellite               *int64
	MetalStorage                 *int64
	CrystalStorage               *int64
	DeuteriumTank                *int64
	RoboticsFactory              *int64 // Facilities
	Shipyard                     *int64
	ResearchLab                  *int64
	AllianceDepot                *int64
	MissileSilo                  *int64
	NaniteFactory                *int64
	Terraformer                  *int64
	SpaceDock                    *int64
	LunarBase                    *int64
	SensorPhalanx                *int64
	JumpGate                     *int64
	EnergyTechnology             *int64 // Researches
	LaserTechnology              *int64
	IonTechnology                *int64
	HyperspaceTechnology         *int64
	PlasmaTechnology             *int64
	CombustionDrive              *int64
	ImpulseDrive                 *int64
	HyperspaceDrive              *int64
	EspionageTechnology          *int64
	ComputerTechnology           *int64
	Astrophysics                 *int64
	IntergalacticResearchNetwork *int64
	GravitonTechnology           *int64
	WeaponsTechnology            *int64
	ShieldingTechnology          *int64
	ArmourTechnology             *int64
	RocketLauncher               *int64 // Defenses
	LightLaser                   *int64
	HeavyLaser                   *int64
	GaussCannon                  *int64
	IonCannon                    *int64
	PlasmaTurret                 *int64
	SmallShieldDome              *int64
	LargeShieldDome              *int64
	AntiBallisticMissiles        *int64
	InterplanetaryMissiles       *int64
	LightFighter                 *int64 // Fleets
	HeavyFighter                 *int64
	Cruiser                      *int64
	Battleship                   *int64
	Battlecruiser                *int64
	Bomber                       *int64
	Destroyer                    *int64
	Deathstar                    *int64
	SmallCargo                   *int64
	LargeCargo                   *int64
	ColonyShip                   *int64
	Recycler                     *int64
	EspionageProbe               *int64
	Crawler                      *int64
	Reaper                       *int64
	Pathfinder                   *int64
	Coordinate                   Coordinate
	Type                         EspionageReportType
	Date                         time.Time
}

EspionageReport detailed espionage report

func (EspionageReport) DefensesInfos

func (r EspionageReport) DefensesInfos() *DefensesInfos

DefensesInfos returns a DefensesInfos struct from the espionage report

func (EspionageReport) Facilities

func (r EspionageReport) Facilities() *Facilities

Facilities returns a Facilities struct from the espionage report

func (EspionageReport) Loot

func (r EspionageReport) Loot(characterClass CharacterClass) Resources

Loot returns the possible loot

func (EspionageReport) PlunderRatio

func (r EspionageReport) PlunderRatio(characterClass CharacterClass) float64

PlunderRatio returns the plunder ratio

func (EspionageReport) Researches

func (r EspionageReport) Researches() *Researches

Researches returns a Researches struct from the espionage report

func (EspionageReport) ResourcesBuildings

func (r EspionageReport) ResourcesBuildings() *ResourcesBuildings

ResourcesBuildings returns a ResourcesBuildings struct from the espionage report

func (EspionageReport) ShipsInfos

func (r EspionageReport) ShipsInfos() *ShipsInfos

ShipsInfos returns a ShipsInfos struct from the espionage report

type EspionageReportSummary

type EspionageReportSummary struct {
	ID             int64
	Type           EspionageReportType
	From           string // Fleet Command | Space Monitoring
	Text           string
	Target         Coordinate
	LootPercentage float64
}

EspionageReportSummary summary of espionage report

type EspionageReportType

type EspionageReportType int

EspionageReportType type of espionage report (action or report)

const Action EspionageReportType = 0

Action message received when an enemy is seen near your planet

const Report EspionageReportType = 1

Report message received when you spied on someone

type ExpeditionMessage

type ExpeditionMessage struct {
	ID         int64
	Coordinate Coordinate
	Content    string
	CreatedAt  time.Time
}

ExpeditionMessage ...

type ExponentialBackoff

type ExponentialBackoff struct {
	// contains filtered or unexported fields
}

ExponentialBackoff ...

func NewExponentialBackoff

func NewExponentialBackoff(max int) *ExponentialBackoff

NewExponentialBackoff ...

func (*ExponentialBackoff) Reset

func (e *ExponentialBackoff) Reset()

Reset ...

func (*ExponentialBackoff) Wait

func (e *ExponentialBackoff) Wait()

Wait ...

type Extractor

type Extractor interface {
	ExtractIsInVacation(pageHTML []byte) bool
	ExtractPlanets(pageHTML []byte, b *OGame) []Planet
	ExtractPlanet(pageHTML []byte, v interface{}, b *OGame) (Planet, error)
	ExtractPlanetByCoord(pageHTML []byte, b *OGame, coord Coordinate) (Planet, error)
	ExtractMoons(pageHTML []byte, b *OGame) []Moon
	ExtractMoon(pageHTML []byte, b *OGame, v interface{}) (Moon, error)
	ExtractMoonByCoord(pageHTML []byte, b *OGame, coord Coordinate) (Moon, error)
	ExtractCelestials(pageHTML []byte, b *OGame) ([]Celestial, error)
	ExtractCelestial(pageHTML []byte, b *OGame, v interface{}) (Celestial, error)
	ExtractServerTime(pageHTML []byte) (time.Time, error)
	ExtractFleetsFromEventList(pageHTML []byte) []Fleet
	ExtractIPM(pageHTML []byte) (duration, max int64, token string)
	ExtractFleets(pageHTML []byte) (res []Fleet)
	ExtractSlots(pageHTML []byte) Slots
	ExtractOgameTimestamp(pageHTML []byte) int64
	ExtractResources(pageHTML []byte) Resources
	ExtractResourcesDetailsFromFullPage(pageHTML []byte) ResourcesDetails
	ExtractResourceSettings(pageHTML []byte) (ResourceSettings, error)
	ExtractAttacks(pageHTML []byte) ([]AttackEvent, error)
	ExtractOfferOfTheDay(pageHTML []byte) (int64, string, PlanetResources, Multiplier, error)
	ExtractResourcesBuildings(pageHTML []byte) (ResourcesBuildings, error)
	ExtractExpeditionMessages(pageHTML []byte, location *time.Location) ([]ExpeditionMessage, int64, error)
	ExtractMarketplaceMessages(pageHTML []byte, location *time.Location) ([]MarketplaceMessage, int64, error)
	ExtractDefense(pageHTML []byte) (DefensesInfos, error)
	ExtractShips(pageHTML []byte) (ShipsInfos, error)
	ExtractFacilities(pageHTML []byte) (Facilities, error)
	ExtractResearch(pageHTML []byte) Researches
	ExtractProduction(pageHTML []byte) ([]Quantifiable, int64, error)
	ExtractOverviewProduction(pageHTML []byte) ([]Quantifiable, int64, error)
	ExtractFleet1Ships(pageHTML []byte) ShipsInfos
	ExtractEspionageReportMessageIDs(pageHTML []byte) ([]EspionageReportSummary, int64)
	ExtractCombatReportMessagesSummary(pageHTML []byte) ([]CombatReportSummary, int64)
	ExtractEspionageReport(pageHTML []byte, location *time.Location) (EspionageReport, error)
	ExtractResourcesProductions(pageHTML []byte) (Resources, error)
	ExtractPreferences(pageHTML []byte) Preferences
	ExtractSpioAnz(pageHTML []byte) int64
	ExtractPreferencesShowActivityMinutes(pageHTML []byte) bool
	ExtractHiddenFields(pageHTML []byte) (fields url.Values)
	ExtractHiddenFieldsFromDoc(doc *goquery.Document) url.Values
	ExtractBodyIDFromDoc(doc *goquery.Document) string
	ExtractIsInVacationFromDoc(doc *goquery.Document) bool
	ExtractPlanetsFromDoc(doc *goquery.Document, b *OGame) []Planet
	ExtractPlanetByIDFromDoc(doc *goquery.Document, b *OGame, planetID PlanetID) (Planet, error)
	ExtractCelestialByIDFromDoc(doc *goquery.Document, b *OGame, celestialID CelestialID) (Celestial, error)
	ExtractPlanetByCoordFromDoc(doc *goquery.Document, b *OGame, coord Coordinate) (Planet, error)
	ExtractOgameTimestampFromDoc(doc *goquery.Document) int64
	ExtractResourcesFromDoc(doc *goquery.Document) Resources
	ExtractResourcesDetailsFromFullPageFromDoc(doc *goquery.Document) ResourcesDetails
	ExtractPlanetFromDoc(doc *goquery.Document, v interface{}, b *OGame) (Planet, error)
	ExtractMoonsFromDoc(doc *goquery.Document, b *OGame) []Moon
	ExtractMoonFromDoc(doc *goquery.Document, b *OGame, v interface{}) (Moon, error)
	ExtractMoonByCoordFromDoc(doc *goquery.Document, b *OGame, coord Coordinate) (Moon, error)
	ExtractMoonByIDFromDoc(doc *goquery.Document, b *OGame, moonID MoonID) (Moon, error)
	ExtractCelestialsFromDoc(doc *goquery.Document, b *OGame) ([]Celestial, error)
	ExtractCelestialFromDoc(doc *goquery.Document, b *OGame, v interface{}) (Celestial, error)
	ExtractResourcesBuildingsFromDoc(doc *goquery.Document) (ResourcesBuildings, error)
	ExtractDefenseFromDoc(doc *goquery.Document) (DefensesInfos, error)
	ExtractShipsFromDoc(doc *goquery.Document) (ShipsInfos, error)
	ExtractFacilitiesFromDoc(doc *goquery.Document) (Facilities, error)
	ExtractResearchFromDoc(doc *goquery.Document) Researches
	ExtractOGameSessionFromDoc(doc *goquery.Document) string
	ExtractAttacksFromDoc(doc *goquery.Document, clock clockwork.Clock) ([]AttackEvent, error)
	ExtractOfferOfTheDayFromDoc(doc *goquery.Document) (price int64, importToken string, planetResources PlanetResources, multiplier Multiplier, err error)
	ExtractProductionFromDoc(doc *goquery.Document) ([]Quantifiable, error)
	ExtractOverviewProductionFromDoc(doc *goquery.Document) ([]Quantifiable, error)
	ExtractFleet1ShipsFromDoc(doc *goquery.Document) (s ShipsInfos)
	ExtractEspionageReportMessageIDsFromDoc(doc *goquery.Document) ([]EspionageReportSummary, int64)
	ExtractCombatReportMessagesFromDoc(doc *goquery.Document) ([]CombatReportSummary, int64)
	ExtractExpeditionMessagesFromDoc(doc *goquery.Document, location *time.Location) ([]ExpeditionMessage, int64, error)
	ExtractEspionageReportFromDoc(doc *goquery.Document, location *time.Location) (EspionageReport, error)
	ExtractResourcesProductionsFromDoc(doc *goquery.Document) (Resources, error)
	ExtractPreferencesFromDoc(doc *goquery.Document) Preferences
	ExtractResourceSettingsFromDoc(doc *goquery.Document) (ResourceSettings, error)
	ExtractFleetsFromEventListFromDoc(doc *goquery.Document) []Fleet
	ExtractIPMFromDoc(doc *goquery.Document) (duration, max int64, token string)
	ExtractFleetsFromDoc(doc *goquery.Document) (res []Fleet)
	ExtractSlotsFromDoc(doc *goquery.Document) Slots
	ExtractServerTimeFromDoc(doc *goquery.Document) (time.Time, error)
	ExtractSpioAnzFromDoc(doc *goquery.Document) int64
	ExtractDisableChatBarFromDoc(doc *goquery.Document) bool
	ExtractDisableOutlawWarningFromDoc(doc *goquery.Document) bool
	ExtractMobileVersionFromDoc(doc *goquery.Document) bool
	ExtractShowOldDropDownsFromDoc(doc *goquery.Document) bool
	ExtractActivateAutofocusFromDoc(doc *goquery.Document) bool
	ExtractEventsShowFromDoc(doc *goquery.Document) int64
	ExtractSortSettingFromDoc(doc *goquery.Document) int64
	ExtractSortOrderFromDoc(doc *goquery.Document) int64
	ExtractShowDetailOverlayFromDoc(doc *goquery.Document) bool
	ExtractAnimatedSlidersFromDoc(doc *goquery.Document) bool
	ExtractAnimatedOverviewFromDoc(doc *goquery.Document) bool
	ExtractPopupsNoticesFromDoc(doc *goquery.Document) bool
	ExtractPopopsCombatreportFromDoc(doc *goquery.Document) bool
	ExtractSpioReportPicturesFromDoc(doc *goquery.Document) bool
	ExtractMsgResultsPerPageFromDoc(doc *goquery.Document) int64
	ExtractAuctioneerNotificationsFromDoc(doc *goquery.Document) bool
	ExtractEconomyNotificationsFromDoc(doc *goquery.Document) bool
	ExtractShowActivityMinutesFromDoc(doc *goquery.Document) bool
	ExtractPreserveSystemOnPlanetChangeFromDoc(doc *goquery.Document) bool
	ExtractNotifBuildListFromDoc(doc *goquery.Document) bool
	ExtractNotifFriendlyFleetActivitiesFromDoc(doc *goquery.Document) bool
	ExtractNotifHostileFleetActivitiesFromDoc(doc *goquery.Document) bool
	ExtractNotifForeignEspionageFromDoc(doc *goquery.Document) bool
	ExtractNotifAllianceBroadcastsFromDoc(doc *goquery.Document) bool
	ExtractNotifAllianceMessagesFromDoc(doc *goquery.Document) bool
	ExtractNotifAuctionsFromDoc(doc *goquery.Document) bool
	ExtractNotifAccountFromDoc(doc *goquery.Document) bool
	ExtractPlanetCoordinate(pageHTML []byte) (Coordinate, error)
	ExtractPlanetID(pageHTML []byte) (CelestialID, error)
	ExtractPlanetIDFromDoc(doc *goquery.Document) (CelestialID, error)
	ExtractOverviewShipSumCountdownFromBytes(pageHTML []byte) int64
	ExtractOGameTimestampFromBytes(pageHTML []byte) int64
	ExtractPlanetType(pageHTML []byte) (CelestialType, error)
	ExtractPlanetTypeFromDoc(doc *goquery.Document) (CelestialType, error)
	ExtractAjaxChatToken(pageHTML []byte) (string, error)
	ExtractUserInfos(pageHTML []byte, lang string) (UserInfos, error)
	ExtractResourcesDetails(pageHTML []byte) (out ResourcesDetails, err error)
	ExtractCoord(v string) (coord Coordinate)
	ExtractGalaxyInfos(pageHTML []byte, botPlayerName string, botPlayerID, botPlayerRank int64) (SystemInfos, error)
	ExtractPhalanx(pageHTML []byte) ([]Fleet, error)
	ExtractJumpGate(pageHTML []byte) (ShipsInfos, string, []MoonID, int64)
	ExtractFederation(pageHTML []byte) url.Values
	ExtractConstructions(pageHTML []byte) (buildingID ID, buildingCountdown int64, researchID ID, researchCountdown int64)
	ExtractFleetDeutSaveFactor(pageHTML []byte) float64
	ExtractCancelBuildingInfos(pageHTML []byte) (token string, techID, listID int64, err error)
	ExtractCancelResearchInfos(pageHTML []byte) (token string, techID, listID int64, err error)
	ExtractEmpire(pageHTML []byte, nbr int64) (interface{}, error)
	ExtractCharacterClass(pageHTML []byte) (CharacterClass, error)
	ExtractCharacterClassFromDoc(doc *goquery.Document) (CharacterClass, error)
	ExtractCommander(pageHTML []byte) bool
	ExtractAdmiral(pageHTML []byte) bool
	ExtractEngineer(pageHTML []byte) bool
	ExtractGeologist(pageHTML []byte) bool
	ExtractTechnocrat(pageHTML []byte) bool
	ExtractCommanderFromDoc(doc *goquery.Document) bool
	ExtractAdmiralFromDoc(doc *goquery.Document) bool
	ExtractEngineerFromDoc(doc *goquery.Document) bool
	ExtractGeologistFromDoc(doc *goquery.Document) bool
	ExtractTechnocratFromDoc(doc *goquery.Document) bool
	ExtractAuction(pageHTML []byte) (Auction, error)
	ExtractHighscore(pageHTML []byte) (Highscore, error)
	ExtractHighscoreFromDoc(doc *goquery.Document) (Highscore, error)
	ExtractAllResources(pageHTML []byte) (map[CelestialID]Resources, error)
	ExtractDMCosts(pageHTML []byte) (DMCosts, error)
	ExtractBuffActivation(pageHTML []byte) (string, []Item, error)
	ExtractIsMobile(pageHTML []byte) bool
	ExtractIsMobileFromDoc(doc *goquery.Document) bool
}

Extractor ...

type ExtractorV6

type ExtractorV6 struct {
}

ExtractorV6 ...

func NewExtractorV6

func NewExtractorV6() *ExtractorV6

NewExtractorV6 ...

func (ExtractorV6) ExtractActivateAutofocusFromDoc

func (e ExtractorV6) ExtractActivateAutofocusFromDoc(doc *goquery.Document) bool

ExtractActivateAutofocusFromDoc ...

func (ExtractorV6) ExtractAdmiral

func (e ExtractorV6) ExtractAdmiral(pageHTML []byte) bool

ExtractAdmiral ...

func (ExtractorV6) ExtractAdmiralFromDoc

func (e ExtractorV6) ExtractAdmiralFromDoc(doc *goquery.Document) bool

ExtractAdmiralFromDoc ...

func (ExtractorV6) ExtractAjaxChatToken

func (e ExtractorV6) ExtractAjaxChatToken(pageHTML []byte) (string, error)

ExtractAjaxChatToken ...

func (ExtractorV6) ExtractAllResources

func (e ExtractorV6) ExtractAllResources(pageHTML []byte) (map[CelestialID]Resources, error)

ExtractAllResources ...

func (ExtractorV6) ExtractAnimatedOverviewFromDoc

func (e ExtractorV6) ExtractAnimatedOverviewFromDoc(doc *goquery.Document) bool

ExtractAnimatedOverviewFromDoc ...

func (ExtractorV6) ExtractAnimatedSlidersFromDoc

func (e ExtractorV6) ExtractAnimatedSlidersFromDoc(doc *goquery.Document) bool

ExtractAnimatedSlidersFromDoc ...

func (ExtractorV6) ExtractAttacks

func (e ExtractorV6) ExtractAttacks(pageHTML []byte) ([]AttackEvent, error)

ExtractAttacks ...

func (ExtractorV6) ExtractAttacksFromDoc

func (e ExtractorV6) ExtractAttacksFromDoc(doc *goquery.Document, clock clockwork.Clock) ([]AttackEvent, error)

ExtractAttacksFromDoc ...

func (ExtractorV6) ExtractAuction

func (e ExtractorV6) ExtractAuction(pageHTML []byte) (Auction, error)

ExtractAuction ...

func (ExtractorV6) ExtractAuctioneerNotificationsFromDoc

func (e ExtractorV6) ExtractAuctioneerNotificationsFromDoc(doc *goquery.Document) bool

ExtractAuctioneerNotificationsFromDoc ...

func (ExtractorV6) ExtractBodyIDFromDoc

func (e ExtractorV6) ExtractBodyIDFromDoc(doc *goquery.Document) string

ExtractBodyIDFromDoc ...

func (ExtractorV6) ExtractBuffActivation

func (e ExtractorV6) ExtractBuffActivation(pageHTML []byte) (string, []Item, error)

ExtractBuffActivation ...

func (ExtractorV6) ExtractCancelBuildingInfos

func (e ExtractorV6) ExtractCancelBuildingInfos(pageHTML []byte) (token string, techID, listID int64, err error)

ExtractCancelBuildingInfos ...

func (ExtractorV6) ExtractCancelResearchInfos

func (e ExtractorV6) ExtractCancelResearchInfos(pageHTML []byte) (token string, techID, listID int64, err error)

ExtractCancelResearchInfos ...

func (ExtractorV6) ExtractCelestial

func (e ExtractorV6) ExtractCelestial(pageHTML []byte, b *OGame, v interface{}) (Celestial, error)

ExtractCelestial ...

func (ExtractorV6) ExtractCelestialByIDFromDoc

func (e ExtractorV6) ExtractCelestialByIDFromDoc(doc *goquery.Document, b *OGame, celestialID CelestialID) (Celestial, error)

ExtractCelestialByIDFromDoc ...

func (ExtractorV6) ExtractCelestialFromDoc

func (e ExtractorV6) ExtractCelestialFromDoc(doc *goquery.Document, b *OGame, v interface{}) (Celestial, error)

ExtractCelestialFromDoc ...

func (ExtractorV6) ExtractCelestials

func (e ExtractorV6) ExtractCelestials(pageHTML []byte, b *OGame) ([]Celestial, error)

ExtractCelestials ...

func (ExtractorV6) ExtractCelestialsFromDoc

func (e ExtractorV6) ExtractCelestialsFromDoc(doc *goquery.Document, b *OGame) ([]Celestial, error)

ExtractCelestialsFromDoc ...

func (ExtractorV6) ExtractCharacterClass

func (e ExtractorV6) ExtractCharacterClass(pageHTML []byte) (CharacterClass, error)

ExtractCharacterClass ...

func (ExtractorV6) ExtractCharacterClassFromDoc

func (e ExtractorV6) ExtractCharacterClassFromDoc(doc *goquery.Document) (CharacterClass, error)

ExtractCharacterClassFromDoc ...

func (ExtractorV6) ExtractCombatReportMessagesFromDoc

func (e ExtractorV6) ExtractCombatReportMessagesFromDoc(doc *goquery.Document) ([]CombatReportSummary, int64)

ExtractCombatReportMessagesFromDoc ...

func (ExtractorV6) ExtractCombatReportMessagesSummary

func (e ExtractorV6) ExtractCombatReportMessagesSummary(pageHTML []byte) ([]CombatReportSummary, int64)

ExtractCombatReportMessagesSummary ...

func (ExtractorV6) ExtractCommander

func (e ExtractorV6) ExtractCommander(pageHTML []byte) bool

ExtractCommander ...

func (ExtractorV6) ExtractCommanderFromDoc

func (e ExtractorV6) ExtractCommanderFromDoc(doc *goquery.Document) bool

ExtractCommanderFromDoc ...

func (ExtractorV6) ExtractConstructions

func (e ExtractorV6) ExtractConstructions(pageHTML []byte) (buildingID ID, buildingCountdown int64, researchID ID, researchCountdown int64)

ExtractConstructions ...

func (ExtractorV6) ExtractCoord

func (e ExtractorV6) ExtractCoord(v string) (coord Coordinate)

ExtractCoord ...

func (ExtractorV6) ExtractDMCosts

func (e ExtractorV6) ExtractDMCosts(pageHTML []byte) (DMCosts, error)

ExtractDMCosts ...

func (ExtractorV6) ExtractDefense

func (e ExtractorV6) ExtractDefense(pageHTML []byte) (DefensesInfos, error)

ExtractDefense ...

func (ExtractorV6) ExtractDefenseFromDoc

func (e ExtractorV6) ExtractDefenseFromDoc(doc *goquery.Document) (DefensesInfos, error)

ExtractDefenseFromDoc ...

func (ExtractorV6) ExtractDisableChatBarFromDoc

func (e ExtractorV6) ExtractDisableChatBarFromDoc(doc *goquery.Document) bool

ExtractDisableChatBarFromDoc ...

func (ExtractorV6) ExtractDisableOutlawWarningFromDoc

func (e ExtractorV6) ExtractDisableOutlawWarningFromDoc(doc *goquery.Document) bool

ExtractDisableOutlawWarningFromDoc ...

func (ExtractorV6) ExtractEconomyNotificationsFromDoc

func (e ExtractorV6) ExtractEconomyNotificationsFromDoc(doc *goquery.Document) bool

ExtractEconomyNotificationsFromDoc ...

func (ExtractorV6) ExtractEmpire

func (e ExtractorV6) ExtractEmpire(pageHTML []byte, nbr int64) (interface{}, error)

ExtractEmpire ...

func (ExtractorV6) ExtractEngineer

func (e ExtractorV6) ExtractEngineer(pageHTML []byte) bool

ExtractEngineer ...

func (ExtractorV6) ExtractEngineerFromDoc

func (e ExtractorV6) ExtractEngineerFromDoc(doc *goquery.Document) bool

ExtractEngineerFromDoc ...

func (ExtractorV6) ExtractEspionageReport

func (e ExtractorV6) ExtractEspionageReport(pageHTML []byte, location *time.Location) (EspionageReport, error)

ExtractEspionageReport ...

func (ExtractorV6) ExtractEspionageReportFromDoc

func (e ExtractorV6) ExtractEspionageReportFromDoc(doc *goquery.Document, location *time.Location) (EspionageReport, error)

ExtractEspionageReportFromDoc ...

func (ExtractorV6) ExtractEspionageReportMessageIDs

func (e ExtractorV6) ExtractEspionageReportMessageIDs(pageHTML []byte) ([]EspionageReportSummary, int64)

ExtractEspionageReportMessageIDs ...

func (ExtractorV6) ExtractEspionageReportMessageIDsFromDoc

func (e ExtractorV6) ExtractEspionageReportMessageIDsFromDoc(doc *goquery.Document) ([]EspionageReportSummary, int64)

ExtractEspionageReportMessageIDsFromDoc ...

func (ExtractorV6) ExtractEventsShowFromDoc

func (e ExtractorV6) ExtractEventsShowFromDoc(doc *goquery.Document) int64

ExtractEventsShowFromDoc ...

func (ExtractorV6) ExtractExpeditionMessages

func (e ExtractorV6) ExtractExpeditionMessages(pageHTML []byte, location *time.Location) ([]ExpeditionMessage, int64, error)

ExtractExpeditionMessages ...

func (ExtractorV6) ExtractExpeditionMessagesFromDoc

func (e ExtractorV6) ExtractExpeditionMessagesFromDoc(doc *goquery.Document, location *time.Location) ([]ExpeditionMessage, int64, error)

ExtractExpeditionMessagesFromDoc ...

func (ExtractorV6) ExtractFacilities

func (e ExtractorV6) ExtractFacilities(pageHTML []byte) (Facilities, error)

ExtractFacilities ...

func (ExtractorV6) ExtractFacilitiesFromDoc

func (e ExtractorV6) ExtractFacilitiesFromDoc(doc *goquery.Document) (Facilities, error)

ExtractFacilitiesFromDoc ...

func (ExtractorV6) ExtractFederation

func (e ExtractorV6) ExtractFederation(pageHTML []byte) url.Values

ExtractFederation ...

func (ExtractorV6) ExtractFleet1Ships

func (e ExtractorV6) ExtractFleet1Ships(pageHTML []byte) ShipsInfos

ExtractFleet1Ships ...

func (ExtractorV6) ExtractFleet1ShipsFromDoc

func (e ExtractorV6) ExtractFleet1ShipsFromDoc(doc *goquery.Document) (s ShipsInfos)

ExtractFleet1ShipsFromDoc ...

func (ExtractorV6) ExtractFleetDeutSaveFactor

func (e ExtractorV6) ExtractFleetDeutSaveFactor(pageHTML []byte) float64

ExtractFleetDeutSaveFactor extract fleet deut save factor

func (ExtractorV6) ExtractFleets

func (e ExtractorV6) ExtractFleets(pageHTML []byte) (res []Fleet)

ExtractFleets ...

func (ExtractorV6) ExtractFleetsFromDoc

func (e ExtractorV6) ExtractFleetsFromDoc(doc *goquery.Document) (res []Fleet)

ExtractFleetsFromDoc ...

func (ExtractorV6) ExtractFleetsFromEventList

func (e ExtractorV6) ExtractFleetsFromEventList(pageHTML []byte) []Fleet

ExtractFleetsFromEventList ...

func (ExtractorV6) ExtractFleetsFromEventListFromDoc

func (e ExtractorV6) ExtractFleetsFromEventListFromDoc(doc *goquery.Document) []Fleet

ExtractFleetsFromEventListFromDoc ...

func (ExtractorV6) ExtractGalaxyInfos

func (e ExtractorV6) ExtractGalaxyInfos(pageHTML []byte, botPlayerName string, botPlayerID, botPlayerRank int64) (SystemInfos, error)

ExtractGalaxyInfos ...

func (ExtractorV6) ExtractGeologist

func (e ExtractorV6) ExtractGeologist(pageHTML []byte) bool

ExtractGeologist ...

func (ExtractorV6) ExtractGeologistFromDoc

func (e ExtractorV6) ExtractGeologistFromDoc(doc *goquery.Document) bool

ExtractGeologistFromDoc ...

func (ExtractorV6) ExtractHiddenFields

func (e ExtractorV6) ExtractHiddenFields(pageHTML []byte) (fields url.Values)

ExtractHiddenFields utils function to extract hidden input from a page

func (ExtractorV6) ExtractHiddenFieldsFromDoc

func (e ExtractorV6) ExtractHiddenFieldsFromDoc(doc *goquery.Document) url.Values

ExtractHiddenFieldsFromDoc utils function to extract hidden input from a page

func (ExtractorV6) ExtractHighscore

func (e ExtractorV6) ExtractHighscore(pageHTML []byte) (Highscore, error)

ExtractHighscore ...

func (ExtractorV6) ExtractHighscoreFromDoc

func (e ExtractorV6) ExtractHighscoreFromDoc(doc *goquery.Document) (Highscore, error)

ExtractHighscoreFromDoc ...

func (ExtractorV6) ExtractIPM

func (e ExtractorV6) ExtractIPM(pageHTML []byte) (duration, max int64, token string)

ExtractIPM ...

func (ExtractorV6) ExtractIPMFromDoc

func (e ExtractorV6) ExtractIPMFromDoc(doc *goquery.Document) (duration, max int64, token string)

ExtractIPMFromDoc ...

func (ExtractorV6) ExtractIsInVacation

func (e ExtractorV6) ExtractIsInVacation(pageHTML []byte) bool

ExtractIsInVacation ...

func (ExtractorV6) ExtractIsInVacationFromDoc

func (e ExtractorV6) ExtractIsInVacationFromDoc(doc *goquery.Document) bool

ExtractIsInVacationFromDoc ...

func (ExtractorV6) ExtractIsMobile

func (e ExtractorV6) ExtractIsMobile(pageHTML []byte) bool

ExtractIsMobile ...

func (ExtractorV6) ExtractIsMobileFromDoc

func (e ExtractorV6) ExtractIsMobileFromDoc(doc *goquery.Document) bool

ExtractIsMobileFromDoc ...

func (ExtractorV6) ExtractJumpGate

func (e ExtractorV6) ExtractJumpGate(pageHTML []byte) (ShipsInfos, string, []MoonID, int64)

ExtractJumpGate return the available ships to send, form token, possible moon IDs and wait time (if any) given a jump gate popup html.

func (ExtractorV6) ExtractMarketplaceMessages

func (e ExtractorV6) ExtractMarketplaceMessages(pageHTML []byte, location *time.Location) ([]MarketplaceMessage, int64, error)

ExtractMarketplaceMessages ...

func (ExtractorV6) ExtractMobileVersionFromDoc

func (e ExtractorV6) ExtractMobileVersionFromDoc(doc *goquery.Document) bool

ExtractMobileVersionFromDoc ...

func (ExtractorV6) ExtractMoon

func (e ExtractorV6) ExtractMoon(pageHTML []byte, b *OGame, v interface{}) (Moon, error)

ExtractMoon ...

func (ExtractorV6) ExtractMoonByCoord

func (e ExtractorV6) ExtractMoonByCoord(pageHTML []byte, b *OGame, coord Coordinate) (Moon, error)

ExtractMoonByCoord ...

func (ExtractorV6) ExtractMoonByCoordFromDoc

func (e ExtractorV6) ExtractMoonByCoordFromDoc(doc *goquery.Document, b *OGame, coord Coordinate) (Moon, error)

ExtractMoonByCoordFromDoc ...

func (ExtractorV6) ExtractMoonByIDFromDoc

func (e ExtractorV6) ExtractMoonByIDFromDoc(doc *goquery.Document, b *OGame, moonID MoonID) (Moon, error)

ExtractMoonByIDFromDoc ...

func (ExtractorV6) ExtractMoonFromDoc

func (e ExtractorV6) ExtractMoonFromDoc(doc *goquery.Document, b *OGame, v interface{}) (Moon, error)

ExtractMoonFromDoc ...

func (ExtractorV6) ExtractMoons

func (e ExtractorV6) ExtractMoons(pageHTML []byte, b *OGame) []Moon

ExtractMoons ...

func (ExtractorV6) ExtractMoonsFromDoc

func (e ExtractorV6) ExtractMoonsFromDoc(doc *goquery.Document, b *OGame) []Moon

ExtractMoonsFromDoc ...

func (ExtractorV6) ExtractMsgResultsPerPageFromDoc

func (e ExtractorV6) ExtractMsgResultsPerPageFromDoc(doc *goquery.Document) int64

ExtractMsgResultsPerPageFromDoc ...

func (ExtractorV6) ExtractNotifAccountFromDoc

func (e ExtractorV6) ExtractNotifAccountFromDoc(doc *goquery.Document) bool

ExtractNotifAccountFromDoc ...

func (ExtractorV6) ExtractNotifAllianceBroadcastsFromDoc

func (e ExtractorV6) ExtractNotifAllianceBroadcastsFromDoc(doc *goquery.Document) bool

ExtractNotifAllianceBroadcastsFromDoc ...

func (ExtractorV6) ExtractNotifAllianceMessagesFromDoc

func (e ExtractorV6) ExtractNotifAllianceMessagesFromDoc(doc *goquery.Document) bool

ExtractNotifAllianceMessagesFromDoc ...

func (ExtractorV6) ExtractNotifAuctionsFromDoc

func (e ExtractorV6) ExtractNotifAuctionsFromDoc(doc *goquery.Document) bool

ExtractNotifAuctionsFromDoc ...

func (ExtractorV6) ExtractNotifBuildListFromDoc

func (e ExtractorV6) ExtractNotifBuildListFromDoc(doc *goquery.Document) bool

ExtractNotifBuildListFromDoc ...

func (ExtractorV6) ExtractNotifForeignEspionageFromDoc

func (e ExtractorV6) ExtractNotifForeignEspionageFromDoc(doc *goquery.Document) bool

ExtractNotifForeignEspionageFromDoc ...

func (ExtractorV6) ExtractNotifFriendlyFleetActivitiesFromDoc

func (e ExtractorV6) ExtractNotifFriendlyFleetActivitiesFromDoc(doc *goquery.Document) bool

ExtractNotifFriendlyFleetActivitiesFromDoc ...

func (ExtractorV6) ExtractNotifHostileFleetActivitiesFromDoc

func (e ExtractorV6) ExtractNotifHostileFleetActivitiesFromDoc(doc *goquery.Document) bool

ExtractNotifHostileFleetActivitiesFromDoc ...

func (ExtractorV6) ExtractOGameSession

func (e ExtractorV6) ExtractOGameSession(pageHTML []byte) string

ExtractOGameSession ...

func (ExtractorV6) ExtractOGameSessionFromDoc

func (e ExtractorV6) ExtractOGameSessionFromDoc(doc *goquery.Document) string

ExtractOGameSessionFromDoc ...

func (ExtractorV6) ExtractOGameTimestampFromBytes

func (e ExtractorV6) ExtractOGameTimestampFromBytes(pageHTML []byte) int64

ExtractOGameTimestampFromBytes extracts ogame timestamp from an html page

func (ExtractorV6) ExtractOfferOfTheDay

func (e ExtractorV6) ExtractOfferOfTheDay(pageHTML []byte) (int64, string, PlanetResources, Multiplier, error)

ExtractOfferOfTheDay ...

func (ExtractorV6) ExtractOfferOfTheDayFromDoc

func (e ExtractorV6) ExtractOfferOfTheDayFromDoc(doc *goquery.Document) (price int64, importToken string, planetResources PlanetResources, multiplier Multiplier, err error)

ExtractOfferOfTheDayFromDoc ...

func (ExtractorV6) ExtractOgameTimestamp

func (e ExtractorV6) ExtractOgameTimestamp(pageHTML []byte) int64

ExtractOgameTimestamp ...

func (ExtractorV6) ExtractOgameTimestampFromDoc

func (e ExtractorV6) ExtractOgameTimestampFromDoc(doc *goquery.Document) int64

ExtractOgameTimestampFromDoc ...

func (ExtractorV6) ExtractOverviewProduction

func (e ExtractorV6) ExtractOverviewProduction(pageHTML []byte) ([]Quantifiable, int64, error)

ExtractOverviewProduction extracts ships/defenses (partial) production from the overview page

func (ExtractorV6) ExtractOverviewProductionFromDoc

func (e ExtractorV6) ExtractOverviewProductionFromDoc(doc *goquery.Document) ([]Quantifiable, error)

ExtractOverviewProductionFromDoc extracts ships/defenses (partial) production from the overview page

func (ExtractorV6) ExtractOverviewShipSumCountdownFromBytes

func (e ExtractorV6) ExtractOverviewShipSumCountdownFromBytes(pageHTML []byte) int64

ExtractOverviewShipSumCountdownFromBytes ...

func (ExtractorV6) ExtractPhalanx

func (e ExtractorV6) ExtractPhalanx(pageHTML []byte) ([]Fleet, error)

ExtractPhalanx ...

func (ExtractorV6) ExtractPlanet

func (e ExtractorV6) ExtractPlanet(pageHTML []byte, v interface{}, b *OGame) (Planet, error)

ExtractPlanet ...

func (ExtractorV6) ExtractPlanetByCoord

func (e ExtractorV6) ExtractPlanetByCoord(pageHTML []byte, b *OGame, coord Coordinate) (Planet, error)

ExtractPlanetByCoord ...

func (ExtractorV6) ExtractPlanetByCoordFromDoc

func (e ExtractorV6) ExtractPlanetByCoordFromDoc(doc *goquery.Document, b *OGame, coord Coordinate) (Planet, error)

ExtractPlanetByCoordFromDoc ...

func (ExtractorV6) ExtractPlanetByIDFromDoc

func (e ExtractorV6) ExtractPlanetByIDFromDoc(doc *goquery.Document, b *OGame, planetID PlanetID) (Planet, error)

ExtractPlanetByIDFromDoc ...

func (ExtractorV6) ExtractPlanetCoordinate

func (e ExtractorV6) ExtractPlanetCoordinate(pageHTML []byte) (Coordinate, error)

ExtractPlanetCoordinate extracts planet coordinate from html page

func (ExtractorV6) ExtractPlanetFromDoc

func (e ExtractorV6) ExtractPlanetFromDoc(doc *goquery.Document, v interface{}, b *OGame) (Planet, error)

ExtractPlanetFromDoc ...

func (ExtractorV6) ExtractPlanetID

func (e ExtractorV6) ExtractPlanetID(pageHTML []byte) (CelestialID, error)

ExtractPlanetID extracts planet id from html page

func (ExtractorV6) ExtractPlanetIDFromDoc

func (e ExtractorV6) ExtractPlanetIDFromDoc(doc *goquery.Document) (CelestialID, error)

ExtractPlanetIDFromDoc extracts planet id from doc

func (ExtractorV6) ExtractPlanetType

func (e ExtractorV6) ExtractPlanetType(pageHTML []byte) (CelestialType, error)

ExtractPlanetType extracts planet type from html page

func (ExtractorV6) ExtractPlanetTypeFromDoc

func (e ExtractorV6) ExtractPlanetTypeFromDoc(doc *goquery.Document) (CelestialType, error)

ExtractPlanetTypeFromDoc extracts planet type from doc

func (ExtractorV6) ExtractPlanets

func (e ExtractorV6) ExtractPlanets(pageHTML []byte, b *OGame) []Planet

ExtractPlanets ...

func (ExtractorV6) ExtractPlanetsFromDoc

func (e ExtractorV6) ExtractPlanetsFromDoc(doc *goquery.Document, b *OGame) []Planet

ExtractPlanetsFromDoc ...

func (ExtractorV6) ExtractPopopsCombatreportFromDoc

func (e ExtractorV6) ExtractPopopsCombatreportFromDoc(doc *goquery.Document) bool

ExtractPopopsCombatreportFromDoc ...

func (ExtractorV6) ExtractPopupsNoticesFromDoc

func (e ExtractorV6) ExtractPopupsNoticesFromDoc(doc *goquery.Document) bool

ExtractPopupsNoticesFromDoc ...

func (ExtractorV6) ExtractPreferences

func (e ExtractorV6) ExtractPreferences(pageHTML []byte) Preferences

ExtractPreferences ...

func (ExtractorV6) ExtractPreferencesFromDoc

func (e ExtractorV6) ExtractPreferencesFromDoc(doc *goquery.Document) Preferences

ExtractPreferencesFromDoc ...

func (ExtractorV6) ExtractPreferencesShowActivityMinutes

func (e ExtractorV6) ExtractPreferencesShowActivityMinutes(pageHTML []byte) bool

ExtractPreferencesShowActivityMinutes ...

func (ExtractorV6) ExtractPreserveSystemOnPlanetChangeFromDoc

func (e ExtractorV6) ExtractPreserveSystemOnPlanetChangeFromDoc(doc *goquery.Document) bool

ExtractPreserveSystemOnPlanetChangeFromDoc ...

func (ExtractorV6) ExtractProduction

func (e ExtractorV6) ExtractProduction(pageHTML []byte) ([]Quantifiable, int64, error)

ExtractProduction extracts ships/defenses production from the shipyard page

func (ExtractorV6) ExtractProductionFromDoc

func (e ExtractorV6) ExtractProductionFromDoc(doc *goquery.Document) ([]Quantifiable, error)

ExtractProductionFromDoc extracts ships/defenses production from the shipyard page

func (ExtractorV6) ExtractResearch

func (e ExtractorV6) ExtractResearch(pageHTML []byte) Researches

ExtractResearch ...

func (ExtractorV6) ExtractResearchFromDoc

func (e ExtractorV6) ExtractResearchFromDoc(doc *goquery.Document) Researches

ExtractResearchFromDoc ...

func (ExtractorV6) ExtractResourceSettings

func (e ExtractorV6) ExtractResourceSettings(pageHTML []byte) (ResourceSettings, error)

ExtractResourceSettings ...

func (ExtractorV6) ExtractResourceSettingsFromDoc

func (e ExtractorV6) ExtractResourceSettingsFromDoc(doc *goquery.Document) (ResourceSettings, error)

ExtractResourceSettingsFromDoc ...

func (ExtractorV6) ExtractResources

func (e ExtractorV6) ExtractResources(pageHTML []byte) Resources

ExtractResources ...

func (ExtractorV6) ExtractResourcesBuildings

func (e ExtractorV6) ExtractResourcesBuildings(pageHTML []byte) (ResourcesBuildings, error)

ExtractResourcesBuildings ...

func (ExtractorV6) ExtractResourcesBuildingsFromDoc

func (e ExtractorV6) ExtractResourcesBuildingsFromDoc(doc *goquery.Document) (ResourcesBuildings, error)

ExtractResourcesBuildingsFromDoc ...

func (ExtractorV6) ExtractResourcesDetails

func (e ExtractorV6) ExtractResourcesDetails(pageHTML []byte) (out ResourcesDetails, err error)

ExtractResourcesDetails ...

func (ExtractorV6) ExtractResourcesDetailsFromFullPage

func (e ExtractorV6) ExtractResourcesDetailsFromFullPage(pageHTML []byte) ResourcesDetails

ExtractResourcesDetailsFromFullPage ...

func (ExtractorV6) ExtractResourcesDetailsFromFullPageFromDoc

func (e ExtractorV6) ExtractResourcesDetailsFromFullPageFromDoc(doc *goquery.Document) ResourcesDetails

ExtractResourcesDetailsFromFullPageFromDoc ...

func (ExtractorV6) ExtractResourcesFromDoc

func (e ExtractorV6) ExtractResourcesFromDoc(doc *goquery.Document) Resources

ExtractResourcesFromDoc ...

func (ExtractorV6) ExtractResourcesProductions

func (e ExtractorV6) ExtractResourcesProductions(pageHTML []byte) (Resources, error)

ExtractResourcesProductions ...

func (ExtractorV6) ExtractResourcesProductionsFromDoc

func (e ExtractorV6) ExtractResourcesProductionsFromDoc(doc *goquery.Document) (Resources, error)

ExtractResourcesProductionsFromDoc ...

func (ExtractorV6) ExtractServerTime

func (e ExtractorV6) ExtractServerTime(pageHTML []byte) (time.Time, error)

ExtractServerTime ...

func (ExtractorV6) ExtractServerTimeFromDoc

func (e ExtractorV6) ExtractServerTimeFromDoc(doc *goquery.Document) (time.Time, error)

ExtractServerTimeFromDoc ...

func (ExtractorV6) ExtractShips

func (e ExtractorV6) ExtractShips(pageHTML []byte) (ShipsInfos, error)

ExtractShips ...

func (ExtractorV6) ExtractShipsFromDoc

func (e ExtractorV6) ExtractShipsFromDoc(doc *goquery.Document) (ShipsInfos, error)

ExtractShipsFromDoc ...

func (ExtractorV6) ExtractShowActivityMinutesFromDoc

func (e ExtractorV6) ExtractShowActivityMinutesFromDoc(doc *goquery.Document) bool

ExtractShowActivityMinutesFromDoc ...

func (ExtractorV6) ExtractShowDetailOverlayFromDoc

func (e ExtractorV6) ExtractShowDetailOverlayFromDoc(doc *goquery.Document) bool

ExtractShowDetailOverlayFromDoc ...

func (ExtractorV6) ExtractShowOldDropDownsFromDoc

func (e ExtractorV6) ExtractShowOldDropDownsFromDoc(doc *goquery.Document) bool

ExtractShowOldDropDownsFromDoc ...

func (ExtractorV6) ExtractSlots

func (e ExtractorV6) ExtractSlots(pageHTML []byte) Slots

ExtractSlots ...

func (ExtractorV6) ExtractSlotsFromDoc

func (e ExtractorV6) ExtractSlotsFromDoc(doc *goquery.Document) Slots

ExtractSlotsFromDoc extract fleet slots from page "fleet1" page "movement" redirect to "fleet1" when there is no fleet

func (ExtractorV6) ExtractSortOrderFromDoc

func (e ExtractorV6) ExtractSortOrderFromDoc(doc *goquery.Document) int64

ExtractSortOrderFromDoc ...

func (ExtractorV6) ExtractSortSettingFromDoc

func (e ExtractorV6) ExtractSortSettingFromDoc(doc *goquery.Document) int64

ExtractSortSettingFromDoc ...

func (ExtractorV6) ExtractSpioAnz

func (e ExtractorV6) ExtractSpioAnz(pageHTML []byte) int64

ExtractSpioAnz ...

func (ExtractorV6) ExtractSpioAnzFromDoc

func (e ExtractorV6) ExtractSpioAnzFromDoc(doc *goquery.Document) int64

ExtractSpioAnzFromDoc ...

func (ExtractorV6) ExtractSpioReportPicturesFromDoc

func (e ExtractorV6) ExtractSpioReportPicturesFromDoc(doc *goquery.Document) bool

ExtractSpioReportPicturesFromDoc ...

func (ExtractorV6) ExtractTechnocrat

func (e ExtractorV6) ExtractTechnocrat(pageHTML []byte) bool

ExtractTechnocrat ...

func (ExtractorV6) ExtractTechnocratFromDoc

func (e ExtractorV6) ExtractTechnocratFromDoc(doc *goquery.Document) bool

ExtractTechnocratFromDoc ...

func (ExtractorV6) ExtractUserInfos

func (e ExtractorV6) ExtractUserInfos(pageHTML []byte, lang string) (UserInfos, error)

ExtractUserInfos ...

type ExtractorV7

type ExtractorV7 struct {
	ExtractorV6
}

ExtractorV7 ...

func NewExtractorV7

func NewExtractorV7() *ExtractorV7

NewExtractorV7 ...

func (ExtractorV7) ExtractCancelBuildingInfos

func (e ExtractorV7) ExtractCancelBuildingInfos(pageHTML []byte) (token string, techID, listID int64, err error)

ExtractCancelBuildingInfos ...

func (ExtractorV7) ExtractCancelResearchInfos

func (e ExtractorV7) ExtractCancelResearchInfos(pageHTML []byte) (token string, techID, listID int64, err error)

ExtractCancelResearchInfos ...

func (ExtractorV7) ExtractCharacterClass

func (e ExtractorV7) ExtractCharacterClass(pageHTML []byte) (CharacterClass, error)

ExtractCharacterClass ...

func (ExtractorV7) ExtractCharacterClassFromDoc

func (e ExtractorV7) ExtractCharacterClassFromDoc(doc *goquery.Document) (CharacterClass, error)

ExtractCharacterClassFromDoc ...

func (ExtractorV7) ExtractCombatReportMessagesFromDoc

func (e ExtractorV7) ExtractCombatReportMessagesFromDoc(doc *goquery.Document) ([]CombatReportSummary, int64)

ExtractCombatReportMessagesFromDoc ...

func (ExtractorV7) ExtractCombatReportMessagesSummary

func (e ExtractorV7) ExtractCombatReportMessagesSummary(pageHTML []byte) ([]CombatReportSummary, int64)

ExtractCombatReportMessagesSummary ...

func (ExtractorV7) ExtractConstructions

func (e ExtractorV7) ExtractConstructions(pageHTML []byte) (buildingID ID, buildingCountdown int64, researchID ID, researchCountdown int64)

ExtractConstructions ...

func (ExtractorV7) ExtractDefense

func (e ExtractorV7) ExtractDefense(pageHTML []byte) (DefensesInfos, error)

ExtractDefense ...

func (ExtractorV7) ExtractDefenseFromDoc

func (e ExtractorV7) ExtractDefenseFromDoc(doc *goquery.Document) (DefensesInfos, error)

ExtractDefenseFromDoc ...

func (ExtractorV7) ExtractEspionageReport

func (e ExtractorV7) ExtractEspionageReport(pageHTML []byte, location *time.Location) (EspionageReport, error)

ExtractEspionageReport ...

func (ExtractorV7) ExtractEspionageReportFromDoc

func (e ExtractorV7) ExtractEspionageReportFromDoc(doc *goquery.Document, location *time.Location) (EspionageReport, error)

ExtractEspionageReportFromDoc ...

func (ExtractorV7) ExtractExpeditionMessages

func (e ExtractorV7) ExtractExpeditionMessages(pageHTML []byte, location *time.Location) ([]ExpeditionMessage, int64, error)

ExtractExpeditionMessages ...

func (ExtractorV7) ExtractExpeditionMessagesFromDoc

func (e ExtractorV7) ExtractExpeditionMessagesFromDoc(doc *goquery.Document, location *time.Location) ([]ExpeditionMessage, int64, error)

ExtractExpeditionMessagesFromDoc ...

func (ExtractorV7) ExtractFacilities

func (e ExtractorV7) ExtractFacilities(pageHTML []byte) (Facilities, error)

ExtractFacilities ...

func (ExtractorV7) ExtractFacilitiesFromDoc

func (e ExtractorV7) ExtractFacilitiesFromDoc(doc *goquery.Document) (Facilities, error)

ExtractFacilitiesFromDoc ...

func (ExtractorV7) ExtractFleet1Ships

func (e ExtractorV7) ExtractFleet1Ships(pageHTML []byte) ShipsInfos

ExtractFleet1Ships ...

func (ExtractorV7) ExtractFleet1ShipsFromDoc

func (e ExtractorV7) ExtractFleet1ShipsFromDoc(doc *goquery.Document) (s ShipsInfos)

ExtractFleet1ShipsFromDoc ...

func (ExtractorV7) ExtractIPM

func (e ExtractorV7) ExtractIPM(pageHTML []byte) (duration, max int64, token string)

ExtractIPM ...

func (ExtractorV7) ExtractIPMFromDoc

func (e ExtractorV7) ExtractIPMFromDoc(doc *goquery.Document) (duration, max int64, token string)

ExtractIPMFromDoc ...

func (ExtractorV7) ExtractMarketplaceMessages

func (e ExtractorV7) ExtractMarketplaceMessages(pageHTML []byte, location *time.Location) ([]MarketplaceMessage, int64, error)

ExtractMarketplaceMessages ...

func (ExtractorV7) ExtractMarketplaceMessagesFromDoc

func (e ExtractorV7) ExtractMarketplaceMessagesFromDoc(doc *goquery.Document, location *time.Location) ([]MarketplaceMessage, int64, error)

ExtractMarketplaceMessagesFromDoc ...

func (ExtractorV7) ExtractOverviewProduction

func (e ExtractorV7) ExtractOverviewProduction(pageHTML []byte) ([]Quantifiable, int64, error)

ExtractOverviewProduction extracts ships/defenses (partial) production from the overview page

func (ExtractorV7) ExtractOverviewProductionFromDoc

func (e ExtractorV7) ExtractOverviewProductionFromDoc(doc *goquery.Document) ([]Quantifiable, error)

ExtractOverviewProductionFromDoc extracts ships/defenses (partial) production from the overview page

func (ExtractorV7) ExtractOverviewShipSumCountdownFromBytes

func (e ExtractorV7) ExtractOverviewShipSumCountdownFromBytes(pageHTML []byte) int64

ExtractOverviewShipSumCountdownFromBytes ...

func (ExtractorV7) ExtractResearch

func (e ExtractorV7) ExtractResearch(pageHTML []byte) Researches

ExtractResearch ...

func (ExtractorV7) ExtractResearchFromDoc

func (e ExtractorV7) ExtractResearchFromDoc(doc *goquery.Document) Researches

ExtractResearchFromDoc ...

func (ExtractorV7) ExtractResourceSettings

func (e ExtractorV7) ExtractResourceSettings(pageHTML []byte) (ResourceSettings, error)

ExtractResourceSettings ...

func (ExtractorV7) ExtractResourceSettingsFromDoc

func (e ExtractorV7) ExtractResourceSettingsFromDoc(doc *goquery.Document) (ResourceSettings, error)

ExtractResourceSettingsFromDoc ...

func (ExtractorV7) ExtractResourcesBuildings

func (e ExtractorV7) ExtractResourcesBuildings(pageHTML []byte) (ResourcesBuildings, error)

ExtractResourcesBuildings ...

func (ExtractorV7) ExtractResourcesBuildingsFromDoc

func (e ExtractorV7) ExtractResourcesBuildingsFromDoc(doc *goquery.Document) (ResourcesBuildings, error)

ExtractResourcesBuildingsFromDoc ...

func (ExtractorV7) ExtractResourcesDetails

func (e ExtractorV7) ExtractResourcesDetails(pageHTML []byte) (out ResourcesDetails, err error)

ExtractResourcesDetails ...

func (ExtractorV7) ExtractShips

func (e ExtractorV7) ExtractShips(pageHTML []byte) (ShipsInfos, error)

ExtractShips ...

func (ExtractorV7) ExtractShipsFromDoc

func (e ExtractorV7) ExtractShipsFromDoc(doc *goquery.Document) (ShipsInfos, error)

ExtractShipsFromDoc ...

type ExtractorV71

type ExtractorV71 struct {
	ExtractorV7
}

ExtractorV71 ...

func NewExtractorV71

func NewExtractorV71() *ExtractorV71

NewExtractorV71 ...

func (ExtractorV71) ExtractAllResources

func (e ExtractorV71) ExtractAllResources(pageHTML []byte) (map[CelestialID]Resources, error)

ExtractAllResources ...

func (ExtractorV71) ExtractAttacks

func (e ExtractorV71) ExtractAttacks(pageHTML []byte) ([]AttackEvent, error)

ExtractAttacks ...

func (ExtractorV71) ExtractAttacksFromDoc

func (e ExtractorV71) ExtractAttacksFromDoc(doc *goquery.Document, clock clockwork.Clock) ([]AttackEvent, error)

ExtractAttacksFromDoc ...

func (ExtractorV71) ExtractBuffActivation

func (e ExtractorV71) ExtractBuffActivation(pageHTML []byte) (string, []Item, error)

ExtractBuffActivation ...

func (ExtractorV71) ExtractBuffActivationFromDoc

func (e ExtractorV71) ExtractBuffActivationFromDoc(doc *goquery.Document) (string, []Item, error)

ExtractBuffActivationFromDoc ...

func (ExtractorV71) ExtractDMCosts

func (e ExtractorV71) ExtractDMCosts(pageHTML []byte) (DMCosts, error)

ExtractDMCosts ...

func (ExtractorV71) ExtractDMCostsFromDoc

func (e ExtractorV71) ExtractDMCostsFromDoc(doc *goquery.Document) (DMCosts, error)

ExtractDMCostsFromDoc ...

func (ExtractorV71) ExtractEspionageReport

func (e ExtractorV71) ExtractEspionageReport(pageHTML []byte, location *time.Location) (EspionageReport, error)

ExtractEspionageReport ...

func (ExtractorV71) ExtractEspionageReportFromDoc

func (e ExtractorV71) ExtractEspionageReportFromDoc(doc *goquery.Document, location *time.Location) (EspionageReport, error)

ExtractEspionageReportFromDoc ...

func (ExtractorV71) ExtractFacilities

func (e ExtractorV71) ExtractFacilities(pageHTML []byte) (Facilities, error)

ExtractFacilities ...

func (ExtractorV71) ExtractFacilitiesFromDoc

func (e ExtractorV71) ExtractFacilitiesFromDoc(doc *goquery.Document) (Facilities, error)

ExtractFacilitiesFromDoc ...

func (ExtractorV71) ExtractHighscore

func (e ExtractorV71) ExtractHighscore(pageHTML []byte) (Highscore, error)

ExtractHighscore ...

func (ExtractorV71) ExtractHighscoreFromDoc

func (e ExtractorV71) ExtractHighscoreFromDoc(doc *goquery.Document) (Highscore, error)

ExtractHighscoreFromDoc ...

func (ExtractorV71) ExtractIPM

func (e ExtractorV71) ExtractIPM(pageHTML []byte) (duration int64, max int64, token string)

ExtractIPM ...

func (ExtractorV71) ExtractIPMFromDoc

func (e ExtractorV71) ExtractIPMFromDoc(doc *goquery.Document) (duration int64, max int64, token string)

ExtractIPMFromDoc ...

func (ExtractorV71) ExtractIsMobile

func (e ExtractorV71) ExtractIsMobile(pageHTML []byte) bool

ExtractIsMobile ...

func (ExtractorV71) ExtractIsMobileFromDoc

func (e ExtractorV71) ExtractIsMobileFromDoc(doc *goquery.Document) bool

ExtractIsMobileFromDoc ...

func (ExtractorV71) ExtractProduction

func (e ExtractorV71) ExtractProduction(pageHTML []byte) ([]Quantifiable, int64, error)

ExtractProduction extracts ships/defenses production from the shipyard page

func (ExtractorV71) ExtractProductionFromDoc

func (e ExtractorV71) ExtractProductionFromDoc(doc *goquery.Document) ([]Quantifiable, error)

ExtractProductionFromDoc extracts ships/defenses production from the shipyard page

func (ExtractorV71) ExtractResourcesDetails

func (e ExtractorV71) ExtractResourcesDetails(pageHTML []byte) (out ResourcesDetails, err error)

ExtractResourcesDetails ...

type Facilities

type Facilities struct {
	RoboticsFactory int64
	Shipyard        int64
	ResearchLab     int64
	AllianceDepot   int64
	MissileSilo     int64
	NaniteFactory   int64
	Terraformer     int64
	SpaceDock       int64
	LunarBase       int64
	SensorPhalanx   int64
	JumpGate        int64
}

Facilities represent a planet facilities information

func (Facilities) ByID

func (f Facilities) ByID(id ID) int64

ByID gets the facility level by facility id

func (Facilities) Lazy

func (f Facilities) Lazy() LazyFacilities

Lazy returns a function that return self

func (Facilities) String

func (f Facilities) String() string

type Fields

type Fields struct {
	Built int64
	Total int64
}

Fields planet fields stats

func (Fields) HasFieldAvailable

func (f Fields) HasFieldAvailable() bool

HasFieldAvailable returns either or not we can still build on this planet

type Fleet

type Fleet struct {
	Mission        MissionID
	ReturnFlight   bool
	InDeepSpace    bool
	ID             FleetID
	Resources      Resources
	Origin         Coordinate
	Destination    Coordinate
	Ships          ShipsInfos
	StartTime      time.Time
	ArrivalTime    time.Time
	BackTime       time.Time
	ArriveIn       int64
	BackIn         int64
	UnionID        int64
	TargetPlanetID int64
}

Fleet represent a player fleet information

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 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(Fleet)) *FleetBuilder

OnSuccess register a success callback

func (*FleetBuilder) SendNow

func (f *FleetBuilder) SendNow() (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) SetDestination

func (f *FleetBuilder) SetDestination(v interface{}) *FleetBuilder

SetDestination ...

func (*FleetBuilder) SetDuration

func (f *FleetBuilder) SetDuration(expeditiontime int64) *FleetBuilder

SetDuration set expedition duration

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 MissionID) *FleetBuilder

SetMission ...

func (*FleetBuilder) SetOrigin

func (f *FleetBuilder) SetOrigin(v interface{}) *FleetBuilder

SetOrigin ...

func (*FleetBuilder) SetRecallIn

func (f *FleetBuilder) SetRecallIn(secs int64) *FleetBuilder

SetRecallIn ...

func (*FleetBuilder) SetResources

func (f *FleetBuilder) SetResources(resources Resources) *FleetBuilder

SetResources ...

func (*FleetBuilder) SetShips

func (f *FleetBuilder) SetShips(ships ShipsInfos) *FleetBuilder

SetShips ...

func (*FleetBuilder) SetSpeed

func (f *FleetBuilder) SetSpeed(speed 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 FleetID

type FleetID int64

FleetID represent a fleet id

func (FleetID) String

func (f FleetID) String() string

type Highscore

type Highscore struct {
	NbPage   int64
	CurrPage int64
	Category int64 // 1:Player, 2:Alliance
	Type     int64 // 0:Total, 1:Economy, 2:Research, 3:Military, 4:Military Built, 5:Military Destroyed, 6:Military Lost, 7:Honor
	Players  []HighscorePlayer
}

Highscore ...

func (Highscore) String

func (h Highscore) String() string

String ...

type HighscorePlayer

type HighscorePlayer struct {
	Position     int64
	ID           int64
	Name         string
	Score        int64
	AllianceID   int64
	HonourPoints int64
	Homeworld    Coordinate
}

HighscorePlayer ...

func (HighscorePlayer) String

func (h HighscorePlayer) String() string

String ...

type ID

type ID int64

ID represent an ogame id

func ShipName2ID

func ShipName2ID(name string) ID

ShipName2ID ...

func (ID) Int

func (o ID) Int() int64

Int returns an integer value of the id Deprecated: backward compatibility

func (ID) Int64

func (o ID) Int64() int64

Int64 returns an integer value of the id

func (ID) IsBuilding

func (o ID) IsBuilding() bool

IsBuilding returns either or not the id is a building (facility, resource building)

func (ID) IsCombatShip

func (o ID) IsCombatShip() bool

IsCombatShip ...

func (ID) IsDefense

func (o ID) IsDefense() bool

IsDefense returns either or not the id is a defense

func (ID) IsFacility

func (o ID) IsFacility() bool

IsFacility returns either or not the id is a facility

func (ID) IsResourceBuilding

func (o ID) IsResourceBuilding() bool

IsResourceBuilding returns either or not the id is a resource building

func (ID) IsSet

func (o ID) IsSet() bool

IsSet returns either or not the id is set to a value different than 0

func (ID) IsShip

func (o ID) IsShip() bool

IsShip returns either or not the id is a ship

func (ID) IsTech

func (o ID) IsTech() bool

IsTech returns either or not the id is a technology

func (ID) String

func (o ID) String() string

type Item

type Item struct {
	Ref          string
	Name         string
	Image        string
	ImageLarge   string
	Title        string
	Rarity       string // common
	Amount       int64
	AmountFree   int64
	AmountBought int64
	// contains filtered or unexported fields
}

Item Is an ogame item that can be activated

type LazyFacilities

type LazyFacilities func() Facilities

LazyFacilities ...

type LazyResearches

type LazyResearches func() Researches

LazyResearches ...

type LazyResourcesBuildings

type LazyResourcesBuildings func() ResourcesBuildings

LazyResourcesBuildings ...

type Levelable

type Levelable interface {
	BaseOgameObj
	GetLevel(LazyResourcesBuildings, LazyFacilities, LazyResearches) int64
}

Levelable base interface for all levelable ogame objects (buildings, technologies)

type MarketplaceMessage

type MarketplaceMessage struct {
	ID                  int64
	Type                int64 // 26: purchases, 27: sales
	CreatedAt           time.Time
	Token               string
	MarketTransactionID int64
}

MarketplaceMessage ...

type MissionID

type MissionID int

MissionID represent a mission id

func (MissionID) String

func (m MissionID) String() string

type Moon

type Moon struct {
	ID         MoonID
	Img        string
	Name       string
	Diameter   int64
	Coordinate Coordinate
	Fields     Fields
	// contains filtered or unexported fields
}

Moon ogame moon object

func (Moon) ActivateItem

func (m Moon) ActivateItem(ref string) error

ActivateItem activate an item

func (Moon) Build

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

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

func (Moon) BuildBuilding

func (m Moon) BuildBuilding(buildingID ID) error

BuildBuilding ensure what is being built is a building

func (Moon) BuildDefense

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

BuildDefense builds a defense unit

func (Moon) BuildTechnology

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

func (m Moon) CancelResearch() error

CancelResearch cancel the research

func (Moon) ConstructionsBeingBuilt

func (m Moon) ConstructionsBeingBuilt() (ID, int64, ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (Moon) EnsureFleet

func (m Moon) EnsureFleet(ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (Moon) GetCoordinate

func (m Moon) GetCoordinate() Coordinate

GetCoordinate ...

func (Moon) GetDefense

func (m Moon) GetDefense() (DefensesInfos, error)

GetDefense gets all the defenses units information

func (Moon) GetDiameter

func (m Moon) GetDiameter() int64

GetDiameter ...

func (Moon) GetFacilities

func (m Moon) GetFacilities() (Facilities, error)

GetFacilities gets the moon facilities

func (Moon) GetFields

func (m Moon) GetFields() Fields

GetFields ...

func (Moon) GetID

func (m Moon) GetID() CelestialID

GetID ...

func (Moon) GetItems

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

GetItems get all items information

func (Moon) GetName

func (m Moon) GetName() string

GetName ...

func (Moon) GetProduction

func (m Moon) GetProduction() ([]Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (Moon) GetResources

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

GetResources gets moon resources

func (Moon) GetResourcesBuildings

func (m Moon) GetResourcesBuildings() (ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (Moon) GetResourcesDetails

func (m Moon) GetResourcesDetails() (ResourcesDetails, error)

GetResourcesDetails gets resources details

func (Moon) GetShips

func (m Moon) GetShips() (ShipsInfos, error)

GetShips gets all ships units information

func (Moon) GetType

func (m Moon) GetType() CelestialType

GetType ...

func (*Moon) Phalanx

func (m *Moon) Phalanx(coord Coordinate) ([]Fleet, error)

Phalanx uses 5000 deuterium to scan a coordinate

func (Moon) SendFleet

func (m Moon) SendFleet(ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

SendFleet sends a fleet

func (Moon) TearDown

func (m Moon) TearDown(buildingID ID) error

TearDown tears down any ogame building

type MoonID

type MoonID CelestialID

MoonID represent a moon id

func (MoonID) Celestial

func (m MoonID) Celestial() CelestialID

Celestial convert a MoonID to a CelestialID

type MoonInfos

type MoonInfos struct {
	ID       int64
	Diameter int64
	Activity int64
}

MoonInfos public information of a moon in the galaxy page

type Multiplier

type Multiplier struct {
	Metal     float64
	Crystal   float64
	Deuterium float64
	Honor     float64
}

Multiplier ...

type NewAccount

type NewAccount struct {
	ID     int
	Server struct {
		Language string
		Number   int
	}
	Error string
}

NewAccount response from creating a new account

func AddAccount

func AddAccount(username, password, otpSecret, universe, lang, proxyAddr, proxyUsername, proxyPassword, proxyType string) (NewAccount, error)

type OGame

type OGame struct {
	sync.Mutex

	CachedPreferences Preferences

	Universe string
	Username string

	Client *OGameClient
	// 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(universe, username, password, lang string) (*OGame, error)

New creates a new instance of OGame wrapper.

func NewNoLogin

func NewNoLogin(username, password, otpSecret, universe, lang, cookiesFilename string, playerID int64) (*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 interface{}) error

Abandon a planet

func (*OGame) ActivateItem

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

ActivateItem activate an item

func (*OGame) AddAccount

func (b *OGame) AddAccount(number int, lang string) (NewAccount, 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 CelestialID, id ID, nbr int64) error

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

func (*OGame) BuildBuilding

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

BuildBuilding ensure what is being built is a building

func (*OGame) BuildCancelable

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

BuildCancelable builds any cancelable ogame objects (building, technology)

func (*OGame) BuildDefense

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

BuildDefense builds a defense unit

func (*OGame) BuildProduction

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

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

func (*OGame) BuildShips

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

BuildShips builds a ship unit

func (*OGame) BuildTechnology

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

BuildTechnology ensure that we're trying to build a technology

func (*OGame) BuyMarketplace

func (b *OGame) BuyMarketplace(itemID int64, celestialID 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) 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) CancelBuilding

func (b *OGame) CancelBuilding(celestialID CelestialID) error

CancelBuilding cancel the construction of a building on a specified planet

func (*OGame) CancelFleet

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

CancelFleet cancel a fleet

func (*OGame) CancelResearch

func (b *OGame) CancelResearch(celestialID CelestialID) error

CancelResearch cancel the research

func (*OGame) CharacterClass

func (b *OGame) CharacterClass() CharacterClass

CharacterClass returns the bot character class

func (*OGame) CollectAllMarketplaceMessages

func (b *OGame) CollectAllMarketplaceMessages() error

CollectAllMarketplaceMessages collect all marketplace messages

func (*OGame) CollectMarketplaceMessage

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

CollectMarketplaceMessage collect marketplace message

func (*OGame) ConstructionsBeingBuilt

func (b *OGame) ConstructionsBeingBuilt(celestialID CelestialID) (ID, int64, ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (*OGame) CreateUnion

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

CreateUnion creates a union

func (*OGame) DeleteAllMessagesFromTab

func (b *OGame) DeleteAllMessagesFromTab(tabID int64) 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) Disable

func (b *OGame) Disable()

Disable disables communications with OGame Server

func (*OGame) Distance

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

Distance return distance between two coordinates

func (*OGame) DoAuction

func (b *OGame) DoAuction(bid map[CelestialID]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 CelestialID, ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (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 Coordinate, speed Speed, ships ShipsInfos) (secs, fuel int64)

FlightTime calculate flight time and fuel needed

func (*OGame) GalaxyInfos

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

GalaxyInfos get information of all planets and moons of a solar system

func (*OGame) GetAllResources

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

GetAllResources gets the resources of all planets and moons

func (*OGame) GetAlliancePageContent

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

GetAlliancePageContent gets the html for a specific alliance page

func (*OGame) GetAttacks

func (b *OGame) GetAttacks(opts ...Option) ([]AttackEvent, error)

GetAttacks get enemy fleets attacking you

func (*OGame) GetAuction

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

GetAuction ...

func (*OGame) GetCachedCelestial

func (b *OGame) GetCachedCelestial(v interface{}) Celestial

GetCachedCelestial return celestial from cached value

func (*OGame) GetCachedCelestialByCoord

func (b *OGame) GetCachedCelestialByCoord(coord Coordinate) Celestial

GetCachedCelestialByCoord return celestial from cached value

func (*OGame) GetCachedCelestialByID

func (b *OGame) GetCachedCelestialByID(celestialID CelestialID) Celestial

GetCachedCelestialByID return celestial from cached value

func (*OGame) GetCachedCelestials

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

GetCachedCelestials get all cached celestials

func (*OGame) GetCachedData

func (b *OGame) GetCachedData() Data

GetCachedData gets all Cached Data

func (*OGame) GetCachedMoons

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

GetCachedMoons return moons from cached value

func (*OGame) GetCachedPlanets

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

GetCachedPlanets return planets from cached value

func (*OGame) GetCachedPlayer

func (b *OGame) GetCachedPlayer() UserInfos

GetCachedPlayer returns cached player infos

func (*OGame) GetCachedPreferences

func (b *OGame) GetCachedPreferences() Preferences

GetCachedPreferences returns cached preferences

func (*OGame) GetCachedResearch

func (b *OGame) GetCachedResearch() Researches

GetCachedResearch returns cached researches

func (*OGame) GetCelestial

func (b *OGame) GetCelestial(v interface{}) (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() *OGameClient

GetClient get the http client used by the bot

func (*OGame) GetCombatReportSummaryFor

func (b *OGame) GetCombatReportSummaryFor(coord Coordinate) (CombatReportSummary, error)

GetCombatReportSummaryFor gets the latest combat report for a given coordinate

func (*OGame) GetDMCosts

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

GetDMCosts returns fast build with DM information

func (*OGame) GetDefense

func (b *OGame) GetDefense(celestialID CelestialID) (DefensesInfos, error)

GetDefense gets all the defenses units information of a planet Fails if planetID is invalid

func (*OGame) GetEmpire

func (b *OGame) GetEmpire(nbr int64) (interface{}, error)

GetEmpire retrieves JSON from Empire page (Commander only).

func (*OGame) GetEspionageReport

func (b *OGame) GetEspionageReport(msgID int64) (EspionageReport, error)

GetEspionageReport gets a detailed espionage report

func (*OGame) GetEspionageReportFor

func (b *OGame) GetEspionageReportFor(coord Coordinate) (EspionageReport, error)

GetEspionageReportFor gets the latest espionage report for a given coordinate

func (*OGame) GetEspionageReportMessages

func (b *OGame) GetEspionageReportMessages() ([]EspionageReportSummary, error)

GetEspionageReportMessages gets the summary of each espionage reports

func (*OGame) GetExpeditionMessageAt

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

GetExpeditionMessageAt gets the expedition message for time t

func (*OGame) GetExpeditionMessages

func (b *OGame) GetExpeditionMessages() ([]ExpeditionMessage, error)

GetExpeditionMessages gets the expedition messages

func (*OGame) GetExtractor

func (b *OGame) GetExtractor() Extractor

GetExtractor gets extractor object

func (*OGame) GetFacilities

func (b *OGame) GetFacilities(celestialID CelestialID) (Facilities, error)

GetFacilities gets all facilities information of a planet

func (*OGame) GetFleets

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

GetFleets get the player's own fleets activities

func (*OGame) GetFleetsFromEventList

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

GetFleetsFromEventList get the player's own fleets activities

func (*OGame) GetItems

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

GetItems get all items information

func (*OGame) GetLanguage

func (b *OGame) GetLanguage() string

GetLanguage get ogame server language

func (*OGame) GetMoon

func (b *OGame) GetMoon(v interface{}) (Moon, error)

GetMoon gets infos for moonID

func (*OGame) GetMoons

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

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 interface{}) (Planet, error)

GetPlanet gets infos for planetID Fails if planetID is invalid

func (*OGame) GetPlanets

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

GetPlanets returns the user planets

func (*OGame) GetPlanetsActivity

func (b *OGame) GetPlanetsActivity() map[CelestialID]int64

GetPlanetsActivity return last activity Unix Timestamp of all Planets in map.

func (*OGame) GetPlanetsResources

func (b *OGame) GetPlanetsResources() map[CelestialID]ResourcesDetails

GetPlanetsResources returns the cached PlanetsResources in map.

func (*OGame) GetProduction

func (b *OGame) GetProduction(celestialID CelestialID) ([]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() Researches

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 PlanetID) (ResourceSettings, error)

GetResourceSettings gets the resources settings for specified planetID

func (*OGame) GetResources

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

GetResources gets user resources

func (*OGame) GetResourcesBuildings

func (b *OGame) GetResourcesBuildings(celestialID CelestialID) (ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (*OGame) GetResourcesDetails

func (b *OGame) GetResourcesDetails(celestialID CelestialID) (ResourcesDetails, error)

GetResourcesDetails gets user resources

func (*OGame) GetResourcesProductions

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

GetResourcesProductions gets the planet resources production

func (*OGame) GetResourcesProductionsLight

func (b *OGame) GetResourcesProductionsLight(resBuildings ResourcesBuildings, researches Researches,
	resSettings ResourceSettings, temp Temperature) Resources

GetResourcesProductionsLight gets the planet resources production

func (*OGame) GetServer

func (b *OGame) GetServer() Server

GetServer get ogame server information that the bot is connected to

func (*OGame) GetServerData

func (b *OGame) GetServerData() 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 CelestialID) (ShipsInfos, error)

GetShips gets all ships units information of a planet

func (*OGame) GetSlots

func (b *OGame) GetSlots() Slots

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() TasksOverview

GetTasks return how many tasks are queued in the heap.

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() UserInfos

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) (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) IsUnderAttack

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

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

func (*OGame) IsV7

func (b *OGame) IsV7() bool

IsV7 ...

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 MoonID, ships ShipsInfos) (success bool, rechargeCountdown int64, err error)

JumpGate sends ships through a jump gate.

func (*OGame) JumpGateDestinations

func (b *OGame) JumpGateDestinations(origin MoonID) (moonIDs []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) 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 interface{}, quantity, priceType, price, priceRange int64, celestialID CelestialID) error

OfferBuyMarketplace buy offer on marketplace

func (*OGame) OfferSellMarketplace

func (b *OGame) OfferSellMarketplace(itemID interface{}, quantity, priceType, price, priceRange int64, celestialID 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 MoonID, coord Coordinate) ([]Fleet, 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) RegisterAuctioneerCallback

func (b *OGame) RegisterAuctioneerCallback(fn func(packet []byte))

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

func (*OGame) RegisterChatCallback

func (b *OGame) RegisterChatCallback(fn func(msg 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) SendFleet

func (b *OGame) SendFleet(celestialID CelestialID, ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

SendFleet sends a fleet

func (*OGame) SendIPM

func (b *OGame) SendIPM(planetID PlanetID, coord Coordinate, nbr int64, priority 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

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

SetOGameCredentials sets ogame credentials for the bot

func (*OGame) SetProxy

func (b *OGame) SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool) 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 PlanetID, settings ResourceSettings) error

SetResourceSettings set the resources settings on a planet

func (*OGame) SetUserAgent

func (b *OGame) SetUserAgent(newUserAgent string)

SetUserAgent change the user-agent used by the http client

func (*OGame) TearDown

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

TearDown tears down any ogame building

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

func (b *OGame) UnsafePhalanx(moonID MoonID, coord Coordinate) ([]Fleet, error)

UnsafePhalanx same as Phalanx but does not perform any input validation.

func (*OGame) UseDM

func (b *OGame) UseDM(typ string, celestialID CelestialID) error

UseDM use dark matter to fast build

func (*OGame) WithPriority

func (b *OGame) WithPriority(priority int) Prioritizable

WithPriority ...

type OGameClient

type OGameClient struct {
	http.Client
	//Jar          *cookiejar.Jar
	UserAgent string
	// contains filtered or unexported fields
}

OGameClient ...

func NewOGameClient

func NewOGameClient() *OGameClient

NewOGameClient ...

func (*OGameClient) Do

func (c *OGameClient) Do(req *http.Request) (*http.Response, error)

Do executes a request

func (*OGameClient) FakeDo

func (c *OGameClient) FakeDo()

FakeDo for testing purposes

func (*OGameClient) GetRPS

func (c *OGameClient) GetRPS() int32

GetRPS gets the current client RPS

func (*OGameClient) SetMaxRPS

func (c *OGameClient) SetMaxRPS(maxRPS int32)

SetMaxRPS ...

type ObjsStruct

type ObjsStruct struct {
	AllianceDepot                *allianceDepot
	CrystalMine                  *crystalMine
	CrystalStorage               *crystalStorage
	DeuteriumSynthesizer         *deuteriumSynthesizer
	DeuteriumTank                *deuteriumTank
	FusionReactor                *fusionReactor
	MetalMine                    *metalMine
	MetalStorage                 *metalStorage
	MissileSilo                  *missileSilo
	NaniteFactory                *naniteFactory
	ResearchLab                  *researchLab
	RoboticsFactory              *roboticsFactory
	SeabedDeuteriumDen           *seabedDeuteriumDen
	ShieldedMetalDen             *shieldedMetalDen
	Shipyard                     *shipyard
	SolarPlant                   *solarPlant
	SpaceDock                    *spaceDock
	LunarBase                    *lunarBase
	SensorPhalanx                *sensorPhalanx
	JumpGate                     *jumpGate
	Terraformer                  *terraformer
	UndergroundCrystalDen        *undergroundCrystalDen
	SolarSatellite               *solarSatellite
	AntiBallisticMissiles        *antiBallisticMissiles
	GaussCannon                  *gaussCannon
	HeavyLaser                   *heavyLaser
	InterplanetaryMissiles       *interplanetaryMissiles
	IonCannon                    *ionCannon
	LargeShieldDome              *largeShieldDome
	LightLaser                   *lightLaser
	PlasmaTurret                 *plasmaTurret
	RocketLauncher               *rocketLauncher
	SmallShieldDome              *smallShieldDome
	Battlecruiser                *battlecruiser
	Battleship                   *battleship
	Bomber                       *bomber
	ColonyShip                   *colonyShip
	Cruiser                      *cruiser
	Deathstar                    *deathstar
	Destroyer                    *destroyer
	EspionageProbe               *espionageProbe
	HeavyFighter                 *heavyFighter
	LargeCargo                   *largeCargo
	LightFighter                 *lightFighter
	Recycler                     *recycler
	SmallCargo                   *smallCargo
	Crawler                      *crawler
	Reaper                       *reaper
	Pathfinder                   *pathfinder
	ArmourTechnology             *armourTechnology
	Astrophysics                 *astrophysics
	CombustionDrive              *combustionDrive
	ComputerTechnology           *computerTechnology
	EnergyTechnology             *energyTechnology
	EspionageTechnology          *espionageTechnology
	GravitonTechnology           *gravitonTechnology
	HyperspaceDrive              *hyperspaceDrive
	HyperspaceTechnology         *hyperspaceTechnology
	ImpulseDrive                 *impulseDrive
	IntergalacticResearchNetwork *intergalacticResearchNetwork
	IonTechnology                *ionTechnology
	LaserTechnology              *laserTechnology
	PlasmaTechnology             *plasmaTechnology
	ShieldingTechnology          *shieldingTechnology
	WeaponsTechnology            *weaponsTechnology
}

ObjsStruct structure containing all possible ogame objects

func (*ObjsStruct) ByID

func (o *ObjsStruct) ByID(id ID) BaseOgameObj

ByID gets an object by id

type Option

type Option func(*options)

Option functions to be passed to public interface to change behaviors

func ChangePlanet

func ChangePlanet(celestialID CelestialID) Option

ChangePlanet set the cp parameter

type Params

type Params struct {
	Username        string
	Password        string
	OTPSecret       string
	Universe        string
	Lang            string
	PlayerID        int64
	AutoLogin       bool
	Proxy           string
	ProxyUsername   string
	ProxyPassword   string
	ProxyType       string
	ProxyLoginOnly  bool
	Lobby           string
	APINewHostname  string
	CookiesFilename string
}

Params parameters for more fine-grained initialization

type Planet

type Planet struct {
	Img         string
	ID          PlanetID
	Name        string
	Diameter    int64
	Coordinate  Coordinate
	Fields      Fields
	Temperature Temperature
	Moon        *Moon
	// contains filtered or unexported fields
}

Planet ogame planet object

func (Planet) ActivateItem

func (p Planet) ActivateItem(ref string) error

ActivateItem activate an item

func (Planet) Build

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

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

func (Planet) BuildBuilding

func (p Planet) BuildBuilding(buildingID ID) error

BuildBuilding ensure what is being built is a building

func (*Planet) BuildCancelable

func (p *Planet) BuildCancelable(id ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (Planet) BuildDefense

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

BuildDefense builds a defense unit

func (*Planet) BuildShips

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

BuildShips builds a ship unit

func (Planet) BuildTechnology

func (p Planet) BuildTechnology(technologyID 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) CancelResearch

func (p Planet) CancelResearch() error

CancelResearch cancel the research

func (Planet) ConstructionsBeingBuilt

func (p Planet) ConstructionsBeingBuilt() (ID, int64, ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (Planet) EnsureFleet

func (p Planet) EnsureFleet(ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (*Planet) FlightTime

func (p *Planet) FlightTime(destination Coordinate, speed Speed, ships ShipsInfos) (secs, fuel int64)

FlightTime calculate flight time and fuel needed

func (Planet) GetCoordinate

func (p Planet) GetCoordinate() Coordinate

GetCoordinate ...

func (Planet) GetDefense

func (p Planet) GetDefense() (DefensesInfos, error)

GetDefense gets all the defenses units information

func (Planet) GetDiameter

func (p Planet) GetDiameter() int64

GetDiameter ...

func (Planet) GetFacilities

func (p Planet) GetFacilities() (Facilities, error)

GetFacilities gets all facilities information

func (Planet) GetFields

func (p Planet) GetFields() Fields

GetFields ...

func (Planet) GetID

func (p Planet) GetID() CelestialID

GetID ...

func (Planet) GetItems

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

GetItems get all items information

func (Planet) GetName

func (p Planet) GetName() string

GetName ...

func (Planet) GetProduction

func (p Planet) GetProduction() ([]Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (*Planet) GetResourceSettings

func (p *Planet) GetResourceSettings() (ResourceSettings, error)

GetResourceSettings gets the resources settings for specified planetID

func (Planet) GetResources

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

GetResources gets user resources

func (Planet) GetResourcesBuildings

func (p Planet) GetResourcesBuildings() (ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (Planet) GetResourcesDetails

func (p Planet) GetResourcesDetails() (ResourcesDetails, error)

GetResourcesDetails gets resources details

func (*Planet) GetResourcesProductions

func (p *Planet) GetResourcesProductions() (Resources, error)

GetResourcesProductions gets the resources production

func (Planet) GetShips

func (p Planet) GetShips() (ShipsInfos, error)

GetShips gets all ships units information

func (Planet) GetType

func (p Planet) GetType() CelestialType

GetType ...

func (Planet) SendFleet

func (p Planet) SendFleet(ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

SendFleet sends a fleet

func (*Planet) SendIPM

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

SendIPM send interplanetary missiles

func (Planet) TearDown

func (p Planet) TearDown(buildingID ID) error

TearDown tears down any ogame building

type PlanetID

type PlanetID CelestialID

PlanetID represent a planet id

func (PlanetID) Celestial

func (p PlanetID) Celestial() CelestialID

Celestial convert a PlanetID to a CelestialID

func (PlanetID) String

func (p PlanetID) String() string

type PlanetInfos

type PlanetInfos struct {
	ID              int64
	Activity        int64 // no activity: 0, active: 15, inactive: [16, 59]
	Name            string
	Img             string
	Coordinate      Coordinate
	Administrator   bool
	Inactive        bool
	Vacation        bool
	StrongPlayer    bool
	Newbie          bool
	HonorableTarget bool
	Banned          bool
	Debris          struct {
		Metal           int64
		Crystal         int64
		RecyclersNeeded int64
	}
	Moon   *MoonInfos
	Player struct {
		ID         int64
		Name       string
		Rank       int64
		IsBandit   bool
		IsStarlord bool
	}
	Alliance *AllianceInfos
}

PlanetInfos public information of a planet in the galaxy page

type PlanetResources

type PlanetResources map[CelestialID]planetResource

PlanetResources ...

type Preferences

type Preferences struct {
	SpioAnz                      int64
	DisableChatBar               bool // no-mobile
	DisableOutlawWarning         bool
	MobileVersion                bool
	ShowOldDropDowns             bool
	ActivateAutofocus            bool
	EventsShow                   int64 // Hide: 1, Above the content: 2, Below the content: 3
	SortSetting                  int64 // Order of emergence: 0, Coordinates: 1, Alphabet: 2, Size: 3, Used fields: 4
	SortOrder                    int64 // Up: 0, Down: 1
	ShowDetailOverlay            bool
	AnimatedSliders              bool // no-mobile
	AnimatedOverview             bool // no-mobile
	PopupsNotices                bool // no-mobile
	PopopsCombatreport           bool // no-mobile
	SpioReportPictures           bool
	MsgResultsPerPage            int64 // 10, 25, 50
	AuctioneerNotifications      bool
	EconomyNotifications         bool
	ShowActivityMinutes          bool
	PreserveSystemOnPlanetChange bool

	// Mobile only
	Notifications struct {
		BuildList               bool
		FriendlyFleetActivities bool
		HostileFleetActivities  bool
		ForeignEspionage        bool
		AllianceBroadcasts      bool
		AllianceMessages        bool
		Auctions                bool
		Account                 bool
	}
}

Preferences ...

type Prioritizable

type Prioritizable interface {
	Abandon(interface{}) error
	ActivateItem(string, CelestialID) error
	Begin() Prioritizable
	BeginNamed(name string) Prioritizable
	BuyMarketplace(itemID int64, celestialID CelestialID) error
	BuyOfferOfTheDay() error
	CancelFleet(FleetID) error
	CollectAllMarketplaceMessages() error
	CollectMarketplaceMessage(MarketplaceMessage) error
	CreateUnion(fleet Fleet, unionUsers []string) (int64, error)
	DoAuction(bid map[CelestialID]Resources) error
	Done()
	DeleteAllMessagesFromTab(tabID int64) error
	DeleteMessage(msgID int64) error
	FlightTime(origin, destination Coordinate, speed Speed, ships ShipsInfos) (secs, fuel int64)
	GalaxyInfos(galaxy, system int64, opts ...Option) (SystemInfos, error)
	GetAlliancePageContent(url.Values) ([]byte, error)
	GetAllResources() (map[CelestialID]Resources, error)
	GetAttacks(...Option) ([]AttackEvent, error)
	GetAuction() (Auction, error)
	GetCachedResearch() Researches
	GetCelestial(interface{}) (Celestial, error)
	GetCelestials() ([]Celestial, error)
	GetCombatReportSummaryFor(Coordinate) (CombatReportSummary, error)
	GetDMCosts(CelestialID) (DMCosts, error)
	GetEmpire(nbr int64) (interface{}, error)
	GetEspionageReport(msgID int64) (EspionageReport, error)
	GetEspionageReportFor(Coordinate) (EspionageReport, error)
	GetEspionageReportMessages() ([]EspionageReportSummary, error)
	GetExpeditionMessageAt(time.Time) (ExpeditionMessage, error)
	GetExpeditionMessages() ([]ExpeditionMessage, error)
	GetFleets(...Option) ([]Fleet, Slots)
	GetFleetsFromEventList() []Fleet
	GetItems(CelestialID) ([]Item, error)
	GetMoon(interface{}) (Moon, error)
	GetMoons() []Moon
	GetPageContent(url.Values) ([]byte, error)
	GetPlanet(interface{}) (Planet, error)
	GetPlanets() []Planet
	GetResearch() Researches
	GetSlots() Slots
	GetUserInfos() UserInfos
	HeadersForPage(url string) (http.Header, error)
	Highscore(category, typ, page int64) (Highscore, error)
	IsUnderAttack() (bool, error)
	Login() error
	LoginWithExistingCookies() (bool, error)
	Logout()
	OfferBuyMarketplace(itemID interface{}, quantity, priceType, price, priceRange int64, celestialID CelestialID) error
	OfferSellMarketplace(itemID interface{}, quantity, priceType, price, priceRange int64, celestialID CelestialID) error
	PostPageContent(url.Values, url.Values) ([]byte, error)
	SendMessage(playerID int64, message string) error
	SendMessageAlliance(associationID int64, message string) error
	ServerTime() time.Time
	SetInitiator(initiator string) Prioritizable
	Tx(clb func(tx Prioritizable) error) error
	UseDM(string, CelestialID) error

	// Planet or Moon functions
	Build(celestialID CelestialID, id ID, nbr int64) error
	BuildBuilding(celestialID CelestialID, buildingID ID) error
	BuildCancelable(CelestialID, ID) error
	BuildDefense(celestialID CelestialID, defenseID ID, nbr int64) error
	BuildProduction(celestialID CelestialID, id ID, nbr int64) error
	BuildShips(celestialID CelestialID, shipID ID, nbr int64) error
	BuildTechnology(celestialID CelestialID, technologyID ID) error
	CancelBuilding(CelestialID) error
	CancelResearch(CelestialID) error
	ConstructionsBeingBuilt(CelestialID) (buildingID ID, buildingCountdown int64, researchID ID, researchCountdown int64)
	EnsureFleet(celestialID CelestialID, ships []Quantifiable, speed Speed, where Coordinate, mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)
	GetDefense(CelestialID) (DefensesInfos, error)
	GetFacilities(CelestialID) (Facilities, error)
	GetProduction(CelestialID) ([]Quantifiable, int64, error)
	GetResources(CelestialID) (Resources, error)
	GetResourcesBuildings(CelestialID) (ResourcesBuildings, error)
	GetResourcesDetails(CelestialID) (ResourcesDetails, error)
	GetShips(CelestialID) (ShipsInfos, error)
	SendFleet(celestialID CelestialID, ships []Quantifiable, speed Speed, where Coordinate, mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)
	TearDown(celestialID CelestialID, id ID) error

	// Planet specific functions
	GetResourceSettings(PlanetID) (ResourceSettings, error)
	GetResourcesProductions(PlanetID) (Resources, error)
	GetResourcesProductionsLight(ResourcesBuildings, Researches, ResourceSettings, Temperature) Resources
	SendIPM(PlanetID, Coordinate, int64, ID) (int64, error)
	SetResourceSettings(PlanetID, ResourceSettings) error

	// Moon specific functions
	JumpGate(origin, dest MoonID, ships ShipsInfos) (bool, int64, error)
	JumpGateDestinations(origin MoonID) ([]MoonID, int64, error)
	Phalanx(MoonID, Coordinate) ([]Fleet, error)
	UnsafePhalanx(MoonID, Coordinate) ([]Fleet, error)
}

Prioritizable ...

type Prioritize

type Prioritize struct {
	// contains filtered or unexported fields
}

Prioritize ...

func (*Prioritize) Abandon

func (b *Prioritize) Abandon(v interface{}) error

Abandon a planet. Warning: this is irreversible

func (*Prioritize) ActivateItem

func (b *Prioritize) ActivateItem(ref string, celestialID 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 CelestialID, id ID, nbr int64) error

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

func (*Prioritize) BuildBuilding

func (b *Prioritize) BuildBuilding(celestialID CelestialID, buildingID ID) error

BuildBuilding ensure what is being built is a building

func (*Prioritize) BuildCancelable

func (b *Prioritize) BuildCancelable(celestialID CelestialID, id ID) error

BuildCancelable builds any cancelable ogame objects (building, technology)

func (*Prioritize) BuildDefense

func (b *Prioritize) BuildDefense(celestialID CelestialID, defenseID ID, nbr int64) error

BuildDefense builds a defense unit

func (*Prioritize) BuildProduction

func (b *Prioritize) BuildProduction(celestialID CelestialID, id ID, nbr int64) error

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

func (*Prioritize) BuildShips

func (b *Prioritize) BuildShips(celestialID CelestialID, shipID ID, nbr int64) error

BuildShips builds a ship unit

func (*Prioritize) BuildTechnology

func (b *Prioritize) BuildTechnology(celestialID CelestialID, technologyID ID) error

BuildTechnology ensure that we're trying to build a technology

func (*Prioritize) BuyMarketplace

func (b *Prioritize) BuyMarketplace(itemID int64, celestialID 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) CancelBuilding

func (b *Prioritize) CancelBuilding(celestialID CelestialID) error

CancelBuilding cancel the construction of a building on a specified planet

func (*Prioritize) CancelFleet

func (b *Prioritize) CancelFleet(fleetID FleetID) error

CancelFleet cancel a fleet

func (*Prioritize) CancelResearch

func (b *Prioritize) CancelResearch(celestialID CelestialID) error

CancelResearch cancel the research

func (*Prioritize) CollectAllMarketplaceMessages

func (b *Prioritize) CollectAllMarketplaceMessages() error

CollectAllMarketplaceMessages collect all marketplace messages

func (*Prioritize) CollectMarketplaceMessage

func (b *Prioritize) CollectMarketplaceMessage(msg MarketplaceMessage) error

CollectMarketplaceMessage collect marketplace message

func (*Prioritize) ConstructionsBeingBuilt

func (b *Prioritize) ConstructionsBeingBuilt(celestialID CelestialID) (ID, int64, ID, int64)

ConstructionsBeingBuilt returns the building & research being built, and the time remaining (secs)

func (*Prioritize) CreateUnion

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

CreateUnion creates a union

func (*Prioritize) DeleteAllMessagesFromTab

func (b *Prioritize) DeleteAllMessagesFromTab(tabID int64) error

DeleteAllMessagesFromTab ...

func (*Prioritize) DeleteMessage

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

DeleteMessage deletes a message from the mail box

func (*Prioritize) DoAuction

func (b *Prioritize) DoAuction(bid map[CelestialID]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 CelestialID, ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

EnsureFleet either sends all the requested ships or fail

func (*Prioritize) FlightTime

func (b *Prioritize) FlightTime(origin, destination Coordinate, speed Speed, ships ShipsInfos) (secs, fuel int64)

FlightTime calculate flight time and fuel needed

func (*Prioritize) GalaxyInfos

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

GalaxyInfos get information of all planets and moons of a solar system

func (*Prioritize) GetAllResources

func (b *Prioritize) GetAllResources() (map[CelestialID]Resources, error)

GetAllResources ...

func (*Prioritize) GetAlliancePageContent

func (b *Prioritize) GetAlliancePageContent(vals url.Values) ([]byte, error)

GetAlliancePageContent gets the html for a specific ogame page

func (*Prioritize) GetAttacks

func (b *Prioritize) GetAttacks(opts ...Option) ([]AttackEvent, error)

GetAttacks get enemy fleets attacking you

func (*Prioritize) GetAuction

func (b *Prioritize) GetAuction() (Auction, error)

GetAuction ...

func (*Prioritize) GetCachedData

func (b *Prioritize) GetCachedData() Data

GetCachedData gets all Cached Data

func (*Prioritize) GetCachedResearch

func (b *Prioritize) GetCachedResearch() Researches

GetCachedResearch gets the player cached researches information

func (*Prioritize) GetCelestial

func (b *Prioritize) GetCelestial(v interface{}) (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 Coordinate) (CombatReportSummary, error)

GetCombatReportSummaryFor gets the latest combat report for a given coordinate

func (*Prioritize) GetDMCosts

func (b *Prioritize) GetDMCosts(celestialID CelestialID) (DMCosts, error)

GetDMCosts returns fast build with DM information

func (*Prioritize) GetDefense

func (b *Prioritize) GetDefense(celestialID CelestialID) (DefensesInfos, error)

GetDefense gets all the defenses units information of a planet Fails if planetID is invalid

func (*Prioritize) GetEmpire

func (b *Prioritize) GetEmpire(nbr int64) (interface{}, error)

GetEmpire retrieves JSON from Empire page (Commander only).

func (*Prioritize) GetEspionageReport

func (b *Prioritize) GetEspionageReport(msgID int64) (EspionageReport, error)

GetEspionageReport gets a detailed espionage report

func (*Prioritize) GetEspionageReportFor

func (b *Prioritize) GetEspionageReportFor(coord Coordinate) (EspionageReport, error)

GetEspionageReportFor gets the latest espionage report for a given coordinate

func (*Prioritize) GetEspionageReportMessages

func (b *Prioritize) GetEspionageReportMessages() ([]EspionageReportSummary, error)

GetEspionageReportMessages gets the summary of each espionage reports

func (*Prioritize) GetExpeditionMessageAt

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

GetExpeditionMessageAt gets the expedition message for time t

func (*Prioritize) GetExpeditionMessages

func (b *Prioritize) GetExpeditionMessages() ([]ExpeditionMessage, error)

GetExpeditionMessages gets the expedition messages

func (*Prioritize) GetFacilities

func (b *Prioritize) GetFacilities(celestialID CelestialID) (Facilities, error)

GetFacilities gets all facilities information of a planet

func (*Prioritize) GetFleets

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

GetFleets get the player's own fleets activities

func (*Prioritize) GetFleetsFromEventList

func (b *Prioritize) GetFleetsFromEventList() []Fleet

GetFleetsFromEventList get the player's own fleets activities

func (*Prioritize) GetItems

func (b *Prioritize) GetItems(celestialID CelestialID) ([]Item, error)

GetItems get all items information

func (*Prioritize) GetMoon

func (b *Prioritize) GetMoon(v interface{}) (Moon, error)

GetMoon gets infos for moonID

func (*Prioritize) GetMoons

func (b *Prioritize) GetMoons() []Moon

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 interface{}) (Planet, error)

GetPlanet gets infos for planetID Fails if planetID is invalid

func (*Prioritize) GetPlanets

func (b *Prioritize) GetPlanets() []Planet

GetPlanets returns the user planets

func (*Prioritize) GetProduction

func (b *Prioritize) GetProduction(celestialID CelestialID) ([]Quantifiable, int64, error)

GetProduction get what is in the production queue. (ships & defense being built)

func (*Prioritize) GetResearch

func (b *Prioritize) GetResearch() Researches

GetResearch gets the player researches information

func (*Prioritize) GetResourceSettings

func (b *Prioritize) GetResourceSettings(planetID PlanetID) (ResourceSettings, error)

GetResourceSettings gets the resources settings for specified planetID

func (*Prioritize) GetResources

func (b *Prioritize) GetResources(celestialID CelestialID) (Resources, error)

GetResources gets user resources

func (*Prioritize) GetResourcesBuildings

func (b *Prioritize) GetResourcesBuildings(celestialID CelestialID) (ResourcesBuildings, error)

GetResourcesBuildings gets the resources buildings levels

func (*Prioritize) GetResourcesDetails

func (b *Prioritize) GetResourcesDetails(celestialID CelestialID) (ResourcesDetails, error)

GetResourcesDetails gets user resources

func (*Prioritize) GetResourcesProductions

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

GetResourcesProductions gets the planet resources production

func (*Prioritize) GetResourcesProductionsLight

func (b *Prioritize) GetResourcesProductionsLight(resBuildings ResourcesBuildings, researches Researches,
	resSettings ResourceSettings, temp Temperature) Resources

GetResourcesProductionsLight gets the planet resources production

func (*Prioritize) GetShips

func (b *Prioritize) GetShips(celestialID CelestialID) (ShipsInfos, error)

GetShips gets all ships units information of a planet

func (*Prioritize) GetSlots

func (b *Prioritize) GetSlots() Slots

GetSlots gets the player current and total slots information

func (*Prioritize) GetUserInfos

func (b *Prioritize) GetUserInfos() UserInfos

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) (Highscore, error)

Highscore ...

func (*Prioritize) IsUnderAttack

func (b *Prioritize) IsUnderAttack() (bool, error)

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

func (*Prioritize) JumpGate

func (b *Prioritize) JumpGate(origin, dest MoonID, ships ShipsInfos) (bool, int64, error)

JumpGate sends ships through a jump gate.

func (*Prioritize) JumpGateDestinations

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

JumpGateDestinations returns available destinations for jump gate.

func (*Prioritize) Login

func (b *Prioritize) Login() error

Login to ogame server Can fails with BadCredentialsError

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 interface{}, quantity, priceType, price, priceRange int64, celestialID CelestialID) error

OfferBuyMarketplace ...

func (*Prioritize) OfferSellMarketplace

func (b *Prioritize) OfferSellMarketplace(itemID interface{}, quantity, priceType, price, priceRange int64, celestialID CelestialID) error

OfferSellMarketplace ...

func (*Prioritize) Phalanx

func (b *Prioritize) Phalanx(moonID MoonID, coord Coordinate) ([]Fleet, 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) SendFleet

func (b *Prioritize) SendFleet(celestialID CelestialID, ships []Quantifiable, speed Speed, where Coordinate,
	mission MissionID, resources Resources, expeditiontime, unionID int64) (Fleet, error)

SendFleet sends a fleet

func (*Prioritize) SendIPM

func (b *Prioritize) SendIPM(planetID PlanetID, coord Coordinate, nbr int64, priority 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

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

func (*Prioritize) SetInitiator

func (b *Prioritize) SetInitiator(initiator string) Prioritizable

SetInitiator ...

func (*Prioritize) SetResourceSettings

func (b *Prioritize) SetResourceSettings(planetID PlanetID, settings ResourceSettings) error

SetResourceSettings set the resources settings on a planet

func (*Prioritize) TearDown

func (b *Prioritize) TearDown(celestialID CelestialID, id ID) error

TearDown tears down any ogame building

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

func (b *Prioritize) UnsafePhalanx(moonID MoonID, coord Coordinate) ([]Fleet, error)

UnsafePhalanx same as Phalanx but does not perform any input validation.

func (*Prioritize) UseDM

func (b *Prioritize) UseDM(typ string, celestialID CelestialID) error

UseDM use dark matter to fast build

type Quantifiable

type Quantifiable struct {
	ID  ID
	Nbr int64
}

Quantifiable is a tuple with an ID and a number

type Researches

type Researches struct {
	EnergyTechnology             int64
	LaserTechnology              int64
	IonTechnology                int64
	HyperspaceTechnology         int64
	PlasmaTechnology             int64
	CombustionDrive              int64
	ImpulseDrive                 int64
	HyperspaceDrive              int64
	EspionageTechnology          int64
	ComputerTechnology           int64
	Astrophysics                 int64
	IntergalacticResearchNetwork int64
	GravitonTechnology           int64
	WeaponsTechnology            int64
	ShieldingTechnology          int64
	ArmourTechnology             int64
}

Researches represent player's researches

func (Researches) ByID

func (s Researches) ByID(id ID) int64

ByID gets the player research level by research id

func (Researches) Lazy

func (s Researches) Lazy() LazyResearches

Lazy returns a function that return self

func (Researches) String

func (s Researches) String() string

type ResourceSettings

type ResourceSettings struct {
	MetalMine            int64
	CrystalMine          int64
	DeuteriumSynthesizer int64
	SolarPlant           int64
	FusionReactor        int64
	SolarSatellite       int64
	Crawler              int64
}

ResourceSettings represent a planet resource settings

func (ResourceSettings) String

func (r ResourceSettings) String() string

type Resources

type Resources struct {
	Metal      int64
	Crystal    int64
	Deuterium  int64
	Energy     int64
	Darkmatter int64
}

Resources represent ogame resources

func (Resources) Add

func (r Resources) Add(v Resources) Resources

Add adds two resources together

func (Resources) CanAfford

func (r Resources) CanAfford(cost Resources) bool

CanAfford alias to Gte

func (Resources) Div

func (r Resources) Div(price Resources) int64

Div finds how many price a res can afford

func (Resources) Gte

func (r Resources) Gte(val Resources) bool

Gte greater than or equal

func (Resources) Lte

func (r Resources) Lte(val Resources) bool

Lte less than or equal

func (Resources) Mul

func (r Resources) Mul(scalar int64) Resources

Mul multiply resources with scalar.

func (Resources) String

func (r Resources) String() string

func (Resources) Sub

func (r Resources) Sub(v Resources) Resources

Sub subtract v from r

func (Resources) Total

func (r Resources) Total() int64

Total returns the sum of resources

func (Resources) Value

func (r Resources) Value() int64

Value returns normalized total value of all resources

type ResourcesBuildings

type ResourcesBuildings struct {
	MetalMine            int64
	CrystalMine          int64
	DeuteriumSynthesizer int64
	SolarPlant           int64
	FusionReactor        int64
	SolarSatellite       int64
	MetalStorage         int64
	CrystalStorage       int64
	DeuteriumTank        int64
}

ResourcesBuildings represent a planet resource buildings

func (ResourcesBuildings) ByID

func (r ResourcesBuildings) ByID(id ID) int64

ByID gets the resource building level from a building id

func (ResourcesBuildings) Lazy

Lazy returns a function that return self

func (ResourcesBuildings) String

func (r ResourcesBuildings) String() string

type ResourcesDetails

type ResourcesDetails struct {
	Metal struct {
		Available         int64
		StorageCapacity   int64
		CurrentProduction int64
	}
	Crystal struct {
		Available         int64
		StorageCapacity   int64
		CurrentProduction int64
	}
	Deuterium struct {
		Available         int64
		StorageCapacity   int64
		CurrentProduction int64
	}
	Energy struct {
		Available         int64
		CurrentProduction int64
		Consumption       int64
	}
	Darkmatter struct {
		Available int64
		Purchased int64
		Found     int64
	}
}

ResourcesDetails ...

func (ResourcesDetails) Available

func (r ResourcesDetails) Available() Resources

Available returns the resources available

type Server

type Server struct {
	Language      string
	Number        int64
	Name          string
	PlayerCount   int64
	PlayersOnline int64
	Opened        string
	StartDate     string
	EndDate       *string
	ServerClosed  int64
	Prefered      int64
	SignupClosed  int64
	Settings      struct {
		AKS                      int64
		FleetSpeed               int64
		WreckField               int64
		ServerLabel              string
		EconomySpeed             int64
		PlanetFields             int64
		UniverseSize             int64 // Nb of galaxies
		ServerCategory           string
		EspionageProbeRaids      int64
		PremiumValidationGift    int64
		DebrisFieldFactorShips   int64
		DebrisFieldFactorDefence int64
	}
}

Server ogame information for their servers

type ServerData

type ServerData struct {
	Name                          string  `xml:"name"`                          // Europa
	Number                        int64   `xml:"number"`                        // 157
	Language                      string  `xml:"language"`                      // ru
	Timezone                      string  `xml:"timezone"`                      // Europe/Moscow
	TimezoneOffset                string  `xml:"timezoneOffset"`                // +03:00
	Domain                        string  `xml:"domain"`                        // s157-ru.ogame.gameforge.com
	Version                       string  `xml:"version"`                       // 6.8.8-pl2
	Speed                         int64   `xml:"speed"`                         // 6
	SpeedFleet                    int64   `xml:"speedFleet"`                    // 6
	Galaxies                      int64   `xml:"galaxies"`                      // 4
	Systems                       int64   `xml:"systems"`                       // 499
	ACS                           bool    `xml:"aCS"`                           // 1
	RapidFire                     bool    `xml:"rapidFire"`                     // 1
	DefToTF                       bool    `xml:"defToTF"`                       // 0
	DebrisFactor                  float64 `xml:"debrisFactor"`                  // 0.5
	DebrisFactorDef               float64 `xml:"debrisFactorDef"`               // 0
	RepairFactor                  float64 `xml:"repairFactor"`                  // 0.7
	NewbieProtectionLimit         int64   `xml:"newbieProtectionLimit"`         // 500000
	NewbieProtectionHigh          int64   `xml:"newbieProtectionHigh"`          // 50000
	TopScore                      int64   `xml:"topScore"`                      // 60259362
	BonusFields                   int64   `xml:"bonusFields"`                   // 30
	DonutGalaxy                   bool    `xml:"donutGalaxy"`                   // 1
	DonutSystem                   bool    `xml:"donutSystem"`                   // 1
	WfEnabled                     bool    `xml:"wfEnabled"`                     // 1 (WreckField)
	WfMinimumRessLost             int64   `xml:"wfMinimumRessLost"`             // 150000
	WfMinimumLossPercentage       int64   `xml:"wfMinimumLossPercentage"`       // 5
	WfBasicPercentageRepairable   int64   `xml:"wfBasicPercentageRepairable"`   // 45
	GlobalDeuteriumSaveFactor     float64 `xml:"globalDeuteriumSaveFactor"`     // 0.5
	Bashlimit                     int64   `xml:"bashlimit"`                     // 0
	ProbeCargo                    int64   `xml:"probeCargo"`                    // 5
	ResearchDurationDivisor       int64   `xml:"researchDurationDivisor"`       // 2
	DarkMatterNewAcount           int64   `xml:"darkMatterNewAcount"`           // 8000
	CargoHyperspaceTechMultiplier int64   `xml:"cargoHyperspaceTechMultiplier"` // 5
}

ServerData represent api result from https://s157-ru.ogame.gameforge.com/api/serverData.xml

type Ship

type Ship interface {
	DefenderObj
	GetCargoCapacity(techs Researches, probeRaids, isCollector bool) int64
	GetSpeed(techs Researches, isCollector, isGeneral bool) int64
	GetFuelConsumption(techs Researches, fleetDeutSaveFactor float64, isGeneral bool) int64
}

Ship interface implemented by all ships units

type ShipsInfos

type ShipsInfos struct {
	LightFighter   int64
	HeavyFighter   int64
	Cruiser        int64
	Battleship     int64
	Battlecruiser  int64
	Bomber         int64
	Destroyer      int64
	Deathstar      int64
	SmallCargo     int64
	LargeCargo     int64
	ColonyShip     int64
	Recycler       int64
	EspionageProbe int64
	SolarSatellite int64
	Crawler        int64
	Reaper         int64
	Pathfinder     int64
}

ShipsInfos represent a planet ships information

func (*ShipsInfos) Add

func (s *ShipsInfos) Add(v ShipsInfos)

Add adds two ShipsInfos together

func (ShipsInfos) ByID

func (s ShipsInfos) ByID(id ID) int64

ByID get number of ships by ship id

func (ShipsInfos) Cargo

func (s ShipsInfos) Cargo(techs Researches, probeRaids, isCollector bool) (out int64)

Cargo returns the total cargo of the ships

func (ShipsInfos) CountShips

func (s ShipsInfos) CountShips() (out int64)

CountShips returns the count of ships

func (ShipsInfos) Equal

func (s ShipsInfos) Equal(other ShipsInfos) bool

Equal either or not two ShipsInfos are equal

func (ShipsInfos) FleetCost

func (s ShipsInfos) FleetCost() (out Resources)

FleetCost returns the cost of the fleet

func (ShipsInfos) FleetValue

func (s ShipsInfos) FleetValue() (out int64)

FleetValue returns the value of the fleet

func (ShipsInfos) FromQuantifiables

func (s ShipsInfos) FromQuantifiables(in []Quantifiable) (out ShipsInfos)

FromQuantifiables convert an array of Quantifiable to a ShipsInfos

func (ShipsInfos) Has

func (s ShipsInfos) Has(v ShipsInfos) bool

Has returns true if v is contained by s

func (ShipsInfos) HasMovableShips

func (s ShipsInfos) HasMovableShips() bool

HasMovableShips returns either or not at least one ship that can be moved is present

func (ShipsInfos) HasShips

func (s ShipsInfos) HasShips() bool

HasShips returns either or not at least one ship is present

func (*ShipsInfos) Set

func (s *ShipsInfos) Set(id ID, val int64)

Set sets the ships value using the ship id

func (ShipsInfos) Speed

func (s ShipsInfos) Speed(techs Researches, isCollector, isGeneral bool) int64

Speed returns the speed of the slowest ship

func (ShipsInfos) String

func (s ShipsInfos) String() string

func (ShipsInfos) ToPtr

func (s ShipsInfos) ToPtr() *ShipsInfos

ToPtr returns a pointer to self

func (ShipsInfos) ToQuantifiables

func (s ShipsInfos) ToQuantifiables() []Quantifiable

ToQuantifiables convert a ShipsInfos to an array of Quantifiable

type SimulatorParams

type SimulatorParams struct {
	Simulations   int
	FleetToDebris float64
}

SimulatorParams ...

type SimulatorResult

type SimulatorResult struct {
	Simulations    int
	AttackerWin    int
	DefenderWin    int
	Draw           int
	Rounds         int
	AttackerLosses price
	DefenderLosses price
	Debris         price
	Recycler       int
	Moonchance     int
	Logs           string
}

SimulatorResult ...

func Simulate

func Simulate(attackerParam Attacker, defenderParam Defender, params SimulatorParams) SimulatorResult

Simulate ...

func (SimulatorResult) String

func (s SimulatorResult) String() string

String ...

type Slots

type Slots struct {
	InUse    int64
	Total    int64
	ExpInUse int64
	ExpTotal int64
}

Slots ...

type Speed

type Speed int

Speed represent a fleet speed

func (Speed) Int

func (s Speed) Int() int64

Int returns an integer value of the speed Deprecated: backward compatibility

func (Speed) Int64

func (s Speed) Int64() int64

Int64 returns an integer value of the speed

func (Speed) String

func (s Speed) String() string

type SystemInfos

type SystemInfos struct {
	ExpeditionDebris struct {
		Metal             int64
		Crystal           int64
		PathfindersNeeded int64
	}
	Events struct {
		Darkmatter  int64
		HasAsteroid bool
	}
	// contains filtered or unexported fields
}

SystemInfos planets information for a specific system

func (SystemInfos) Each

func (s SystemInfos) Each(clb func(planetInfo *PlanetInfos))

Each will execute provided callback for every positions in the system

func (SystemInfos) Galaxy

func (s SystemInfos) Galaxy() int64

Galaxy returns galaxy info

func (SystemInfos) MarshalJSON

func (s SystemInfos) MarshalJSON() ([]byte, error)

MarshalJSON export private fields to json for ogamed

func (SystemInfos) Position

func (s SystemInfos) Position(idx int64) *PlanetInfos

Position returns planet at position idx in the SystemInfos

func (SystemInfos) System

func (s SystemInfos) System() int64

System returns system info

type TasksOverview

type TasksOverview struct {
	Low       int64
	Normal    int64
	Important int64
	Critical  int64
	Total     int64
}

TasksOverview overview of tasks in heap

type Technology

type Technology interface {
	Levelable
}

Technology interface that all technologies implement

type Temperature

type Temperature struct {
	Min int64
	Max int64
}

Temperature planet temperature values

func (Temperature) Mean

func (t Temperature) Mean() int64

Mean returns the planet mean temperature

type UserInfos

type UserInfos struct {
	PlayerID     int64
	PlayerName   string
	Points       int64
	Rank         int64
	Total        int64
	HonourPoints int64
}

UserInfos returns the player's information

type Wrapper

type Wrapper interface {
	Prioritizable
	AddAccount(number int, lang string) (NewAccount, error)
	BytesDownloaded() int64
	BytesUploaded() int64
	CharacterClass() CharacterClass
	Disable()
	Distance(origin, destination Coordinate) int64
	Enable()
	FleetDeutSaveFactor() float64
	GetCachedCelestial(interface{}) Celestial
	GetCachedCelestials() []Celestial
	GetCachedMoons() []Moon
	GetCachedPlanets() []Planet
	GetCachedPlayer() UserInfos
	GetCachedPreferences() Preferences
	GetClient() *OGameClient
	GetExtractor() Extractor
	GetLanguage() string
	GetNbSystems() int64
	GetPublicIP() (string, error)
	GetResearchSpeed() int64
	GetServer() Server
	GetServerData() ServerData
	GetSession() string
	GetState() (bool, string)
	GetTasks() TasksOverview
	GetUniverseName() string
	GetUniverseSpeed() int64
	GetUniverseSpeedFleet() int64
	GetUsername() string
	IsConnected() bool
	IsDonutGalaxy() bool
	IsDonutSystem() bool
	IsEnabled() bool
	IsLocked() bool
	IsLoggedIn() bool
	IsVacationModeEnabled() bool
	IsV7() bool
	Location() *time.Location
	OnStateChange(clb func(locked bool, actor string))
	Quiet(bool)
	ReconnectChat() bool
	RegisterAuctioneerCallback(func([]byte))
	RegisterChatCallback(func(ChatMsg))
	RegisterHTMLInterceptor(func(method, url string, params, payload url.Values, pageHTML []byte))
	RegisterWSCallback(string, func([]byte))
	RemoveWSCallback(string)
	ServerURL() string
	ServerVersion() string
	SetLoginWrapper(func(func() (bool, error)) error)
	SetOGameCredentials(username, password, otpSecret string)
	SetProxy(proxyAddress, username, password, proxyType string, loginOnly bool) error
	SetUserAgent(newUserAgent string)
	WithPriority(priority int) Prioritizable
}

Wrapper all available functions to control ogame bot

Source Files

Directories

Path Synopsis
cmd
c

Jump to

Keyboard shortcuts

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