Help us shape the future of Go! Take the 2026 Go Developer Survey

torn

package module
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Company

type Company struct {
	ID              int    `json:"ID"`
	Type            int    `json:"company_type"`
	Rating          int    `json:"rating"`
	Name            string `json:"name"`
	DirectorID      int    `json:"director"`
	DailyProfit     int    `json:"daily_profit"`
	WeeklyProfit    int    `json:"weekly_profit"`
	DailyCustomers  int    `json:"daily_customers"`
	WeeklyCustomers int    `json:"weekly_customers"`
	DaysOld         int    `json:"days_old"`
	Employees       map[string]*struct {
		Name          string `json:"name"`
		Position      string `json:"position"`
		DaysInCompany int    `json:"days_in_company"`
	} `json:"employees"`
	Detailed *struct {
		ID                int `json:"ID"`
		Bank              int `json:"company_bank"`
		Popularity        int `json:"popularity"`
		Efficiency        int `json:"efficiency"`
		Environment       int `json:"environment"`
		TrainsAvailable   int `json:"trains_available"`
		AdvertisingBudget int `json:"advertising_budget"`
		Upgrades          struct {
			CompanySize   int    `json:"company_size"`
			StaffroomSize string `json:"staffroom_size"`
			StorageSize   string `json:"storage_size"`
			StorageSpace  int    `json:"storage_space"`
		} `json:"upgrades"`
	}
	Stock map[string]*struct {
		Cost       int `json:"cost"`
		RRP        int `json:"rrp"`
		Price      int `json:"price"`
		InStock    int `json:"in_stock"`
		OnOrder    int `json:"on_order"`
		SoldAmount int `json:"sold_amount"`
		SoldWorth  int `json:"sold_worth"`
	} `json:"company_stock"`
	EmployeesDetailed map[string]*struct {
		Position      string `json:"position"`
		DaysEmployed  int    `json:"days_employed"`
		Wage          int    `json:"wage"`
		Effectiveness int    `json:"effectiveness"`
		ManualLabor   int    `json:"manual_labor"`
		Intelligence  int    `json:"intelligence"`
		Endurance     int    `json:"endurance"`
	} `json:"company_employees"`
	News map[string]*struct {
		Timestamp int    `json:"timestamp"`
		News      string `json:"news"`
	} `json:"news"`
}

Company represents all data of a Torn company

type Faction added in v1.1.0

type Faction struct {
	ID        string `json:"ID"`
	Name      string `json:"name"`
	Leader    int    `json:"leader"`
	CoLeader  int    `json:"co-leader"`
	Respect   int    `json:"respect"`
	Age       int    `json:"age"`
	BestChain int    `json:"best_chain"`
	// TODO wars
	Members map[string]*struct {
		Name          string   `json:"name"`
		DaysInFaction int      `json:"days_in_faction"`
		LastAction    string   `json:"last_action"`
		Status        []string `json:"status"`
	} `json:"members"`
	Peace  map[string]int64 `json:"peace"`
	Chains map[string]*struct {
		Chain   int    `json:"chain"`
		Respect string `json:"respect"`
		Start   int64  `json:"start"`
		End     int64  `json:"end"`
	} `json:"chains"`
	Donations map[string]*struct {
		Name          string `json:"name"`
		MoneyBalance  int64  `json:"money_balance"`
		PointsBalance int64  `json:"points_balance"`
	} `json:"donations"`
	Points  int64 `json:"points"`
	Money   int64 `json:"money"`
	Attacks map[string]*struct {
		AttackerName        string `json:"attacker_name"`
		AttackerFactionName string `json:"attacker_factionname"`
		Result              string `json:"result"`
	}
}

Faction represents all data of a Torn faction

type Market

type Market struct {
	Bazaar map[string]*struct {
		Cost     int `json:"cost"`
		Quantity int `json:"quantity"`
	} `json:"bazaar"`
	ItemMarket map[string]*struct {
		Cost     int `json:"cost"`
		Quantity int `json:"quantity"`
	} `json:"itemmarket"`
	PointsMarket map[string]*struct {
		Cost      int `json:"cost"`
		Quantity  int `json:"quantity"`
		TotalCost int `json:"total_cost"`
	} `json:"pointsmarket"`
	Timestamp int `json:"timestamp"`
}

Market represents market listing data for a particular item or points.

type Property

type Property struct {
	OwnerID  int      `json:"owner_id"`
	Type     int      `json:"property_type"`
	Happy    int      `json:"happy"`
	Upkeep   int      `json:"upkeep"`
	Upgrades []string `json:"upgrades"`
	Staff    []string `json:"staff"`
	Rented   *struct {
		UserID     string `json:"user_id"`
		DaysLeft   string `json:"days_left"`
		TotalCost  string `json:"total_cost"`
		CostPerDay string `json:"cost_per_day"`
	} `json:"rented"`
	UsersLiving string `json:"users_living"`
}

Property represents all data of a Torn property

type Session

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

Session represents a state for given API operations. This includes a Torn users API key to access the Torn API, as well as stateful data, such as item prices.

func NewSession

func NewSession(apiKey string) *Session

NewSession returns a *Session initialized with the give apiKey.

func (*Session) QueryCompany

func (s *Session) QueryCompany(ID int, args ...string) (company *Company, err error)

QueryCompany returns data for a specific Torn company, by ID. QueryCompany can take multiple additional options for addition data. See https://www.torn.com/api.html

func (*Session) QueryFaction added in v1.1.0

func (s *Session) QueryFaction(ID int, args ...string) (faction *Faction, err error)

QueryFaction returns data for a specific Torn faction, by ID. QueryFaction can take multiple additional options for addition data. See https://www.torn.com/api.html

func (*Session) QueryMarket

func (s *Session) QueryMarket(ID int, args ...string) (market *Market, err error)

QueryMarket returns data for a specific Torn Item, by ID. QueryMarket supports bazaar data as well as the item market and points market. An item ID is not necessary for the points market. See https://www.torn.com/api.html

func (*Session) QueryProperty

func (s *Session) QueryProperty(ID int) (property *Property, err error)

QueryProperty returns data for a specific Torn property, by ID. See https://www.torn.com/api.html

func (*Session) QueryTorn

func (s *Session) QueryTorn(IDs []int, args ...string) (tornData *Torn, err error)

QueryTorn returns global Torn data, such as items and faction trees. QueryTorn can take multiple IDs for various elements, as well as extra arguments for additional data. See https://www.torn.com/api.html

func (*Session) QueryUser

func (s *Session) QueryUser(ID int, args ...string) (user *User, err error)

QueryUser returns data for a specific Torn user, by ID. QueryUser can take multiple additional options for addition data. See https://www.torn.com/api.html

type Torn

type Torn struct {
	Items map[string]*struct {
		Name        string `json:"name"`
		Desc        string `json:"description"`
		Effect      string `json:"effect"`
		Requirement string `json:"requirement"`
		Type        string `json:"type"`
		BuyPrice    int    `json:"buy_price"`
		SellPrice   int    `json:"sell_price"`
		MarketValue int    `json:"market_value"`
		Circulation int    `json:"circulation"`
		Image       string `json:"image"`
	} `json:"items"`
	Medals map[string]*struct {
		Name string `json:"name"`
		Desc string `json:"description"`
		Type string `json:"type"`
	} `json:"medals"`
	Honors map[string]*struct {
		Name        string `json:"name"`
		Desc        string `json:"description"`
		Type        int    `json:"type"`
		Circulation int    `json:"circulation"`
		Rarity      string `json:"rarity"`
	} `json:"honors"`
	OrganisedCrimes map[string]*struct {
		Name       string `json:"name"`
		Members    int    `json:"members"`
		Time       int    `json:"time"`
		MinCash    int    `json:"min_cash"`
		MaxCash    int    `json:"max_cash"`
		MinRespect int    `json:"min_respect"`
		MaxRespect int    `json:"max_respect"`
	} `json:"organisedcrimes"`
	Gyms map[string]*struct {
		Name      string `json:"name"`
		Stage     int    `json:"stage"`
		Cost      int    `json:"cost"`
		Energy    int    `json:"energy"`
		Strength  int    `json:"strength"`
		Speed     int    `json:"speed"`
		Defense   int    `json:"defense"`
		Dexterity int    `json:"dexterity"`
		Note      string `json:"note"`
	} `json:"gyms"`
	Companies map[string]*struct {
		Name             string `json:"name"`
		Cost             int    `json:"cost"`
		DefaultEmployees int    `json:"default_employees"`
		Positions        map[string]*struct {
			ManRequired    int    `json:"man_required"`
			IntRequired    int    `json:"int_required"`
			EndRequired    int    `json:"end_required"`
			ManGain        int    `json:"man_gain"`
			IntGain        int    `json:"int_gain"`
			EndGain        int    `json:"end_gain"`
			SpecialAbility string `json:"special_ability"`
			Desc           string `json:"descriptions"`
		} `json:"positions"`
		Stock map[string]*struct {
			Cost string `json:"cost"`
			RRP  int    `json:"rrp"`
		} `json:"stock"`
		Specials map[string]*struct {
			Effect         string `json:"effect"`
			Cost           int    `json:"cost"`
			RatingRequired int    `json:"rating_required"`
		} `json:"specials"`
	} `json:"companies"`
	Properties map[string]*struct {
		Name              string   `json:"name"`
		Cost              int      `json:"cost"`
		Happy             int      `json:"happy"`
		Upkeep            int      `json:"upkeep"`
		UpgradesAvailable []string `json:"upgrades_available"`
		StaffAvailable    []string `json:"staff_available"`
	} `json:"properties"`
	Education map[string]*struct {
		Name      string `json:"name"`
		Desc      string `json:"description"`
		MoneyCost int    `json:"money_cost"`
		Tier      int    `json:"tier"`
		Duration  int    `json:"duration"`
		Results   struct {
			Perk         []string `json:"perk"`
			ManualLabor  []string `json:"manual_labor"`
			Intelligence []string `json:"intelligence"`
			Endurance    []string `json:"endurance"`
		}
		Prerequisites []int `json:"prerequisites"`
	} `json:"education"`
	Stats *struct {
		Timestamp                     int    `json:"timestamp"`
		UsersTotal                    int    `json:"users_total"`
		UsersMale                     int    `json:"users_male"`
		UsersFemale                   int    `json:"users_female"`
		UsersMarriedcouples           int    `json:"users_marriedcouples"`
		UsersDaily                    int    `json:"users_daily"`
		TotalUsersLogins              int    `json:"total_users_logins"`
		TotalUsersPlaytime            string `json:"total_users_playtime"`
		JobArmy                       int    `json:"job_army"`
		JobGrocer                     int    `json:"job_grocer"`
		JobMedical                    int    `json:"job_medical"`
		JobCasino                     int    `json:"job_casino"`
		JobEducation                  int    `json:"job_education"`
		JobLaw                        int    `json:"job_law"`
		JobCompany                    int    `json:"job_company"`
		JobNone                       int    `json:"job_none"`
		Crimes                        int    `json:"crimes"`
		Jailed                        int    `json:"jailed"`
		MoneyOnhand                   int    `json:"money_onhand"`
		MoneyAverage                  int    `json:"money_average"`
		MoneyCitybank                 int    `json:"money_citybank"`
		Items                         int    `json:"items"`
		Events                        int    `json:"events"`
		PointsTotal                   int    `json:"points_total"`
		PointsMarket                  int    `json:"points_market"`
		PointsAveragecost             int    `json:"points_averagecost"`
		PointsBought                  int    `json:"points_bought"`
		TotalPointsBoughttotal        int    `json:"total_points_boughttotal"`
		TotalAttacksWon               int    `json:"total_attacks_won"`
		TotalAttacksLost              int    `json:"total_attacks_lost"`
		TotalAttacksStalemated        int    `json:"total_attacks_stalemated"`
		TotalAttacksRunaway           int    `json:"total_attacks_runaway"`
		TotalAttacksHits              int    `json:"total_attacks_hits"`
		TotalAttacksMisses            int    `json:"total_attacks_misses"`
		TotalAttacksCriticalhits      int    `json:"total_attacks_criticalhits"`
		TotalAttacksRoundsfired       int    `json:"total_attacks_roundsfired"`
		TotalAttacksStealthed         int    `json:"total_attacks_stealthed"`
		TotalAttacksMoneymugged       int    `json:"total_attacks_moneymugged"`
		TotalAttacksRespectgained     int    `json:"total_attacks_respectgained"`
		TotalItemsMarketbought        int    `json:"total_items_marketbought"`
		TotalItemsBazaarbought        int    `json:"total_items_bazaarbought"`
		TotalItemsAuctionswon         int    `json:"total_items_auctionswon"`
		TotalItemsSent                int    `json:"total_items_sent"`
		TotalTrades                   int    `json:"total_trades"`
		TotalItemsBazaarincome        int    `json:"total_items_bazaarincome"`
		TotalItemsCityfinds           int    `json:"total_items_cityfinds"`
		TotalItemsDumpfinds           int    `json:"total_items_dumpfinds"`
		TotalItemsDumped              int    `json:"total_items_dumped"`
		TotalJailJailed               int    `json:"total_jail_jailed"`
		TotalJailBusted               int    `json:"total_jail_busted"`
		TotalJailBusts                int    `json:"total_jail_busts"`
		TotalJailBailed               int    `json:"total_jail_bailed"`
		TotalJailBailcosts            int    `json:"total_jail_bailcosts"`
		TotalHospitalTrips            int    `json:"total_hospital_trips"`
		TotalHospitalMedicalitemsused int    `json:"total_hospital_medicalitemsused"`
		TotalHospitalRevived          int    `json:"total_hospital_revived"`
		TotalMailsSent                int    `json:"total_mails_sent"`
		TotalMailsSentFriends         int    `json:"total_mails_sent_friends"`
		TotalMailsSentFaction         int    `json:"total_mails_sent_faction"`
		TotalMailsSentCompany         int    `json:"total_mails_sent_company"`
		TotalMailsSentSpouse          int    `json:"total_mails_sent_spouse"`
		TotalClassifiedadsPlaced      int    `json:"total_classifiedads_placed"`
		TotalBountyPlaced             int    `json:"total_bounty_placed"`
		TotalBountyRewards            int    `json:"total_bounty_rewards"`
		TotalTravelAll                int    `json:"total_travel_all"`
		TotalTravelArgentina          int    `json:"total_travel_argentina"`
		TotalTravelMexico             int    `json:"total_travel_mexico"`
		TotalTravelDubai              int    `json:"total_travel_dubai"`
		TotalTravelHawaii             int    `json:"total_travel_hawaii"`
		TotalTravelJapan              int    `json:"total_travel_japan"`
		TotalTravelUnitedkingdom      int    `json:"total_travel_unitedkingdom"`
		TotalTravelSouthafrica        int    `json:"total_travel_southafrica"`
		TotalTravelSwitzerland        int    `json:"total_travel_switzerland"`
		TotalTravelChina              int    `json:"total_travel_china"`
		TotalTravelCanada             int    `json:"total_travel_canada"`
		TotalTravelCaymanislands      int    `json:"total_travel_caymanislands"`
		TotalDrugsUsed                int    `json:"total_drugs_used"`
		TotalDrugsOverdosed           int    `json:"total_drugs_overdosed"`
		TotalDrugsCannabis            int    `json:"total_drugs_cannabis"`
		TotalDrugsEcstacy             int    `json:"total_drugs_ecstacy"`
		TotalDrugsKetamine            int    `json:"total_drugs_ketamine"`
		TotalDrugsLsd                 int    `json:"total_drugs_lsd"`
		TotalDrugsOpium               int    `json:"total_drugs_opium"`
		TotalDrugsShrooms             int    `json:"total_drugs_shrooms"`
		TotalDrugsSpeed               int    `json:"total_drugs_speed"`
		TotalDrugsPcp                 int    `json:"total_drugs_pcp"`
		TotalDrugsXanax               int    `json:"total_drugs_xanax"`
		TotalDrugsVicodin             int    `json:"total_drugs_vicodin"`
		TotalMeritsBought             int    `json:"total_merits_bought"`
		TotalRefillsBought            int    `json:"total_refills_bought"`
		TotalCompanyTrains            int    `json:"total_company_trains"`
		TotalStatenhancersUsed        int    `json:"total_statenhancers_used"`
	} `json:"stats"`
	Stocks map[string]*struct {
		Name            string `json:"name"`
		Acronym         string `json:"acronym"`
		Director        string `json:"director"`
		CurrentPrice    string `json:"current_price"`
		MarketCap       int    `json:"market_cap"`
		TotalShares     int    `json:"total_shares"`
		AvailableShares int    `json:"available_shares"`
		Forecast        string `json:"forecast"`
		Demand          string `json:"demand"`
		Benefit         struct {
			Requirement int    `json:"requirement"`
			Description string `json:"description"`
		} `json:"benefit,omitempty"`
	} `json:"stocks"`
	FactionTree map[string]map[string]*struct {
		Branch    string `json:"branch"`
		Name      string `json:"name"`
		Ability   string `json:"ability"`
		Challenge string `json:"challenge"`
		BaseCost  int    `json:"base_cost"`
	} `json:"factiontree"`
	Timestamp int `json:"timestamp"`
}

Torn contains all data found under the general "Torn" endpoint of the Torn API. This includes items, medals, honors, and other information about the game.

type User

type User struct {
	Rank       string   `json:"rank"`
	Level      int      `json:"level"`
	Gender     string   `json:"gender"`
	Property   string   `json:"property"`
	Signup     string   `json:"signup"`
	Awards     int      `json:"awards"`
	Friends    int      `json:"friends"`
	Enemies    int      `json:"enemies"`
	ForumPosts int      `json:"forum_posts"`
	Karma      int      `json:"karma"`
	Age        int      `json:"age"`
	Role       string   `json:"role"`
	Donator    int      `json:"donator"`
	ID         int      `json:"player_id"`
	Name       string   `json:"name"`
	PropertyID int      `json:"property_id"`
	Status     []string `json:"status"`
	Job        *struct {
		Position    string `json:"position"`
		CompanyID   int    `json:"company_id"`
		CompanyName string `json:"company_name"`
	} `json:"job"`
	Faction *struct {
		Position      string `json:"position"`
		ID            int    `json:"faction_id"`
		DaysInFaction int    `json:"days_in_faction"`
		Name          string `json:"faction_name"`
	} `json:"faction"`
	Married *struct {
		SpouseID   int    `json:"spouse_id"`
		SpouseName string `json:"spouse_name"`
		Duration   int    `json:"duration"`
	} `json:"married"`
	States *struct {
		HospitalTimestamp int `json:"hospital_timestamp"`
		JailTimestamp     int `json:"jail_timestamp"`
	}
	LastAction *struct {
		Timestamp int    `json:"timestamp"`
		Relative  string `json:"relative"`
	}
	Networth *struct {
		Pending      int     `json:"pending"`
		Wallet       int     `json:"wallet"`
		Bank         int     `json:"bank"`
		Points       int     `json:"points"`
		Cayman       int     `json:"cayman"`
		Vault        int     `json:"vault"`
		PiggyBank    int     `json:"piggybank"`
		Items        int     `json:"items"`
		DisplayCase  int     `json:"displaycase"`
		Bazaar       int     `json:"bazaar"`
		Properties   int     `json:"properties"`
		StockMarket  int     `json:"stockmarket"`
		AuctionHouse int     `json:"auctionhouse"`
		Company      int     `json:"company"`
		Bookie       int     `json:"bookie"`
		Loan         int     `json:"loan"`
		UnpaidFees   int     `json:"unpaidfees"`
		Total        int     `json:"total"`
		ParseTime    float64 `json:"parsetime"`
	} `json:"networth"`
	Bazaar []*struct {
		ID          int    `json:"ID"`
		Name        string `json:"name"`
		Type        string `json:"type"`
		Quantity    int    `json:"quantity"`
		Price       int    `json:"price"`
		MarketPrice int    `json:"market_price"`
	} `json:"bazaar"`
	Display []*struct {
	} `json:"display"` //TODO
	Inventory []*struct {
		ID          int    `json:"ID"`
		Name        string `json:"name"`
		Type        string `json:"type"`
		Quantity    int    `json:"quantity"`
		Equipped    int    `json:"equipped"`
		MarketPrice int    `json:"market_price"`
	} `json:"inventory"`
	HOF *struct {
		Attacks struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"attacks"`
		BattleStats struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"battlestats"`
		Busts struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"busts"`
		Defends struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"defends"`
		Networth struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"networth"`
		Offences struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"offences"`
		Revives struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"revives"`
		Traveled struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"traveled"`
		WorkStats struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"workstats"`
		Level struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"level"`
		Rank struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"rank"`
		Respect struct {
			Value int `json:"value"`
			Rank  int `json:"rank"`
		} `json:"respect"`
	} `json:"halloffame"`
	Travel *struct {
		Destination string `json:"destination"`
		Timestamp   int    `json:"timestamp"`
		Departed    int    `json:"departed"`
		TimeLeft    int    `json:"time_left"`
	} `json:"travel"`
	Events map[int]*struct {
		Timestamp int    `json:"timestamp"`
		Event     string `json:"event"`
		Seen      int    `json:"seen"`
	} `json:"events"`
	Messages map[int]*struct {
		Timestamp int    `json:"timestamp"`
		ID        int    `json:"ID"`
		Name      string `json:"name"`
		Type      string `json:"type"`
		Title     string `json:"title"`
		Seen      bool   `json:"seen"`
		Read      bool   `json:"read"`
	} `json:"messages"`
	EduCurrent    int   `json:"education_current"`
	EduTimeleft   int   `json:"education_timeleft"`
	EduCompleted  []int `json:"education_completed"`
	MedalsAwarded []int `json:"medals_awarded"`
	MedalsTime    []int `json:"medals_time"`
	HonorsAwards  []int `json:"honors_awarded"`
	HonorsTime    []int `json:"honors_time"`
	Notifications *struct {
		Messages    int `json:"messages"`
		Events      int `json:"events"`
		Awards      int `json:"awards"`
		Competition int `json:"competition"`
	} `json:"notifications"`
	PersonalStats *struct {
		Networth               int `json:"networth"`
		Logins                 int `json:"logins"`
		UserActivity           int `json:"useractivity"`
		Hospital               int `json:"hospital"`
		DefendsLost            int `json:"defendslost"`
		Killstreak             int `json:"killstreak"`
		MissionCreditsEarned   int `json:"missioncreditsearned"`
		AttackDamage           int `json:"attackdamage"`
		BestDamage             int `json:"bestdamage"`
		AttackHits             int `json:"attackhits"`
		PieHits                int `json:"piehits"`
		AttacksStealthed       int `json:"attacksstealthed"`
		MoneyMugged            int `json:"moneymugged"`
		LargestMugged          int `json:"largestmug"`
		AttacksWon             int `json:"attackswon"`
		HighestBeaten          int `json:"highestbeaten"`
		BestKillStreak         int `json:"bestkillstreak"`
		RoundsFired            int `json:"roundsfired"`
		AttackCriticalHits     int `json:"attackcriticalhits"`
		OneHitKills            int `json:"onehitkills"`
		RifHits                int `json:"rifhits"`
		AttackMisses           int `json:"attackmisses"`
		AttacksLost            int `json:"attackslost"`
		ItemsBought            int `json:"itemsbought"`
		DefendsWon             int `json:"defendswon"`
		MoneyInvested          int `json:"moneyinvested"`
		InvestedProfit         int `json:"investedprofit"`
		RevivesReceived        int `json:"revivesreceived"`
		DumpSearches           int `json:"dumpsearches"`
		DumpFinds              int `json:"dumpfinds"`
		Jailed                 int `json:"jailed"`
		RespectForFaction      int `json:"respectforfaction"`
		ConsumablesUsed        int `json:"consumablesused"`
		AlcoholUsed            int `json:"alcoholused"`
		ItemsDumped            int `json:"itemsdumped"`
		DaysBeenDonator        int `json:"daysbeendonator"`
		WeaponsBought          int `json:"weaponsbought"`
		ContractsCompleted     int `json:"contractscompleted"`
		DukeContractsCompleted int `json:"dukecontractscompleted"`
		OrganisedCrimes        int `json:"organisedcrimes"`
		MedicalItemsUsed       int `json:"medicalitemsused"`
		DrugsUsed              int `json:"drugsused"`
		XanTaken               int `json:"xantaken"`
		ItemsSent              int `json:"itemssent"`
		PisHits                int `json:"pishits"`
		YouRunAway             int `json:"yourunaway"`
		GreHits                int `json:"grehits"`
		BountiesPlaced         int `json:"bountiesplaced"`
		TotalBountySpent       int `json:"totalbountyspent"`
		PointsSold             int `json:"pointssold"`
		LsdTaken               int `json:"lsdtaken"`
		MissionsCompleted      int `json:"missionscompleted"`
		Trades                 int `json:"trades"`
		H2hHits                int `json:"h2hhits"`
		CandyUsed              int `json:"candyused"`
		TerritoryTime          int `json:"territorytime"`
		CityFinds              int `json:"cityfinds"`
		BountiesReceived       int `json:"bountiesreceived"`
		TrainsReceived         int `json:"trainsreceived"`
		TravelTimes            int `json:"traveltimes"`
		TravelTime             int `json:"traveltime"`
		LonTravel              int `json:"lontravel"`
		ItemsBoughtAbroad      int `json:"itemsboughtabroad"`
		MexTravel              int `json:"mextravel"`
		CayTravel              int `json:"caytravel"`
		ArgTravel              int `json:"argtravel"`
		CanTravel              int `json:"cantravel"`
		SouTravel              int `json:"soutravel"`
		SwiTravel              int `json:"switravel"`
		AxeHits                int `json:"axehits"`
		JapTravel              int `json:"japtravel"`
		MailsSent              int `json:"mailssent"`
		Overdosed              int `json:"overdosed"`
		ChiTravel              int `json:"chitravel"`
		DubTravel              int `json:"dubtravel"`
		HawTravel              int `json:"hawtravel"`
		BloodWithdrawn         int `json:"bloodwithdrawn"`
		BoostersUsed           int `json:"boostersused"`
		AttacksAssisted        int `json:"attacksassisted"`
		Rehabs                 int `json:"rehabs"`
		RehabCost              int `json:"rehabcost"`
		VirusesCoded           int `json:"virusescoded"`
		BazaarCustomers        int `json:"bazaarcustomers"`
		BazaarSales            int `json:"bazaarsales"`
		BazaarProfit           int `json:"bazaarprofit"`
		EnergyDrinkUsed        int `json:"energydrinkused"`
		ExtTaken               int `json:"exttaken"`
		PointsBought           int `json:"pointsbought"`
		BooksRead              int `json:"booksread"`
		BountiesCollected      int `json:"bountiescollected"`
		TotalBountyReward      int `json:"totalbountyreward"`
		FriendMailsSent        int `json:"friendmailssent"`
		FactionMailsSent       int `json:"factionmailssent"`
		AttacksDraw            int `json:"attacksdraw"`
		Awards                 int `json:"awards"`
		AuctionsWon            int `json:"auctionswon"`
		AuctionSells           int `json:"auctionsells"`
		MeritsBought           int `json:"meritsbought"`
		Refills                int `json:"refills"`
	} `json:"personalstats"`
	ManualLabor    int `json:"manual_labor"`
	Intelligence   int `json:"intelligence"`
	Endurance      int `json:"endurance"`
	CriminalRecord *struct {
		SellingIllegalProducts int `json:"selling_illegal_products"`
		Theft                  int `json:"theft"`
		AutoTheft              int `json:"auto_theft"`
		DrugDeals              int `json:"drug_deals"`
		ComputerCrimes         int `json:"computer_crimes"`
		Murder                 int `json:"murder"`
		FraudCrimes            int `json:"fraud_crimes"`
		Other                  int `json:"other"`
		Total                  int `json:"total"`
	} `json:"criminalrecord"`
	Icons     map[string]string `json:"icons"`
	Cooldowns *struct {
		Drug    int `json:"drug"`
		Medical int `json:"medical"`
		Booster int `json:"booster"`
	} `json:"cooldowns"`
	Points      int `json:"points"`
	CaymanBank  int `json:"cayman_bank"`
	VaultAmount int `json:"vault_amount"`
	// Networth int `json:"networth"` - duplicate key entry
	JobPerks         []string `json:"job_perks"`
	PropertyPerks    []string `json:"property_perks"`
	StockPerks       []string `json:"stock_perks"`
	MeritPerks       []string `json:"merit_perks"`
	EduPerks         []string `json:"education_perks"`
	EnhancerPerks    []string `json:"enhancer_perks"`
	CompanyPerks     []string `json:"company_perks"`
	FactionPerks     []string `json:"faction_perks"`
	Strength         string   `json:"strength"`
	Speed            string   `json:"speed"`
	Dexterity        string   `json:"dexterity"`
	Defense          string   `json:"defense"`
	BattleStatsTotal string   `json:"total"`
	StrengthMod      float32  `json:"strength_modifier"`
	DefenseMod       float32  `json:"defense_modifier"`
	SpeedMod         float32  `json:"speed_modifier"`
	DexterityMod     float32  `json:"dexterity_modifier"`
	StrengthInfo     []string `json:"strength_info"`
	DefenseInfo      []string `json:"defense_info"`
	SpeedInfo        []string `json:"speed_info"`
	DexterityInfo    []string `json:"dexterity_info"`
	ServerTime       int      `json:"server_time"`
	Happy            *struct {
		Current   int `json:"current"`
		Max       int `json:"maximum"`
		Increment int `json:"increment"`
		Interval  int `json:"interval"`
		TickTime  int `json:"ticktime"`
		FullTime  int `json:"fulltime"`
	} `json:"happy"`
	Life *struct {
		Current   int `json:"current"`
		Max       int `json:"maximum"`
		Increment int `json:"increment"`
		Interval  int `json:"interval"`
		TickTime  int `json:"ticktime"`
		FullTime  int `json:"fulltime"`
	} `json:"life"`
	Energy *struct {
		Current   int `json:"current"`
		Max       int `json:"maximum"`
		Increment int `json:"increment"`
		Interval  int `json:"interval"`
		TickTime  int `json:"ticktime"`
		FullTime  int `json:"fulltime"`
	} `json:"energy"`
	Nerve *struct {
		Current   int `json:"current"`
		Max       int `json:"maximum"`
		Increment int `json:"increment"`
		Interval  int `json:"interval"`
		TickTime  int `json:"ticktime"`
		FullTime  int `json:"fulltime"`
	} `json:"nerve"`
	Chain *struct {
		Current   int `json:"current"`
		Max       int `json:"maximum"`
		Increment int `json:"increment"`
		Interval  int `json:"interval"`
		TickTime  int `json:"ticktime"`
		FullTime  int `json:"fulltime"`
	} `json:"chain"`
	AttackDetails map[string]*struct {
		TimestampStarted    int    `json:"timestamp_started"`
		TimestampEnded      int    `json:"timestamp_ended"`
		AttackerID          int    `json:"attacker_id"`
		AttackerName        string `json:"attacker_name"`
		AttackerFactionID   int    `json:"attacker_faction"`
		AttackerFactionName string `json:"attacker_factionname"`
		DefenderID          int    `json:"defender_id"`
		DefenderName        string `json:"defender_name"`
		DefenderFactionID   int    `json:"defender_faction"`
		DefenderFactionName int    `json:"defender_factionname"`
		Result              string `json:"result"`
		Stealthed           int    `json:"stealthed"`
		RespectGain         int    `json:"respect_gain"`
		Chain               int    `json:"chain"`
		Modifiers           struct {
			FairFight   int    `json:"fairFight"`
			War         int    `json:"war"`
			Retaliation int    `json:"retaliation"`
			GroupAttack int    `json:"groupAttack"`
			Overseas    int    `json:"overseas"`
			ChainBonus  string `json:"chainBonus"`
		} `json:"modifiers"`
	} `json:"attacks"`
	Revives map[string]*struct {
	} `json:"revives"` // TODO
	Stocks map[string]*struct {
		ID          int    `json:"stock_id"`
		Shares      int    `json:"shares"`
		BoughtPrice string `json:"bought_price"`
		TimeBought  int    `json:"time_bought"`
		TimeListed  int    `json:"time_listed"`
	} `json:"stocks"`
	Properties map[string]*struct {
		OwnerID       int    `json:"owner_id"`
		Type          int    `json:"property_type"`
		Name          string `json:"property"`
		Status        string `json:"status"`
		Happy         int    `json:"happy"`
		Upkeep        int    `json:"upkeep"`
		StaffCost     int    `json:"staff_cost"`
		MarketPrice   int    `json:"market_price"`
		Modifications struct {
			Interior        int `json:"interior"`
			HotTub          int `json:"hot_tub"`
			Sauna           int `json:"sauna"`
			Pool            int `json:"pool"`
			OpenBar         int `json:"open_bar"`
			ShootingRange   int `json:"shooting_range"`
			Vault           int `json:"vault"`
			MedicalFacility int `json:"medical_facility"`
			Airstrip        int `json:"airstrip"`
			Yacht           int `json:"yacht"`
		} `json:"modifications"`
		Staff struct {
			Maid   int `json:"maid"`
			Guard  int `json:"guard"`
			Pilot  int `json:"pilot"`
			Butler int `json:"butler"`
			Doctor int `json:"doctor"`
		} `json:"staff"`
	} `json:"properties"`
	JobPoints *struct {
		Jobs struct {
			Army      int `json:"army"`
			Medical   int `json:"medical"`
			Casino    int `json:"casino"`
			Education int `json:"education"`
			Law       int `json:"law"`
			Grocer    int `json:"grocer"`
		} `json:"jobs"`
		Companies map[string]*struct {
			Name   int `json:"name"`
			Points int `json:"job_points"`
		}
	} `json:"jobpoints"`
	Merits *struct {
		NerveBar              int `json:"Nerve Bar"`
		CriticalHitRate       int `json:"Critical Hit Rate"`
		LifePoints            int `json:"Life Points"`
		CrimeExperience       int `json:"Crime Experience"`
		EduLength             int `json:"Education Length"`
		Awareness             int `json:"Awareness"`
		BankInterest          int `json:"Bank Interest"`
		MasterfulLooting      int `json:"Masterful Looting"`
		Stealth               int `json:"Stealth"`
		Hospitalizing         int `json:"Hospitalizing"`
		Brawn                 int `json:"Brawn"`
		Protection            int `json:"Protection"`
		Sharpness             int `json:"Sharpness"`
		Evasion               int `json:"Evasion"`
		HeavyArtilleryMastery int `json:"Heavy Artillery Mastery"`
		MachineGunMastery     int `json:"Machine Gun Mastery"`
		RifleMastery          int `json:"Rifle Mastery"`
		SMGMastery            int `json:"SMG Mastery"`
		ShotgunMastery        int `json:"Shotgun Mastery"`
		PistolMastery         int `json:"Pistol Master"`
		ClubMastery           int `json:"Club Mastery"`
		PiercingMastery       int `json:"Piercing Mastery"`
		SlashingMastery       int `json:"Slashing Mastery"`
		MechanicalMastery     int `json:"Mechanical Mastery"`
		TemporaryMastery      int `json:"Temporary Mastery"`
	} `json:"merits"`
	Refills *struct {
		EnergyRefillUsed        bool `json:"energy_refill_used"`
		NerveRefillUsed         bool `json:"nerve_refill_used"`
		TokenRefillUsed         bool `json:"token_refill_used"`
		SpecialRefillsAvailable int  `json:"special_refills_available"`
	} `json:"refills"`
	Discord *struct {
		UserID    int    `json:"userID"`
		DiscordID string `json:"discordID"`
	} `json:"discord"`
	ActiveGym int `json:"active_gym"`
	Timestamp int `json:"timestamp"`
}

User represents all data of a Torn user

Jump to

Keyboard shortcuts

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