script_name("BustedHack")
script_url("vk.com/ogskater")
script_author("BustedHack")
script_description("Smooth Aim")
script_version_number(1.0)
require("lib.moonloader")
slot0 = require("moonloader").download_status
slot1 = "huy"
slot2 = false
slot3 = nil
slot5 = require("imgui")
slot7 = slot5.GetStyle().Colors
slot8 = slot5.Col
slot9 = slot5.ImVec4
require("encoding").default = "CP866"
u8 = require("encoding").UTF8
slot11 = slot5.ImBool(false)
slot13 = require("inicfg").load({
settings = {
aupd = ({
checkboxes = {
aupd = slot5.ImBool(false),
aim = slot5.ImBool(false),
auto = slot5.ImBool(false),
trigger = slot5.ImBool(false),
reverse = slot5.ImBool(false),
skipOut = slot5.ImBool(false),
skipFar = slot5.ImBool(false),
skipNPCs = slot5.ImBool(false),
skipDead = slot5.ImBool(false),
skipPaused = slot5.ImBool(false),
checkBuildings = slot5.ImBool(false),
checkVehicles = slot5.ImBool(false),
checkActors = slot5.ImBool(false),
checkObjects = slot5.ImBool(false),
checkParticles = slot5.ImBool(false),
trigger_checkSolid = slot5.ImBool(false),
trigger_car = slot5.ImBool(false),
trigger_ped = slot5.ImBool(false),
trigger_object = slot5.ImBool(false),
trigger_particle = slot5.ImBool(false),
trigger_seeThrough = slot5.ImBool(false),
trigger_ignoreSomeObjects = slot5.ImBool(false),
trigger_shotThrough = slot5.ImBool(false),
checkProtected = slot5.ImBool(false),
checkDrive = slot5.ImBool(false),
checkClist = slot5.ImBool(false),
checkSkin = slot5.ImBool(false),
checkStun = slot5.ImBool(false),
findbone = slot5.ImBool(false),
findbone_inversion = slot5.ImBool(false),
findcolor = slot5.ImBool(false),
findcolor_inversion = slot5.ImBool(false),
findmodel = slot5.ImBool(false),
findmodel_inversion = slot5.ImBool(false),
findweapon = slot5.ImBool(false),
findweapon_inversion = slot5.ImBool(false),
fieldofvisible = slot5.ImBool(false),
fieldofvisible_visible = slot5.ImBool(false)
},
sliders = {
time = slot5.ImInt(1),
radius = slot5.ImFloat(0),
trigger_radius = slot5.ImFloat(0),
fieldofvisible_border_red = slot5.ImInt(0),
fieldofvisible_border_green = slot5.ImInt(0),
fieldofvisible_border_blue = slot5.ImInt(0),
fieldofvisible_border_alpha = slot5.ImInt(0),
fieldofvisible_bcolor_red = slot5.ImInt(0),
fieldofvisible_bcolor_green = slot5.ImInt(0),
fieldofvisible_bcolor_blue = slot5.ImInt(0),
fieldofvisible_bcolor_alpha = slot5.ImInt(0),
fieldofvisible_radians = slot5.ImFloat(0)
},
buffers = {
bone_id = slot5.ImBuffer(16),
color_id = slot5.ImBuffer(16),
model_id = slot5.ImBuffer(16),
weapon_id = slot5.ImBuffer(16)
}
})["checkboxes"].aupd.v,
aim = ()["checkboxes"].aim.v,
auto = ()["checkboxes"].auto.v,
time = ()["sliders"].time.v,
radius = ()["sliders"].radius.v,
trigger = ()["checkboxes"].trigger.v,
reverse = ()["checkboxes"].reverse.v,
skipOut = ()["checkboxes"].skipOut.v,
skipFar = ()["checkboxes"].skipFar.v,
skipNPCs = ()["checkboxes"].skipNPCs.v,
skipDead = ()["checkboxes"].skipDead.v,
skipPaused = ()["checkboxes"].skipPaused.v,
checkBuildings = ()["checkboxes"].checkBuildings.v,
checkVehicles = ()["checkboxes"].checkVehicles.v,
checkActors = ()["checkboxes"].checkActors.v,
checkObjects = ()["checkboxes"].checkObjects.v,
checkParticles = ()["checkboxes"].checkParticles.v,
trigger_checkSolid = ()["checkboxes"].trigger_checkSolid.v,
trigger_car = ()["checkboxes"].trigger_car.v,
trigger_ped = ()["checkboxes"].trigger_ped.v,
trigger_object = ()["checkboxes"].trigger_object.v,
trigger_particle = ()["checkboxes"].trigger_particle.v,
trigger_seeThrough = ()["checkboxes"].trigger_seeThrough.v,
trigger_ignoreSomeObjects = ()["checkboxes"].trigger_ignoreSomeObjects.v,
trigger_shotThrough = ()["checkboxes"].trigger_shotThrough.v,
checkProtected = ()["checkboxes"].checkProtected.v,
checkDrive = ()["checkboxes"].checkDrive.v,
checkClist = ()["checkboxes"].checkClist.v,
checkSkin = ()["checkboxes"].checkSkin.v,
checkStun = ()["checkboxes"].checkStun.v,
findbone = ()["checkboxes"].findbone.v,
findcolor = ()["checkboxes"].findcolor.v,
findmodel = ()["checkboxes"].findmodel.v,
findweapon = ()["checkboxes"].findweapon.v,
findbone_inversion = ()["checkboxes"].findbone_inversion.v,
findcolor_inversion = ()["checkboxes"].findcolor_inversion.v,
findmodel_inversion = ()["checkboxes"].findmodel_inversion.v,
findweapon_inversion = ()["checkboxes"].findweapon_inversion.v,
fieldofvisible = ()["checkboxes"].fieldofvisible.v,
trigger_radius = ()["sliders"].trigger_radius.v,
fieldofvisible_visible = ()["checkboxes"].fieldofvisible_visible.v,
fieldofvisible_border_red = ()["sliders"].fieldofvisible_border_red.v,
fieldofvisible_border_green = ()["sliders"].fieldofvisible_border_green.v,
fieldofvisible_border_blue = ()["sliders"].fieldofvisible_border_blue.v,
fieldofvisible_border_alpha = ()["sliders"].fieldofvisible_border_alpha.v,
fieldofvisible_bcolor_red = ()["sliders"].fieldofvisible_bcolor_red.v,
fieldofvisible_bcolor_green = ()["sliders"].fieldofvisible_bcolor_green.v,
fieldofvisible_bcolor_blue = ()["sliders"].fieldofvisible_bcolor_blue.v,
fieldofvisible_bcolor_alpha = ()["sliders"].fieldofvisible_bcolor_alpha.v,
fieldofvisible_radians = ()["sliders"].fieldofvisible_radians.v
}
})
slot14 = getWorkingDirectory() .. "/config/" .. script.this.filename .. ".bones.txt"
slot15 = getWorkingDirectory() .. "/config/" .. script.this.filename .. ".colors.txt"
slot16 = getWorkingDirectory() .. "/config/" .. script.this.filename .. ".models.txt"
slot17 = getWorkingDirectory() .. "/config/" .. script.this.filename .. ".weapons.txt"
slot18, slot19, slot20, slot21 = nil
slot22 = {
"DAM_armL_frmBK",
"DAM_armL_frmFT",
"DAM_armL_frmLT",
"DAM_armR_frmBK",
"DAM_armR_frmFT",
"DAM_armR_frmRT",
"DAM_LegL_frmBK",
"DAM_LegL_frmFT",
"DAM_LegL_frmLT",
"DAM_LegR_frmBK",
"DAM_LegR_frmFT",
"DAM_LegR_frmRT",
"DAM_stomach_frmBK",
"DAM_stomach_frmFT",
"DAM_stomach_frmLT",
"DAM_stomach_frmRT"
}
slot24 = require("ffi").cast("int (__thiscall*)(void*, float*, int, bool)", 6177408)
slot25 = {
BONE_PELVIS1 = {
i = 1,
z = 0,
x = 0,
y = 0
},
BONE_PELVIS = {
i = 2,
z = 0,
x = 0,
y = 0
},
BONE_SPINE1 = {
i = 3,
z = 0,
x = 0,
y = 0
},
BONE_UPPERTORSO = {
i = 4,
z = 0,
x = 0,
y = 0
},
BONE_NECK = {
i = 5,
z = 0,
x = 0,
y = 0
},
BONE_HEAD2 = {
i = 6,
z = 0,
x = 0,
y = 0
},
BONE_HEAD1 = {
i = 7,
z = 0,
x = 0,
y = 0
},
BONE_HEAD = {
i = 8,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTUPPERTORSO = {
i = 21,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTSHOULDER = {
i = 22,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTELBOW = {
i = 23,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTWRIST = {
i = 24,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTHAND = {
i = 25,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTTHUMB = {
i = 26,
z = 0,
x = 0,
y = 0
},
BONE_LEFTUPPERTORSO = {
i = 31,
z = 0,
x = 0,
y = 0
},
BONE_LEFTSHOULDER = {
i = 32,
z = 0,
x = 0,
y = 0
},
BONE_LEFTELBOW = {
i = 33,
z = 0,
x = 0,
y = 0
},
BONE_LEFTWRIST = {
i = 34,
z = 0,
x = 0,
y = 0
},
BONE_LEFTHAND = {
i = 35,
z = 0,
x = 0,
y = 0
},
BONE_LEFTTHUMB = {
i = 36,
z = 0,
x = 0,
y = 0
},
BONE_LEFTHIP = {
i = 41,
z = 0,
x = 0,
y = 0
},
BONE_LEFTKNEE = {
i = 42,
z = 0,
x = 0,
y = 0
},
BONE_LEFTANKLE = {
i = 43,
z = 0,
x = 0,
y = 0
},
BONE_LEFTFOOT = {
i = 44,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTHIP = {
i = 51,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTKNEE = {
i = 52,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTANKLE = {
i = 53,
z = 0,
x = 0,
y = 0
},
BONE_RIGHTFOOT = {
i = 54,
z = 0,
x = 0,
y = 0
}
}
function slot5.OnDrawFrame()
if uv0.v then
uv1.SetNextWindowSize(uv1.ImVec2(200, 400), uv1.Cond.FirstUseEver)
uv1.Begin("HotSoft Menu", uv0)
PaintTrigger()
PaintAim()
uv1.End()
end
end
function switch()
while true do
wait(0)
if isKeyJustPressed(VK_F10) then
uv0.v = not uv0.v
end
end
end
function argbToHex(slot0)
slot1 = "0X"
for slot5, slot6 in pairs(slot0) do
slot7 = ""
while slot6 > 0 do
slot6 = math.floor(slot6 / 16)
slot7 = string.sub("0123456789ABCDEF", math.fmod(math.floor(slot6 / 16), 16) + 1, ) .. slot7
end
if string.len(slot7) == 0 then
slot7 = "00"
elseif string.len(slot7) == 1 then
slot7 = "0" .. slot7
end
slot1 = slot1 .. slot7
end
return slot1
end
function trigger()
while true do
wait(0)
if uv0.checkboxes.trigger.v and isKeyDown(VK_RBUTTON) then
slot9, slot10, slot11 = getActiveCameraCoordinates()
slot6, slot7 = convertGameScreenCoordsToWindowScreenCoords(339.1, 179.1)
slot12, slot13, slot14 = convertScreenCoordsToWorld3D(slot3, slot4, uv0.sliders.trigger_radius.v)
slot8, slot9 = processLineOfSight(slot0, slot1, slot2, slot5, slot6, slot7, uv0.checkboxes.trigger_checkSolid.v, uv0.checkboxes.trigger_car.v, uv0.checkboxes.trigger_ped.v, uv0.checkboxes.trigger_object.v, uv0.checkboxes.trigger_particle.v, uv0.checkboxes.trigger_seeThrough.v, uv0.checkboxes.trigger_ignoreSomeObjects.v, uv0.checkboxes.trigger_shotThrough.v)
if slot8 and isLineOfSightClear(slot0, slot1, slot2, slot9.pos[1], slot9.pos[2], slot9.pos[3], not uv0.checkboxes.trigger_checkSolid.v, not uv0.checkboxes.trigger_car.v, not uv0.checkboxes.trigger_ped.v, not uv0.checkboxes.trigger_object.v, not uv0.checkboxes.trigger_particle.v) then
writeMemory(12006522, 4, 255, 0)
end
end
end
end
function paint()
while true do
wait(0)
if uv0.checkboxes.aim.v and uv0.checkboxes.fieldofvisible.v and uv0.checkboxes.fieldofvisible_visible.v then
slot0, slot1 = getScreenResolution()
slot5, slot6 = convertGameScreenCoordsToWindowScreenCoords(339.1, 179.1)
renderDrawBoxWithBorder(slot5 - uv0.sliders.fieldofvisible_radians.v * slot0 / (getCameraFov() * 0.0174533) / 2, slot6 - uv0.sliders.fieldofvisible_radians.v * slot0 / (getCameraFov() * 0.0174533) / 2, uv0.sliders.fieldofvisible_radians.v * slot0 / (getCameraFov() * 0.0174533), , argbToHex(slot9), 1, argbToHex(slot7))
end
end
end
function gui()
while true do
wait(0)
uv0.Process = uv1.v
end
end
function main()
repeat
wait(0)
until isSampAvailable()
load_ini()
if uv0.checkboxes.aupd.v then
download_ini()
end
lua_thread.create(trigger)
lua_thread.create(paint)
lua_thread.create(gui)
lua_thread.create(switch)
while true do
wait(uv0.sliders.time.v)
if uv0.checkboxes.findbone.v then
uv1 = lines_from(uv2)
end
if uv0.checkboxes.findcolor.v then
uv3 = lines_from(uv4)
end
if uv0.checkboxes.findmodel.v then
uv5 = lines_from(uv6)
end
if uv0.checkboxes.findweapon.v then
uv7 = lines_from(uv8)
end
if uv0.checkboxes.aim.v and (not uv0.checkboxes.auto.v and isKeyDown(VK_LBUTTON) or uv0.checkboxes.auto.v and isKeyDown(VK_RBUTTON)) and isPlayerPlaying(playerHandle) and (not uv0.checkboxes.checkDrive.v or uv0.checkboxes.checkDrive.v and not isCharInAnyCar(playerPed)) and (not uv0.checkboxes.checkStun.v or uv0.checkboxes.checkStun.v and CheckStuned()) then
slot4, slot5, slot6 = getActiveCameraCoordinates()
slot3, slot4 = findAllRandomCharsInSphere(slot0, slot1, slot2, uv0.sliders.radius.v, false, uv0.checkboxes.skipDead.v)
if slot3 then
slot5 = 0
slot6 = 0
slot7 = 0
slot8 = 0
slot9 = 0
slot10 = 0
slot11 = 0
slot12 = 0
slot13 = 0
slot16 = math.abs(slot14)
slot17 = math.abs(slot15)
slot18 = 0
slot19 = 0
slot20 = getCurrentCharWeapon(playerPed)
if not uv0.checkboxes.findweapon.v or uv0.checkboxes.findweapon.v and uv0.checkboxes.findweapon_inversion.v == lines_find(uv7, slot20) then
if slot20 >= 22 and slot20 <= 29 or slot20 == 32 then
slot18 = -0.0778
slot19 = 0.04253
elseif slot20 == 30 or slot20 == 31 then
slot18 = -0.052
slot19 = 0.028
elseif slot20 == 33 then
slot18 = -0.0357
slot19 = 0.01897
end
repeat
slot21 = false
slot22 = false
slot23 = false
if (not uv0.checkboxes.checkSkin.v or uv0.checkboxes.checkSkin.v and getCharModel(slot4) ~= getCharModel(playerPed)) and (not uv0.checkboxes.findmodel.v or uv0.checkboxes.findmodel.v and uv0.checkboxes.findmodel_inversion.v == lines_find(uv5, getCharModel(slot4))) then
if uv0.checkboxes.checkProtected.v then
slot6 = sampGetPlayerHealth(select(2, sampGetPlayerIdByCharHandle(slot4))) + sampGetPlayerArmor(select(2, sampGetPlayerIdByCharHandle(slot4)))
if slot7 == 0 or slot6 <= slot7 then
slot23 = true
end
end
if (not uv0.checkboxes.checkProtected.v or uv0.checkboxes.checkProtected.v and slot23) and (not uv0.checkboxes.checkClist.v or uv0.checkboxes.checkClist.v and sampGetPlayerColor(select(2, sampGetPlayerIdByCharHandle(slot4))) ~= sampGetPlayerColor(select(2, sampGetPlayerIdByCharHandle(playerPed)))) and (not uv0.checkboxes.findcolor.v or uv0.checkboxes.findcolor.v and uv0.checkboxes.findcolor_inversion.v == lines_find(uv3, sampGetPlayerColor(select(2, sampGetPlayerIdByCharHandle(slot4))))) then
if uv0.checkboxes.skipNPCs.v then
slot24, slot25 = sampGetPlayerIdByCharHandle(slot4)
if slot24 and sampIsPlayerNpc(slot25) then
slot21 = true
end
end
if uv0.checkboxes.skipPaused.v then
slot24, slot25 = sampGetPlayerIdByCharHandle(slot4)
if slot24 and sampIsPlayerPaused(slot25) then
slot22 = true
end
end
if (uv0.checkboxes.skipNPCs.v and not slot21 or not uv0.checkboxes.skipNPCs.v) and (uv0.checkboxes.skipPaused.v and not slot22 or not uv0.checkboxes.skipPaused.v) then
for slot27, slot28 in pairs(uv9) do
if not uv0.checkboxes.findbone.v or uv0.checkboxes.findbone.v and uv0.checkboxes.findbone_inversion.v == lines_find(uv1, uv9[slot27].i) then
uv9[slot27].x, uv9[slot27].y, uv9[slot27].z = getBodyPartCoordinates(uv9[slot27].i, slot4)
slot29 = uv9[slot27].x
slot30 = uv9[slot27].y
slot31 = uv9[slot27].z
if (not uv0.checkboxes.skipOut.v or uv0.checkboxes.skipOut.v and isPointOnScreen(slot29, slot30, slot31, 0)) and isLineOfSightClear(slot0, slot1, slot2, slot29, slot30, slot31, uv0.checkboxes.checkBuildings.v, uv0.checkboxes.checkVehicles.v, uv0.checkboxes.checkActors.v, uv0.checkboxes.checkObjects.v, uv0.checkboxes.checkParticles.v) then
slot32 = getDistanceBetweenCoords3d(slot0, slot1, slot2, slot29, slot30, slot31)
if not uv0.checkboxes.skipFar.v or uv0.checkboxes.skipFar.v and (slot5 == 0 or slot32 < slot5) then
slot5 = slot32
slot35 = math.abs(slot33)
slot36 = math.abs(slot34)
slot37 = 0
slot38 = 0
if slot15 > 0 and slot33 < 0 or slot33 > 0 and slot15 < 0 then
slot37 = slot17 + slot35
elseif slot35 < slot17 then
slot37 = slot17 - slot35
elseif slot17 < slot35 then
slot37 = slot35 - slot17
end
if slot14 > 0 and slot34 < 0 or slot34 > 0 and slot14 < 0 then
slot38 = slot16 + slot36
elseif slot36 < slot16 then
slot38 = slot16 - slot36
elseif slot16 < slot36 then
slot38 = slot36 - slot16
end
if slot37 ~= 0 then
slot8 = slot33 < slot15 and (math.pi < slot37 and (math.pi * 2 - slot37) / uv0.sliders.time.v or -slot37 / uv0.sliders.time.v) or math.pi < slot37 and -(math.pi * 2 - slot37) / uv0.sliders.time.v or slot37 / uv0.sliders.time.v
end
if slot38 ~= 0 then
slot11 = slot34 < slot14 and (math.pi < slot38 and (math.pi * 2 - slot38) / uv0.sliders.time.v or -slot38 / uv0.sliders.time.v) or math.pi < slot38 and -(math.pi * 2 - slot38) / uv0.sliders.time.v or slot38 / uv0.sliders.time.v
end
if not uv0.checkboxes.fieldofvisible.v or uv0.checkboxes.fieldofvisible.v and slot37 < uv0.sliders.fieldofvisible_radians.v and slot38 < uv0.sliders.fieldofvisible_radians.v then
if uv0.checkboxes.reverse.v then
slot8 = slot8 > 0 and slot37 - slot8 or -(slot37 + slot8)
slot11 = slot11 > 0 and slot38 - slot11 or -(slot38 + slot11)
end
if slot9 == 0 or slot12 == 0 or math.abs(slot8) < math.abs(slot9) or math.abs(slot11) < math.abs(slot12) then
slot9 = slot8
slot12 = slot11
end
end
end
end
end
end
if slot10 == 0 or slot13 == 0 or math.abs(slot9) < math.abs(slot10) or math.abs(slot12) < math.abs(slot13) then
if uv0.checkboxes.checkProtected.v then
slot7 = slot6
end
slot10 = slot9
slot13 = slot12
end
end
end
end
slot3, slot4 = findAllRandomCharsInSphere(slot0, slot1, slot2, uv0.sliders.radius.v, true, uv0.checkboxes.skipDead.v)
until not slot24
setCameraPositionUnfixed(slot14 + slot13, slot15 + slot10)
end
end
end
end
end
function CheckStuned()
for slot3, slot4 in pairs(uv0) do
if isCharPlayingAnim(playerPed, slot4) then
return false
end
end
return true
end
function fix(slot0)
while math.pi < slot0 do
slot0 = slot0 - math.pi * 2
end
while slot0 < -math.pi do
slot0 = slot0 + math.pi * 2
end
return slot0
end
function save_ini()
uv0.save(uv1, script.this.filename .. ".ini")
end
function load_ini()
if uv0.load(uv1, script.this.filename .. ".ini") then
uv2.checkboxes.aim.v = slot0.settings.aim
uv2.checkboxes.auto.v = slot0.settings.auto
uv2.checkboxes.aupd.v = slot0.settings.aupd
uv2.sliders.time.v = slot0.settings.time
uv2.sliders.radius.v = slot0.settings.radius
uv2.checkboxes.trigger.v = slot0.settings.trigger
uv2.checkboxes.reverse.v = slot0.settings.reverse
uv2.checkboxes.skipOut.v = slot0.settings.skipOut
uv2.checkboxes.skipFar.v = slot0.settings.skipFar
uv2.checkboxes.skipNPCs.v = slot0.settings.skipNPCs
uv2.checkboxes.skipDead.v = slot0.settings.skipDead
uv2.checkboxes.skipPaused.v = slot0.settings.skipPaused
uv2.checkboxes.checkBuildings.v = slot0.settings.checkBuildings
uv2.checkboxes.checkVehicles.v = slot0.settings.checkVehicles
uv2.checkboxes.checkActors.v = slot0.settings.checkActors
uv2.checkboxes.checkObjects.v = slot0.settings.checkObjects
uv2.checkboxes.checkParticles.v = slot0.settings.checkParticles
uv2.checkboxes.trigger_checkSolid.v = slot0.settings.trigger_checkSolid
uv2.checkboxes.trigger_car.v = slot0.settings.trigger_car
uv2.checkboxes.trigger_ped.v = slot0.settings.trigger_ped
uv2.checkboxes.trigger_object.v = slot0.settings.trigger_object
uv2.checkboxes.trigger_particle.v = slot0.settings.trigger_particle
uv2.checkboxes.trigger_seeThrough.v = slot0.settings.trigger_seeThrough
uv2.checkboxes.trigger_ignoreSomeObjects.v = slot0.settings.trigger_ignoreSomeObjects
uv2.checkboxes.trigger_shotThrough.v = slot0.settings.trigger_shotThrough
uv2.checkboxes.checkProtected.v = slot0.settings.checkProtected
uv2.checkboxes.checkDrive.v = slot0.settings.checkDrive
uv2.checkboxes.checkClist.v = slot0.settings.checkClist
uv2.checkboxes.checkSkin.v = slot0.settings.checkSkin
uv2.checkboxes.checkStun.v = slot0.settings.checkStun
uv2.checkboxes.findbone.v = slot0.settings.findbone
uv2.checkboxes.findcolor.v = slot0.settings.findcolor
uv2.checkboxes.findmodel.v = slot0.settings.findmodel
uv2.checkboxes.findweapon.v = slot0.settings.findweapon
uv2.checkboxes.findbone_inversion.v = slot0.settings.findbone_inversion
uv2.checkboxes.findcolor_inversion.v = slot0.settings.findcolor_inversion
uv2.checkboxes.findmodel_inversion.v = slot0.settings.findmodel_inversion
uv2.checkboxes.findweapon_inversion.v = slot0.settings.findweapon_inversion
uv2.checkboxes.fieldofvisible.v = slot0.settings.fieldofvisible
uv2.sliders.trigger_radius.v = slot0.settings.trigger_radius
uv2.checkboxes.fieldofvisible_visible.v = slot0.settings.fieldofvisible_visible
uv2.sliders.fieldofvisible_border_red.v = slot0.settings.fieldofvisible_border_red
uv2.sliders.fieldofvisible_border_green.v = slot0.settings.fieldofvisible_border_green
uv2.sliders.fieldofvisible_border_blue.v = slot0.settings.fieldofvisible_border_blue
uv2.sliders.fieldofvisible_border_alpha.v = slot0.settings.fieldofvisible_border_alpha
uv2.sliders.fieldofvisible_bcolor_red.v = slot0.settings.fieldofvisible_bcolor_red
uv2.sliders.fieldofvisible_bcolor_green.v = slot0.settings.fieldofvisible_bcolor_green
uv2.sliders.fieldofvisible_bcolor_blue.v = slot0.settings.fieldofvisible_bcolor_blue
uv2.sliders.fieldofvisible_bcolor_alpha.v = slot0.settings.fieldofvisible_bcolor_alpha
uv2.sliders.fieldofvisible_radians.v = slot0.settings.fieldofvisible_radians
else
uv1.settings.aupd = uv2.checkboxes.aupd.v
uv1.settings.aim = uv2.checkboxes.aim.v
uv1.settings.auto = uv2.checkboxes.auto.v
uv1.settings.time = uv2.sliders.time.v
uv1.settings.radius = uv2.sliders.radius.v
uv1.settings.trigger = uv2.checkboxes.trigger.v
uv1.settings.reverse = uv2.checkboxes.reverse.v
uv1.settings.skipOut = uv2.checkboxes.skipOut.v
uv1.settings.skipFar = uv2.checkboxes.skipFar.v
uv1.settings.skipNPCs = uv2.checkboxes.skipNPCs.v
uv1.settings.skipDead = uv2.checkboxes.skipDead.v
uv1.settings.skipPaused = uv2.checkboxes.skipPaused.v
uv1.settings.checkBuildings = uv2.checkboxes.checkBuildings.v
uv1.settings.checkVehicles = uv2.checkboxes.checkVehicles.v
uv1.settings.checkActors = uv2.checkboxes.checkActors.v
uv1.settings.checkObjects = uv2.checkboxes.checkObjects.v
uv1.settings.checkParticles = uv2.checkboxes.checkParticles.v
uv1.settings.trigger_checkSolid = uv2.checkboxes.trigger_checkSolid.v
uv1.settings.trigger_car = uv2.checkboxes.trigger_car.v
uv1.settings.trigger_ped = uv2.checkboxes.trigger_ped.v
uv1.settings.trigger_object = uv2.checkboxes.trigger_object.v
uv1.settings.trigger_particle = uv2.checkboxes.trigger_particle.v
uv1.settings.trigger_seeThrough = uv2.checkboxes.trigger_seeThrough.v
uv1.settings.trigger_ignoreSomeObjects = uv2.checkboxes.trigger_ignoreSomeObjects.v
uv1.settings.trigger_shotThrough = uv2.checkboxes.trigger_shotThrough.v
uv1.settings.checkProtected = uv2.checkboxes.checkProtected.v
uv1.settings.checkDrive = uv2.checkboxes.checkDrive.v
uv1.settings.checkClist = uv2.checkboxes.checkClist.v
uv1.settings.checkSkin = uv2.checkboxes.checkSkin.v
uv1.settings.checkStun = uv2.checkboxes.checkStun.v
uv1.settings.findbone = uv2.checkboxes.findbone.v
uv1.settings.findcolor = uv2.checkboxes.findcolor.v
uv1.settings.findmodel = uv2.checkboxes.findmodel.v
uv1.settings.findweapon = uv2.checkboxes.findweapon.v
uv1.settings.findbone_inversion = uv2.checkboxes.findbone_inversion.v
uv1.settings.findcolor_inversion = uv2.checkboxes.findcolor_inversion.v
uv1.settings.findmodel_inversion = uv2.checkboxes.findmodel_inversion.v
uv1.settings.findweapon_inversion = uv2.checkboxes.findweapon_inversion.v
uv1.settings.fieldofvisible = uv2.checkboxes.fieldofvisible.v
uv1.settings.trigger_radius = uv2.sliders.trigger_radius.v
uv1.settings.fieldofvisible_visible = uv2.checkboxes.fieldofvisible_visible.v
uv1.settings.fieldofvisible_border_red = uv2.sliders.fieldofvisible_border_red.v
uv1.settings.fieldofvisible_border_green = uv2.sliders.fieldofvisible_border_green.v
uv1.settings.fieldofvisible_border_blue = uv2.sliders.fieldofvisible_border_blue.v
uv1.settings.fieldofvisible_border_alpha = uv2.sliders.fieldofvisible_border_alpha.v
uv1.settings.fieldofvisible_bcolor_red = uv2.sliders.fieldofvisible_bcolor_red.v
uv1.settings.fieldofvisible_bcolor_green = uv2.sliders.fieldofvisible_bcolor_green.v
uv1.settings.fieldofvisible_bcolor_blue = uv2.sliders.fieldofvisible_bcolor_blue.v
uv1.settings.fieldofvisible_bcolor_alpha = uv2.sliders.fieldofvisible_bcolor_alpha.v
uv1.settings.fieldofvisible_radians = uv2.sliders.fieldofvisible_radians.v
save_ini()
end
end
function download_ini()
uv0 = downloadUrlToFile(uv1, getWorkingDirectory() .. "/config/" .. script.this.filename .. ".upd.ini", download_handler)
repeat
wait(0)
until uv0 == nil
CheckUpdates()
end
function download_lua()
uv0 = downloadUrlToFile(script.this.url, getWorkingDirectory() .. "/" .. script.this.filename, download_handler)
repeat
wait(0)
until uv0 == nil
thisScript():reload()
end
function download_handler(slot0, slot1, slot2, slot3)
if slot1 == uv0.STATUS_DOWNLOADINGDATA then
-- Nothing
elseif slot1 == uv0.STATUS_ENDDOWNLOADDATA then
uv1 = nil
end
end
function file_create(slot0)
io.open(slot0, "w"):close()
end
function file_exists(slot0)
if io.open(slot0, "r") then
slot1:close()
end
return slot1 ~= nil
end
function lines_from(slot0)
if not file_exists(slot0) then
file_create(slot0)
return {}
end
lines = {}
for slot4 in io.lines(slot0) do
lines[#lines + 1] = slot4
end
return lines
end
function lines_find(slot0, slot1)
for slot5, slot6 in pairs(slot0) do
if tonumber(slot6) == slot1 then
return true
end
end
return false
end
function line_add(slot0, slot1)
slot2 = lines_from(slot0)
slot2[#slot2 + 1] = slot1
rwa_lines(slot0, slot2)
end
function line_remove(slot0, slot1)
put_lines(slot0, lines_from(slot0), slot1)
end
function put_lines(slot0, slot1, slot2)
slot3 = io.open(slot0, "w")
for slot7, slot8 in pairs(slot1) do
if tonumber(slot8) and tonumber(slot8) ~= slot2 then
slot3:write(slot8 .. "\n")
end
end
slot3:close()
end
function rwa_lines(slot0, slot1)
slot2 = io.open(slot0, "w")
for slot6, slot7 in pairs(slot1) do
if tonumber(slot7) and (slot6 == #slot1 or slot6 ~= #slot1 and slot1[slot6] ~= slot1[#slot1]) then
slot2:write(slot7 .. "\n")
end
end
slot2:close()
end
function getBodyPartCoordinates(slot0, slot1)
slot3 = uv0.new("float[3]")
uv1(uv0.cast("void*", slot2), slot3, slot0, true)
return slot3[0], slot3[1], slot3[2]
end
function PaintTrigger()
end
function PaintAim()
if uv0.Checkbox(u8("Smooth aim"), uv1.checkboxes.aim) then
uv2.settings.aim = uv1.checkboxes.aim.v
save_ini()
end
if uv1.checkboxes.aim.v then
if uv0.SliderInt("Smooth", uv1.sliders.time, 1, 25) then
uv2.settings.time = uv1.sliders.time.v
save_ini()
end
if uv0.Checkbox(u8("Bones"), uv1.checkboxes.findbone) then
uv2.settings.findbone = uv1.checkboxes.findbone.v
save_ini()
end
if uv1.checkboxes.findbone.v then
if uv0.Checkbox(u8("Invert"), uv1.checkboxes.findbone_inversion) then
uv2.settings.findbone_inversion = uv1.checkboxes.findbone_inversion.v
save_ini()
end
uv0.InputText(u8("ID"), uv1.buffers.bone_id)
if tonumber(uv1.buffers.bone_id.v) then
if lines_find(uv3, tonumber(uv1.buffers.bone_id.v)) then
if uv0.Button("Delete") then
line_remove(uv4, tonumber(uv1.buffers.bone_id.v))
end
elseif uv0.Button("Add") then
line_add(uv4, tonumber(uv1.buffers.bone_id.v))
end
end
end
if uv0.Checkbox(u8("Models"), uv1.checkboxes.findmodel) then
uv2.settings.findmodel = uv1.checkboxes.findmodel.v
save_ini()
end
if uv1.checkboxes.findmodel.v then
if uv0.Checkbox(u8("Invert"), uv1.checkboxes.findmodel_inversion) then
uv2.settings.findmodel_inversion = uv1.checkboxes.findmodel_inversion.v
save_ini()
end
uv0.InputText(u8("ID"), uv1.buffers.model_id)
if tonumber(uv1.buffers.model_id.v) then
if lines_find(uv5, tonumber(uv1.buffers.model_id.v)) then
if uv0.Button("Delete") then
line_remove(uv6, tonumber(uv1.buffers.model_id.v))
end
elseif uv0.Button("Add") then
line_add(uv6, tonumber(uv1.buffers.model_id.v))
end
end
end
if uv0.Checkbox(u8("Settings"), uv1.checkboxes.fieldofvisible) then
uv2.settings.fieldofvisible = uv1.checkboxes.fieldofvisible.v
save_ini()
end
if uv1.checkboxes.fieldofvisible.v then
if uv0.Checkbox(u8("Show Radius"), uv1.checkboxes.fieldofvisible_visible) then
uv2.settings.fieldofvisible_visible = uv1.checkboxes.fieldofvisible_visible.v
save_ini()
end
if uv1.checkboxes.fieldofvisible_visible.v then
-- Nothing
end
if uv0.SliderFloat("Radius", uv1.sliders.fieldofvisible_radians, 0, 1, math.pi) then
uv2.settings.fieldofvisible_radians = uv1.sliders.fieldofvisible_radians.v
save_ini()
end
if uv0.Checkbox(u8("Nearest"), uv1.checkboxes.skipFar) then
uv2.settings.skipFar = uv1.checkboxes.skipFar.v
save_ini()
end
if uv0.Checkbox(u8("CheckStun"), uv1.checkboxes.checkStun) then
uv2.settings.checkStun = uv1.checkboxes.checkStun.v
save_ini()
end
if uv0.Checkbox(u8("CheckPaused"), uv1.checkboxes.skipPaused) then
uv2.settings.skipPaused = uv1.checkboxes.skipPaused.v
save_ini()
end
if uv0.Checkbox(u8("CheckBuildings"), uv1.checkboxes.checkBuildings) then
uv2.settings.checkBuildings = uv1.checkboxes.checkBuildings.v
save_ini()
end
if uv0.Checkbox(u8("CheckObjects"), uv1.checkboxes.checkObjects) then
uv2.settings.checkObjects = uv1.checkboxes.checkObjects.v
save_ini()
end
end
end
end