Giter Club home page Giter Club logo

-old-ensage-scripts's People

Contributors

4ll3nxxxx avatar dldota avatar moones avatar rulfy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

-old-ensage-scripts's Issues

a lot of increase perfomance.

require("libs.Utils")
require("libs.ScriptConfig")
require("libs.TargetFind")
require("libs.SkillShot")
require("libs.VectorOp")

config = ScriptConfig.new()
config:SetParameter("Hotkey", "F", config.TYPE_HOTKEY)
config:SetParameter("Arrowkey", "D", config.TYPE_HOTKEY)
config:Load()

local key = config.Hotkey
local arrowkey = config.Arrowkey

local myFont = drawMgr:CreateFont("Mirana","Tahoma",14,550)
local statusText = drawMgr:CreateText(-40,-20,-1,"Shoot Arrow hit Arrow!",myFont);
local active = true
local shoot = nil

function ArrowKey(msg,code)

if msg ~= KEY_UP or client.chat then return end

if code == arrowkey and active then     
    if not shoot then
        shoot = true
        return true
    else
        shoot = nil
        return true
    end
elseif code == key and not active then
    if not active then
        active = true
        statusText.text = "Shoot Arrow hit Arrow!"
        return true
    else
        active = nil
        statusText.text = "   OFF!"
        return true
    end
end

end

function Main(tick)

if not IsIngame() or client.console or not SleepCheck() then return end

Sleep(200)

local me = entityList:GetMyHero()

if not me then return end

if me.classId ~= CDOTA_Unit_Hero_Mirana then
    statusText.visible = false
    script:Disable()
    return
end

local offset = me.healthbarOffset

if not statusText.entity then
    statusText.entity = me
    statusText.entityPosition = Vector(0,0,offset)
end

local arrow = me:GetAbility(2)

if active then  

    local victimm = targetFind:GetLowestEHP(3057.5, magic)

    if victimm and GetDistance2D(victimm,me) < 3057.5 then
        statusText.text = "Shoot: " .. client:Localize(victimm.name)
        if shoot and arrow.level > 0 and me.alive then shoot = nil              
            if not victim:DoesHaveModifier("modifier_nyx_assassin_spiked_carapace") then
                local speed = 857 
                local distance = GetDistance2D(victim, me)
                local castPoint = arrow:GetCastPoint(arrow.level)
                local xyz = SkillShot.SkillShotXYZ(me,victim,speed,castPoint)
                if xyz and distance < 3000 + 57.5 then  
                me:SafeCastAbility(arrow, xyz)
                end
            end
        end 
    else
        statusText.text = "Shoot Arrow hit Arrow!"
    end

    for i,v in ipairs(entityList:GetEntities({type=LuaEntity.TYPE_HERO,alive=true,illusion=false})) do

        if v.team ~= me.team and GetDistance2D(v,me) < 3057.5 then

            local disruption = v:DoesHaveModifier("modifier_shadow_demon_disruption")
            local astral = v:DoesHaveModifier("modifier_obsidian_destroyer_astral_imprisonment_prison")
            local eul = v:DoesHaveModifier("modifier_eul_cyclone")

            if disruption then              
                if GetDistance2D(v,me) <= 2200 then
                    if (disruption.remainingTime * 857) == GetDistance2D(v,me)+115 or ((disruption.remainingTime * 857) < GetDistance2D(v,me)+115 and (disruption.remainingTime * 857)+25 > GetDistance2D(v,me)) then
                        me:SafeCastAbility(arrow, v.position)
                    end
                end             
            elseif astral then
                if GetDistance2D(v,me) <= (astral.remainingTime*857+57.5) then
                    if (astral.remainingTime * 857) == GetDistance2D(v,me)+140 or ((astral.remainingTime * 857) < GetDistance2D(v,me)+140 and (astral.remainingTime * 857)+25 > GetDistance2D(v,me)) then
                        me:SafeCastAbility(arrow, v.position)
                    end
                end
            elseif eul then
                if GetDistance2D(v,me) <= ( eul.remainingTime*857+57.5) then
                    if (eul.remainingTime * 857) == GetDistance2D(v,me)+140 or (( eul.remainingTime * 857) < GetDistance2D(v,me)+140 and ( eul.remainingTime * 857)+25 > GetDistance2D(v,me)) then
                        me:SafeCastAbility(arrow, v.position)
                    end
                end
            end

        end

    end

end

end

script:RegisterEvent(EVENT_TICK,Main)
script:RegisterEvent(EVENT_KEY,ArrowKey)

hit/deny

I think it will be more correct

function Tick(tick)

if not client.connected or client.loading or client.console or tick < sleeptick then return end

sleeptick = tick + 200

local me = entityList:GetMyHero()

if not me then return end

local heroes = entityList:GetEntities({type=LuaEntity.TYPE_HERO, illusion=false})
local player = entityList:GetEntities({classId=CDOTA_PlayerResource})[1]

for i,v in ipairs(heroes) do        
    local lasthits = player:GetLasthits(v.playerId)
    local denies = player:GetDenies(v.playerId)
    local xx = GetXX(v)
    if not info[v.playerId] then info[v.playerId] = {}
        info[v.playerId].lhd = drawMgr:CreateText(xx-20+x_*v.playerId,y_,-1,"",F13)
    end
    info[v.playerId].lhd.text = " "..lasthits.." / "..denies        
end

end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.