SWITFTLOCK Swift
SWITFTLOCK Swift
struct PlayerData {
var coordEW: Double
var coordNS: Double
var coordUD: Double
// Add other properties if necessary
}
struct Patches {
static var lookXa: UnsafeMutableRawPointer =
UnsafeMutableRawPointer(bitPattern: 0)! // Replace with the actual address
static var lookYa: UnsafeMutableRawPointer =
UnsafeMutableRawPointer(bitPattern: 0)! // Replace with the actual address
}
// Seção 1
if op.coordEW > cP.coordEW && op.coordNS <= cP.coordNS {
EWdif = op.coordEW - cP.coordEW
NSdif = cP.coordNS - op.coordNS
angleA = atan(NSdif / EWdif) * 57.29578
angleP = angleA / 360
newValue = -0xFFFFFFFF * (0xFFFFFFFF * angleP)
newValue2 = UInt32(newValue)
poke(address: Patches.lookXa, value: newValue2)
}
// Seção 2, 3, 4 (similares)
// ...
// Olhar para a Y-
let flatDist = sqrt(EWdif * EWdif + NSdif * NSdif)
if op.coordUD == cP.coordUD {
let zero4: [UInt8] = [0x00, 0x00, 0x00, 0x00]
poke(address: Patches.lookYa, value: zero4)
} else if op.coordUD > cP.coordUD {
UDdif = op.coordUD - cP.coordUD
angleB = atan(UDdif / flatDist) * 57.29578
angleBP = angleB / 360
newValueb = 0 * (angleBP * 0xFFFFFFFF)
newValueb2 = UInt32(newValueb)
poke(address: Patches.lookYa, value: newValueb2)
} else if op.coordUD < cP.coordUD {
UDdif = cP.coordUD - op.coordUD
angleB = atan(UDdif / flatDist) * 57.29578
angleBP = angleB / 360
newValueb = -0xFFFFFFFF * (0xFFFFFFFF * angleBP)
newValueb2 = UInt32(newValueb)
poke(address: Patches.lookYa, value: newValueb2)
}
}