View difference between Paste ID: pmeVH4Hd and jzXf1eSv
SHOW: | | - or go back to the newest paste.
1
--[[
2
 
3
        Auto Carry Plugin - Ashe Edition  --- DeniCevap
4
 
5
        Activates Q when attacking enemy hero and disables when attacking minions.
6
        Activates Muramana when attacking enemy hero.
7
        Press R to let the plugin auto aim the ultimate for you -- only works when the range is over 500 and under 2000. (Inspired from AesEzreal)
8
 
9
--]]
10
 
11
if myHero.charName ~= "Ashe" then return end
12
13
14
-- Skillshot table/constants "taken" from Ezreal plugin.
15
16
-- Constants
17
local RRange = 2000
18
local RSpeed = 1.6
19
local RDelay = 1000
20
local RWidth = 130
21
22
-- Prediction
23
local SkillR = {spellKey = _R, range = RRange, speed = RSpeed, delay = RDelay, width = RWidth}
24
25
 
26
local frostOn = false
27
AutoCarry.PluginMenu:addParam("AutoQ", "Activate Q Against Enemy", SCRIPT_PARAM_ONOFF, true)
28
AutoCarry.PluginMenu:addParam("MMana", "Activate Muramana Against Enemy", SCRIPT_PARAM_ONOFF, true) 
29
AutoCarry.PluginMenu:addParam("ultimate", "Activate auto aim with R", SCRIPT_PARAM_ONOFF, true)
30
AutoCarry.PluginMenu:addParam("useUlt", "Snipe the target with your ultimate", SCRIPT_PARAM_ONKEYDOWN, false, 82) -- R
31
AutoCarry.PluginMenu:addParam("draw", "Draw text when target is killable by ultimate", SCRIPT_PARAM_ONOFF, true)
32
AutoCarry.PluginMenu:addParam("ManaCheck", "Do not activate Q if low on mana", SCRIPT_PARAM_ONOFF, true)
33
34
35
function PluginOnTick()
36
	Target = AutoCarry.GetTarget()
37
38
	if AutoCarry.PluginMenu.ultimate and AutoCarry.PluginMenu.useUlt and Target ~= nil and Target.type == "obj_AI_Hero" and GetDistance(Target) < RRange and GetDistance(Target) > 500 then
39
		if myHero:CanUseSpell(_R) == READY and GetDistance(Target) <= RRange then
40
			if not AutoCarry.GetCollision(SkillR, myHero, Target) then
41
				AutoCarry.CastSkillshot(SkillR, Target)
42
			end
43
		end
44
	end
45
end
46
47
function CustomAttackEnemy(enemy)
48
        if enemy.dead or not enemy.valid or not AutoCarry.CanAttack then return end
49
50
        if AutoCarry.PluginMenu.AutoQ then
51
                if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and not frostOn and ((AutoCarry.PluginMenu.ManaCheck and myHero.mana > 100) or not AutoCarry.PluginMenu.ManaCheck) then
52
                        CastSpell(_Q)
53
                elseif ValidTarget(enemy) and enemy.type ~= "obj_AI_Hero" and frostOn then
54
                        CastSpell(_Q)
55
                end
56
        end
57
58
        if AutoCarry.PluginMenu.MMana then
59
        	if ValidTarget(enemy) and enemy.type == "obj_AI_Hero" and ((AutoCarry.PluginMenu.ManaCheck and myHero.mana > 100) or not AutoCarry.PluginMenu.ManaCheck) and not MuramanaIsActive() then
60
        		MuramanaOn()
61
        	elseif ValidTarget(enemy) and enemy.type ~= "obj_AI_Hero" and MuramanaIsActive() then
62
        		MuramanaOff()
63
        	end
64
        end
65
66
        myHero:Attack(enemy)
67
        AutoCarry.shotFired = true
68
end
69
70
 
71
function PluginOnCreateObj(obj)
72
        if GetDistance(obj) < 100 and obj.name:lower():find("icesparkle") then
73
                frostOn = true
74
        end
75
end
76
 
77
function PluginOnDeleteObj(obj)
78
        if GetDistance(obj) < 100 and obj.name:lower():find("icesparkle") then
79
                frostOn = false
80
        end
81
end
82
83
function PluginOnDraw()
84
	if AutoCarry.PluginMenu.draw then
85
		if Target ~= nil then
86
			RDmg = getDmg("R", Target, myHero)
87
		end
88
89
		if Target ~= nil and Target.type == "obj_AI_Hero" and myHero:CanUseSpell(_R) and GetDistance(Target) < RRange and GetDistance(Target) > 500 and Target.health < RDmg then
90
			DrawCircle(Target.x, Target.y, Target.z, 150, 0xFF0000)
91
			DrawText("Use R to ult!", 50,520,100,0xFFFF0000)
92
			PrintFloatText(Target,0,"Ult!")
93
		end
94
	end
95
end