Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Manager/Sources/RDMUICManager/BuildController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class BuildController {
"startupLocationLon=\(device.startupLocationLon)", "encounterMaxWait=\(device.encounterMaxWait)",
"encounterDelay=\(device.encounterDelay)", "fastIV=\(device.fastIV)", "ultraIV=\(device.ultraIV)",
"deployEggs=\(device.deployEggs)", "token=\(device.token)", "ultraQuests=\(device.ultraQuests)",
"attachScreenshots=\(device.attachScreenshots)"
"attachScreenshots=\(device.attachScreenshots)", "wildsOnly=\(device.wildsOnly)"
)

var contains = true
Expand Down Expand Up @@ -275,6 +275,9 @@ class BuildController {
if string!.contains(string: "[STATUS] IV") {
self.setStatus(uuid: device.uuid, status: "Running: IV")
}
if string!.contains(string: "[STATUS] WO Pokemon") {
self.setStatus(uuid: device.uuid, status: "Running: WO Pokemon")
}

fullLog.uic(message: string!, all: true)
debugLog.uic(message: string!, all: false)
Expand Down
17 changes: 17 additions & 0 deletions Manager/Sources/RDMUICManager/CLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class CLI {
Ultra Quests: \(device.ultraQuests.toBool())
Enabled: \(device.enabled.toBool())
AttachScreenshots: \(device.attachScreenshots.toBool())
Wilds Only: \(device.wildsOnly.toBool())
"""

print(row + "\n")
Expand Down Expand Up @@ -317,6 +318,11 @@ class CLI {
defaultDevice.attachScreenshots = attachScreenshots!.toInt()
}

let wildsOnly = askBool("Wilds Only (empty = \(defaultDevice.wildsOnly.toBool()))")
if wildsOnly != nil {
defaultDevice.wildsOnly = wildsOnly!.toInt()
}

do {
try defaultDevice.save()
clear()
Expand Down Expand Up @@ -473,6 +479,11 @@ class CLI {
attachScreenshots = defaultDevice.attachScreenshots
}

var wildsOnly = askBool("Wilds Only (empty = \(defaultDevice.wildsOnly.toBool()))")?.toInt()
if wildsOnly == nil {
wildsOnly = defaultDevice.wildsOnly
}

device.uuid = uuid
device.name = name
device.backendURL = backendURL
Expand Down Expand Up @@ -502,6 +513,7 @@ class CLI {
device.ultraQuests = ultraQuests!
device.enabled = enabled!
device.attachScreenshots = attachScreenshots!
device.wildsOnly = wildsOnly!

do {
try device.create()
Expand Down Expand Up @@ -674,6 +686,11 @@ class CLI {
device.attachScreenshots = attachScreenshots!.toInt()
}

let wildsOnly = askBool("Wilds Only (empty = \(device.wildsOnly.toBool()))")
if wildsOnly != nil {
device.wildsOnly = wildsOnly!.toInt()
}

do {
try device.save()
clear()
Expand Down
12 changes: 11 additions & 1 deletion Manager/Sources/RDMUICManager/Device.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class Device: SQLiteStORM, Equatable, Hashable {
var ultraQuests: Int
var enabled: Int
var attachScreenshots: Int
var wildsOnly: Int

override init() {
self.uuid = ""
Expand Down Expand Up @@ -84,6 +85,7 @@ class Device: SQLiteStORM, Equatable, Hashable {
self.ultraQuests = 0
self.enabled = 1
self.attachScreenshots = 0
self.wildsOnly = 0
super.init()
}

Expand All @@ -92,7 +94,7 @@ class Device: SQLiteStORM, Equatable, Hashable {
targetMaxDistance: Double, itemFullCount: Int, questFullCount: Int, itemsPerStop: Int, minDelayLogout: Double,
maxNoQuestCount: Int, maxFailedCount: Int, maxEmptyGMO: Int, startupLocationLat: Double,
startupLocationLon: Double, encounterMaxWait: Int, encounterDelay: Double, fastIV: Int, ultraIV: Int,
deployEggs: Int, token: String, ultraQuests: Int, enabled: Int, attachScreenshots: Int) {
deployEggs: Int, token: String, ultraQuests: Int, enabled: Int, attachScreenshots: Int, wildsOnly: Int) {
self.uuid = uuid
self.name = name
self.backendURL = backendURL
Expand Down Expand Up @@ -122,6 +124,7 @@ class Device: SQLiteStORM, Equatable, Hashable {
self.ultraQuests = ultraQuests
self.enabled = enabled
self.attachScreenshots = attachScreenshots
self.wildsOnly = wildsOnly
super.init()
}

Expand Down Expand Up @@ -159,6 +162,7 @@ class Device: SQLiteStORM, Equatable, Hashable {
ultraQuests = this.data["ultraQuests"] as? Int ?? 0
enabled = this.data["enabled"] as? Int ?? 1
attachScreenshots = this.data["attachScreenshots"] as? Int ?? 0
wildsOnly = this.data["wildsOnly"] as? Int ?? 0
}

static func getAll() -> [Device] {
Expand Down Expand Up @@ -213,6 +217,7 @@ class Device: SQLiteStORM, Equatable, Hashable {
var hasUltraQuests = false
var hasEnabled = false
var hasAttachScreenshots = false
var hasWildsOnly = false

let rows = try sqlRows("PRAGMA table_info(\(table()))", params: [String]())
for row in rows {
Expand All @@ -235,6 +240,8 @@ class Device: SQLiteStORM, Equatable, Hashable {
hasEnabled = true
} else if name == "attachScreenshots" {
hasAttachScreenshots = true
} else if name == "wildsOnly" {
hasWildsOnly = true
}
}

Expand Down Expand Up @@ -265,6 +272,9 @@ class Device: SQLiteStORM, Equatable, Hashable {
if !hasAttachScreenshots {
try sqlExec("ALTER TABLE \(table()) ADD COLUMN attachScreenshots INTEGER DEFAULT 0")
}
if !hasWildsOnly {
try sqlExec("ALTER TABLE \(table()) ADD COLUMN wildsOnly INTEGER DEFAULT 0")
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@
value = "$(attachScreenshots)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "wildsOnly"
value = "$(wildsOnly)"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
Expand Down
2 changes: 2 additions & 0 deletions RealDeviceMap-UIControl/Config.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Config {
var ultraQuests: Bool
var enabled: Bool
var attachScreenshots: Bool
var wildsOnly: Bool

init() {

Expand Down Expand Up @@ -74,6 +75,7 @@ class Config {
ultraQuests = enviroment["ultraQuests"]?.toBool() ?? false
enabled = enviroment["enabled"]?.toBool() ?? true
attachScreenshots = enviroment["attachScreenshots"]?.toBool() ?? false
wildsOnly = enviroment["wildsOnly"]?.toBool() ?? false
}

}
89 changes: 64 additions & 25 deletions RealDeviceMap-UIControl/RealDeviceMap_UIControlUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -926,37 +926,72 @@ class RealDeviceMap_UIControlUITests: XCTestCase {
self.emptyGmoCount = 0

if self.pokemonEncounterId != nil {
if (nearby + wild) > 0 {
if pokemonLat != nil && pokemonLon != nil &&
self.pokemonEncounterId == pokemonEncounterIdResult {
self.waitRequiresPokemon = false
let oldLocation = CLLocation(latitude: self.currentLocation!.lat,
longitude: self.currentLocation!.lon)
self.currentLocation = (pokemonLat!, pokemonLon!)
let newLocation = CLLocation(latitude: self.currentLocation!.lat,
longitude: self.currentLocation!.lon)
self.encounterDistance = newLocation.distance(from: oldLocation)
self.pokemonEncounterId = nil
if self.listScatterPokemon {
self.listScatterPokemon = false
self.scatterPokemon = data?["scatter_pokemon"]
as? [[String: Any]] ?? [[String: Any]]()
if !self.config.wildsOnly {
if (nearby + wild) > 0 {
if pokemonLat != nil && pokemonLon != nil &&
self.pokemonEncounterId == pokemonEncounterIdResult {
self.waitRequiresPokemon = false
let oldLocation = CLLocation(latitude: self.currentLocation!.lat,
longitude: self.currentLocation!.lon)
self.currentLocation = (pokemonLat!, pokemonLon!)
let newLocation = CLLocation(latitude: self.currentLocation!.lat,
longitude: self.currentLocation!.lon)
self.encounterDistance = newLocation.distance(from: oldLocation)
self.pokemonEncounterId = nil
if self.listScatterPokemon {
self.listScatterPokemon = false
self.scatterPokemon = data?["scatter_pokemon"]
as? [[String: Any]] ?? [[String: Any]]()
}
self.waitForData = false
toPrint = "[DEBUG] Got Data and found Nearby And Wild Pokemon"
} else {
toPrint = "[DEBUG] Got Data but didn't find Nearby And Wild Pokemon"
}
self.waitForData = false
toPrint = "[DEBUG] Got Data and found Pokemon"
} else {
toPrint = "[DEBUG] Got Data but didn't find Pokemon"
toPrint = "[DEBUG] Got Data without Nearby And Wild Pokemon"
}
} else {
toPrint = "[DEBUG] Got Data without Pokemon"
if (wild) > 0 {
if pokemonLat != nil && pokemonLon != nil &&
self.pokemonEncounterId == pokemonEncounterIdResult {
self.waitRequiresPokemon = false
let oldLocation = CLLocation(latitude: self.currentLocation!.lat,
longitude: self.currentLocation!.lon)
self.currentLocation = (pokemonLat!, pokemonLon!)
let newLocation = CLLocation(latitude: self.currentLocation!.lat,
longitude: self.currentLocation!.lon)
self.encounterDistance = newLocation.distance(from: oldLocation)
self.pokemonEncounterId = nil
if self.listScatterPokemon {
self.listScatterPokemon = false
self.scatterPokemon = data?["scatter_pokemon"]
as? [[String: Any]] ?? [[String: Any]]()
}
self.waitForData = false
toPrint = "[DEBUG] Got Data and found Wild Pokemon"
} else {
toPrint = "[DEBUG] Got Data but didn't find Wild Pokemon"
}
} else {
toPrint = "[DEBUG] Got Data without Wild Pokemon"
}
}

} else if self.waitRequiresPokemon {
if (nearby + wild) > 0 {
toPrint = "[DEBUG] Got Data with Pokemon"
self.waitForData = false
if !self.config.wildsOnly {
if (nearby + wild) > 0 {
toPrint = "[DEBUG] Got Data with Nearby And Wild Pokemon"
self.waitForData = false
} else {
toPrint = "[DEBUG] Got Data without Nearby And Wild Pokemon"
}
} else {
toPrint = "[DEBUG] Got Data without Pokemon"
if (wild) > 0 {
toPrint = "[DEBUG] Got Data with Wild Pokemon"
self.waitForData = false
} else {
toPrint = "[DEBUG] Got Data without Wild Pokemon"
}
}
} else {
toPrint = "[DEBUG] Got Data"
Expand Down Expand Up @@ -1202,7 +1237,11 @@ class RealDeviceMap_UIControlUITests: XCTestCase {
if let data = result!["data"] as? [String: Any], let action = data["action"] as? String {
self.action = action
if action == "scan_pokemon" {
print("[STATUS] Pokemon")
if self.config.wildsOnly {
print("[STATUS] WO Pokemon")
} else {
print("[STATUS] Pokemon")
}
if self.hasWarning && self.config.enableAccountManager {
Log.info("Account has a warning and tried to scan for Pokemon. Logging out!")
self.lock.lock()
Expand Down