--pavetr.top/ds --local ents = { --} local AutoFarmEnabled = CreateClientConVar("AutoFarmEnabled", "1", true, false, 'Автоматический садит семена по близости') local AutoLand = CreateClientConVar("AutoLand", "1", true, false, 'Автоматический садит семена по близости') local AutoLoot = CreateClientConVar("AutoLoot", "1", true, false, 'Автоматический собирает урожай в карман') local AutoRun = CreateClientConVar("AutoRun", "1", true, false, 'Бежит к ближайшему ростку или созревшему плоду и собирает') local AutoFarm_Distance = CreateClientConVar("AutoFarm_Distance", "200", true, false, 'Дистанция в которой искать') local ply local function SendCommand(command) LocalPlayer():ConCommand('+'..command) timer.Simple(.1, function() LocalPlayer():ConCommand('-'..command) end) end local function CloseToEnt(ent) local close = false if !ply or !ply:IsValid() or !ent:IsValid() then return close end if ply:GetPos():DistToSqr(ent:GetPos()) < 50 ^ 2 then close = true end return close end local function RunTo(ent) if AutoRun:GetBool() then if CloseToEnt(ent) then ply:ConCommand('-forward') return end ply:ConCommand('+forward') ply.ForwardBind = true end end local i = 0 local function AutoLandFunc(ent) if !ent or !ent:IsValid() then return end local canSeed = ent:GetDTBool(4) && ent:GetDTInt(1) != 1 && ent:GetDTInt(1) != 2 && ent:GetDTInt(1) != 3// Посадите local canGetSeeds = ent:GetDTInt(1) == 3 // Соберите урожай local ang = ( (ent:GetPos() + Vector(0,0,12)) - ply:GetShootPos()):Angle() // Функция сажания hook.Add("CreateMove", "LookAtSeed", function(cmd) cmd:SetViewAngles(ang + Angle(0,0,0)) end) if canSeed or canGetSeeds then i = i + 1 print('Run To', i, ent) RunTo(ent) else print('Remove Bind') end if CloseToEnt(ent) then SendCommand('use') end end local function AutoLootFunc(ent) if !ent or !ent:IsValid() then return end local ang = (ent:GetPos() - ply:GetShootPos()):Angle() hook.Add("CreateMove", "LookAtLoot", function(cmd) cmd:SetViewAngles(ang) end) SendCommand('left') if CloseToEnt(ent) then SendCommand('duck') SendCommand('use') ent.TryGet = ent.TryGet or 1 ent.TryGet = ent.TryGet + 2 print(ent, ent.TryGet) if ply.ForwardBind then ply:ConCommand('-forward') ply.ForwardBind = false end else RunTo(ent) end end local function FindNearestEnt(ents, check) local prev = 600 local ent = nil for k,v in ipairs(ents) do if !v:IsValid() then continue end local dist = v:GetPos():Distance(ply:GetPos()) if dist > AutoFarm_Distance:GetInt() then continue end local c = check && check(v) if c then ent = v end end return ent end timer.Create('AutoThink', .05, 0, function() --hook.Add('Think', 'Auto_XD', function() ply = LocalPlayer() if !AutoFarmEnabled:GetBool() then hook.Remove("CreateMove", "LookAtSeed") hook.Remove("CreateMove", "LookAtLoot") --ply:ConCommand('-forward') return end local ent = FindNearestEnt(ents.FindByClass('base_seed'), function(e) local canSeed = e:GetDTBool(4) && e:GetDTInt(1) != 1 && e:GetDTInt(1) != 2 && e:GetDTInt(1) != 3// Посадите --local canGetSeeds = e:GetDTInt(1) == 3 // Соберите урожай local treeIsValid = e:GetDTInt(3) != 0 if !canSeed then if ply.ForwardBind then ply:ConCommand('-forward') ply.ForwardBind = false end end return (canSeed) and treeIsValid end) if ent then AutoLandFunc(ent) return else hook.Remove("CreateMove", "LookAtSeed") end if AutoLoot:GetBool() then local ent = FindNearestEnt(ents.FindByClass('base_food'), function(e) if e.TryGet && e.TryGet > 100 then return false end return true end) if ent then AutoLootFunc(ent) else hook.Remove("CreateMove", "LookAtLoot") end else hook.Remove("CreateMove", "LookAtLoot") end end) --print(exechack_api) print(LocalPlayer():GetEyeTrace().Entity) hook.Add("CreateMove", "Test", function(cmd) cmd:SetButtons(IN_FORWARD) end) hook.Remove("CreateMove", "Test") hook.Remove("CreateMove", "LookAtLoot") hook.Remove('Think', 'Auto_XD') print(LocalPlayer().ForwardBind)