Skip to content

Commit

Permalink
updated fishing routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Jackson committed Aug 25, 2024
1 parent 6c366f6 commit ed7c0f1
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 62 deletions.
36 changes: 25 additions & 11 deletions cmd/fishing/fishing.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,38 @@ func main() {
}
resp, err := artifacts.Client.ActionGathering(*artifacts.Client.CharacterName)
if errors.Is(err, utils.ErrCharacterInventoryFull) {
bankX, bankY := artifacts.Client.FindBuilding(models.Bank)
resp, err := artifacts.Client.ActionMove(*artifacts.Client.CharacterName, models.ActionMove{
X: bankX,
Y: bankY,
})
if err != nil {
utils.Logger.Error("failed to move character", zap.Error(err))
continue
if x == models.BassX || x == models.TroutX {
bankX, bankY := artifacts.Client.FindBuilding(models.SouthBank)
resp, err := artifacts.Client.ActionMove(*artifacts.Client.CharacterName, models.ActionMove{
X: bankX,
Y: bankY,
})
if err != nil {
utils.Logger.Error("failed to move character", zap.Error(err))
continue
}
fmt.Printf("moving character to bank (x=%d y=%d)\n", bankX, bankY)
time.Sleep(utils.CalculateTimeDifference(resp.Data.Cooldown.StartedAt, resp.Data.Cooldown.Expiration))
} else {
bankX, bankY := artifacts.Client.FindBuilding(models.Bank)
resp, err := artifacts.Client.ActionMove(*artifacts.Client.CharacterName, models.ActionMove{
X: bankX,
Y: bankY,
})
if err != nil {
utils.Logger.Error("failed to move character", zap.Error(err))
continue
}
fmt.Printf("moving character to bank (x=%d y=%d)\n", bankX, bankY)
time.Sleep(utils.CalculateTimeDifference(resp.Data.Cooldown.StartedAt, resp.Data.Cooldown.Expiration))
}
fmt.Printf("moving character to bank (x=%d y=%d)\n", bankX, bankY)
time.Sleep(utils.CalculateTimeDifference(resp.Data.Cooldown.StartedAt, resp.Data.Cooldown.Expiration))
c, err := artifacts.Client.GetCharacter(*artifacts.Client.CharacterName)
if err != nil {
utils.Logger.Error("failed to get character information", zap.Error(err))
continue
}
controllers.DepositAllInventory(c.Data.Inventory)
resp, err = artifacts.Client.ActionMove(*artifacts.Client.CharacterName, models.ActionMove{
resp, err := artifacts.Client.ActionMove(*artifacts.Client.CharacterName, models.ActionMove{
X: x,
Y: y,
})
Expand Down
25 changes: 23 additions & 2 deletions internal/artifacts/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,24 @@ import (
// FindBuilding
// Returns the coordinates for different buildings.
func (a *artifacts) FindBuilding(building string) (int, int) {
if building == models.Bank {
switch building {
case models.Bank:
return models.BankX, models.BankY
} else {
case models.SouthBank:
return models.SouthBankX, models.SouthBankY
case models.CookingWorkshop:
return models.CookingWorkshopX, models.CookingWorkshopY
case models.GearcraftingWorkshop:
return models.GearcraftingWorkshopX, models.GearcraftingWorkshopY
case models.JewelrycraftingWorkshop:
return models.JewelrycraftingWorkshopX, models.JewelrycraftingWorkshopY
case models.MiningWorkshop:
return models.MiningWorkshopX, models.MiningWorkshopY
case models.WeaponcraftingWorkshop:
return models.WeaponcraftingWorkshopX, models.WeaponcraftingWorkshopY
case models.WoodcuttingWorkshop:
return models.WoodcuttingWorkshopX, models.WoodcuttingWorkshopY
default:
return 0, 0
}
}
Expand All @@ -29,3 +44,9 @@ func (a *artifacts) FindRocks(rock string) (int, int) {
return 0, 0
}
}

// FindTrees
// Returns the coordinates for different tree resources.
func (a *artifacts) FindTrees(tree string) (int, int) {
return 0, 0
}
126 changes: 77 additions & 49 deletions internal/models/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,83 @@ package models
import "time"

const (
AshTree string = "ash_tree"
AshTeeX int = 6
AshTreeY int = 1
Bank string = "bank"
BankX int = 4
BankY int = 1
Bass string = "bass"
BassLevel int = 30
BassX int = -3
BassY int = 6
BirchTree string = "birch_tree"
BirchTreeLevel int = 20
BirchTreeX int = 3
BirchTreeY int = 5
CoalLevel int = 20
Coal string = "coal_rocks"
CoalX int = 1
CoalY int = 6
Copper string = "copper_ore"
CopperX int = 2
CopperY int = 0
Gudgeon string = "gudgeon"
GudgeonX int = 4
GudgeonY int = 2
GoldLevel int = 30
Gold string = "gold_rocks"
GoldX int = 10
GoldY int = -4
ItemTypeConsumable string = ""
ItemTypeBodyArmor string = ""
IronLevel int = 10
Iron string = "iron_rocks"
IronX int = 1
IronY int = 7
Shrimp string = "shrimp"
ShrimpLevel int = 10
ShrimpX int = 5
ShrimpY int = 2
SpruceTree string = "spruce_tree"
SpruceTreeLevel int = 10
SpruceTreeX int = 2
SpruceTreeY int = 6
Trout string = "trout"
TroutLevel int = 20
TroutX int = -2
TroutY int = 6
ItemRetrieved string = "item_retrieved"
TaskCreated string = "task_created"
TaskRetrieved string = "task_retrieved"
AshTree string = "ash_tree"
AshTeeX int = 6
AshTreeY int = 1
Bank string = "bank"
BankX int = 4
BankY int = 1
SouthBank string = "south_bank"
SouthBankX int = 7
SouthBankY int = 13
Bass string = "bass"
BassLevel int = 30
BassX int = 6
BassY int = 12
BirchTree string = "birch_tree"
BirchTreeLevel int = 20
BirchTreeX int = 3
BirchTreeY int = 5
Crafting string = "crafting"
CoalLevel int = 20
Coal string = "coal_rocks"
CoalX int = 1
CoalY int = 6
CookingWorkshop string = "cooking_workshop"
CookingWorkshopX int = 1
CookingWorkshopY int = 1
Copper string = "copper_ore"
CopperX int = 2
CopperY int = 0
DeadTree string = "dead_tree"
DeadTreeLevel int = 30
DeadTreeX int = 9
DeadTreeY int = 8
ForgeWorkshop string = "forge_workshop"
GearcraftingWorkshop string = "gearcrafting_workshop"
GearcraftingWorkshopX int = 3
GearcraftingWorkshopY int = 1
Gudgeon string = "gudgeon"
GudgeonX int = 4
GudgeonY int = 2
GoldLevel int = 30
Gold string = "gold_rocks"
GoldX int = 10
GoldY int = -4
InventorySize int = 100
ItemTypeConsumable string = ""
ItemTypeBodyArmor string = ""
IronLevel int = 10
Iron string = "iron_rocks"
IronX int = 1
IronY int = 7
JewelrycraftingWorkshop string = "jewelrycrafting_workshop"
JewelrycraftingWorkshopX int = 1
JewelrycraftingWorkshopY int = 3
MiningWorkshop string = "mining_workshop"
MiningWorkshopX int = 1
MiningWorkshopY int = 5
Shrimp string = "shrimp"
ShrimpLevel int = 10
ShrimpX int = 5
ShrimpY int = 2
SpruceTree string = "spruce_tree"
SpruceTreeLevel int = 10
SpruceTreeX int = 2
SpruceTreeY int = 6
Trout string = "trout"
TroutLevel int = 20
TroutX int = 7
TroutY int = 12
ItemRetrieved string = "item_retrieved"
TaskCreated string = "task_created"
TaskRetrieved string = "task_retrieved"
WeaponcraftingWorkshop string = "weaponcrafting_workshop"
WeaponcraftingWorkshopX int = 2
WeaponcraftingWorkshopY int = 1
WoodcuttingWorkshop string = "woodcutting_workshop"
WoodcuttingWorkshopX int = -2
WoodcuttingWorkshopY int = -3
)

type Cooldown struct {
Expand Down

0 comments on commit ed7c0f1

Please sign in to comment.