moones / -old-ensage-scripts Goto Github PK
View Code? Open in Web Editor NEWLua scripts for Ensage (Outdated)
Lua scripts for Ensage (Outdated)
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)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.