--exechack.cc/lua local enable = true local percent = 1 local ply = LocalPlayer() local findDist = 120 local fromSell = false local autosellOn = 20 local Rudes = { [1] = { ['coast'] = 50, ['name'] = 'Камень', ['rarity'] = 1 }, [2] = { ['coast'] = 100, ['name'] = 'Уголь', ['rarity'] = 1 }, [3] = { ['coast'] = 150, ['name'] = 'Бронза', ['rarity'] = 2, }, [4] = { ['coast'] = 200, ['name'] = 'Железо', ['rarity'] = 5, }, [5] = { ['coast'] = 350, ['name'] = 'Серебро', ['rarity'] = 10 }, [6] = { ['coast'] = 500, ['name'] = 'Золото', ['rarity'] = 15 }, [6] = { ['coast'] = 1000, ['name'] = 'Алмаз', ['rarity'] = 20 } } print('enable_automine int - включить/выключить, 2 параметр - продажа когда достигает этой цифры') local function GetPickaxe() for k,v in pairs( LocalPlayer():GetWeapons() ) do if v:GetClass() == 'weapon_pickaxe' then return v end end return false end local function ConC(cmd) RunConsoleCommand('+'..cmd) timer.Simple(.1, function() RunConsoleCommand('-'..cmd) end) end hook.Add('HUDPaint', 'AutoMine', function() if !enable then return end local ply = LocalPlayer() for k,v in ipairs(Rudes) do local rCost = ply:GetNWInt('rudy_tottaly') local profit = rCost * (percent/10) draw.SimpleText('Зарабаток: '..'( Чистая '..rCost..'$ ) С процентами: ~' .. math.Round(rCost + (profit))..'$', 'ui.22', ScrW() / 2, 15, Color(255,255,255), TEXT_ALIGN_CENTER) draw.SimpleText(v.name..'( Rarity: '..v.rarity..' )', 'Default', 5, 20*k, Color(255,255,255), TEXT_ALIGN_LEFT) end end) local nAttack = 0 local function Attack() local ply = LocalPlayer() if ply:GetActiveWeapon():GetClass() != 'weapon_pickaxe' then local pickaxe = GetPickaxe() if !pickaxe then return end input.SelectWeapon(pickaxe) return end if nAttack > CurTime() then return end nAttack = CurTime() + 1 ConC('attack') end local function MoveToSell() for k,v in ipairs(ents.FindInSphere(ply:GetPos(), 2000)) do if v:GetClass() == 'ent_rock_buyer' then local vec1 = v:GetPos() local vec2 = ply:GetShootPos() local dist = vec1:Distance(ply:GetPos()) if dist < 75 then //RunConsoleCommand('-forward') fromSell = true net.Start('sell_rude') net.SendToServer() findDist = 2000 return end RunConsoleCommand('+forward') exechack_api.SetCheatAngle((vec1-vec2):Angle()) end end end local nextSell = 0 hook.Add('Think', 'AutoMiner', function() local prev = 800 if !enable then return end local ply = LocalPlayer() local plyPos = ply:GetPos() for k,v in ipairs(ents.FindInSphere(ply:GetPos(), findDist)) do if v:GetClass() == 'ent_rock' then local vec1 = v:GetPos() local vec2 = ply:GetShootPos() local dist = vec1:Distance(plyPos) if dist <= 120 && fromSell then RunConsoleCommand('-forward') findDist = 120 fromSell = false end if dist < prev then prev = vec1:Distance(plyPos) exechack_api.SetCheatAngle((vec1-vec2):Angle()) if v:GetPos():DistToSqr(ply:GetPos()) < 75^2 then Attack() end end end end if ply:GetNWInt('inventory_rudy') >= autosellOn then //MoveToSell() // Автоматом бежит к продавцу, на случай фикса с дистанцией продажи и возвращаеться обратно. Нужно желательно иметь прямой контакт с продавцом. if nextSell > CurTime() then return end nextSell = CurTime() + 5 net.Start('sell_rude') net.SendToServer() end end) concommand.Add('enable_automine', function(p, c, a) local num = tonumber(a[1]) or 20 autosellOn = num enable = !enable print('Майнер ' ..(enable && 'включен, продажа при: '..num or 'выключен') ) end) net('open_rude_menu', function() local values = net.ReadTable() or {} fr = ui.Create('ui_frame', function(self) self:SetTitle('Шахтер') self:SetSize(450, 500) self:Center() self:MakePopup() end) ui.Create('DButton', function(self) self:SetText('Продать') self:Dock(BOTTOM) self.DoClick = function(self) net.Start('sell_rude') net.SendToServer() fr:Close() end end, fr) ui.Create('DPanel', function(self) self:Dock(FILL) self.Paint = function(s,w,h) local old = (values[#values - 1] or 0) local color = ( values[#values] > old and Color(0,255,0) or Color(255,0,0) ) local sym = (values[#values] > old and '▲' or '▼') draw.SimpleText( 'Курс цен','ui.32',w/2,0,color_white,1,0 ) draw.SimpleText('Текущий курс: ~'..math.floor((values[#values] or 0)/2)..'% | '..sym,'ui.23',w/2,32,color,1,0) percent = math.floor((values[#values] or 0)/2) for b = 1, #values do values[b] = math.Clamp( values[b],1,190 ) end for i = 1, #values do surface.SetDrawColor( color.r,color.g,color.b ) if (values[i-1] ~= nil) then surface.DrawLine( (w/#values * (i-1)) - (w/#values)/2,h-values[i-1],(w/#values * i) - (w/#values)/2,h - values[i] ) else end end end end, fr) end)