-
Notifications
You must be signed in to change notification settings - Fork 4
/
Bristleback.lua
174 lines (105 loc) · 5.15 KB
/
Bristleback.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
-- Author: Dj-jom2x
local brstle = {}
brstle.optionEnable = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Enabled", "")
brstle.optionBasic = Menu.AddKeyOption({"Dj-jom2x Script's", "BristleBack"}, "Toggle Auto Quil/Spray Only", Enum.ButtonCode.KEY_G)
brstle.optionQuil = Menu.AddKeyOption({"Dj-jom2x Script's", "BristleBack"}, "Toggle Auto Spray Only", Enum.ButtonCode.KEY_H)
brstle.optionKey = Menu.AddKeyOption({"Dj-jom2x Script's", "BristleBack"}, "Tooggle All Combo", Enum.ButtonCode.KEY_F)
brstle.autospray = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Auto Spray", "auto spray without holding any button when enemy get close to you")
brstle.autonasal = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Auto Nasal Goo", "auto goo without holding any button when enemy get close to you")
brstle.useshiva = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Shiva", "use shiva if enemy is closer")
brstle.usecrimson = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Crimson", "")
brstle.usepipe = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Pipe", "")
brstle.usehood = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Hood", "")
brstle.usemail = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use BladeMail", "")
brstle.usebkb = Menu.AddOption({"Dj-jom2x Script's", "BristleBack"}, "Use Black King Bar", "")
oneToggle = false;
SprayToggle = false;
function brstle.OnUpdate()
if not Menu.IsEnabled(brstle.optionEnable) then return true end
brstle.StartCombo()
end
function brstle.StartCombo()
local getMyChamp = Heroes.GetLocal()
if NPC.GetUnitName(getMyChamp) ~= "npc_dota_hero_bristleback" then return end
local hero = Input.GetNearestHeroToCursor(Entity.GetTeamNum(getMyChamp), Enum.TeamType.TEAM_ENEMY)
if not hero then return end
-- own abilities
local nasalgoo = NPC.GetAbilityByIndex(getMyChamp,0)
local spray = NPC.GetAbilityByIndex(getMyChamp,1)
local champMana = NPC.GetMana(getMyChamp)
-- 3rd party abilities
local shiva = NPC.GetItem(getMyChamp, "item_shivas_guard", true)
local crson = NPC.GetItem(getMyChamp, "item_crimson_guard", true)
local pipe = NPC.GetItem(getMyChamp, "item_pipe", true)
local hood = NPC.GetItem(getMyChamp, "item_hood_of_defiance", true)
local bm = NPC.GetItem(getMyChamp, "item_blade_mail", true)
local agha = NPC.GetItem(getMyChamp, "item_ultimate_scepter", true)
local bkb = NPC.GetItem(getMyChamp, "item_black_king_bar", true)
if Menu.IsEnabled(brstle.autospray) then
brstle.DoSomething(spray,champMana,getMyChamp,hero,false)
end
if Menu.IsEnabled(brstle.autonasal) then
if agha then
brstle.DoSomething(nasalgoo,champMana,getMyChamp,hero,false)
else
brstle.DoSomething(nasalgoo,champMana,getMyChamp,hero,true)
end
end
if Menu.IsKeyDownOnce(brstle.optionBasic) then
oneToggle = not oneToggle;
end
if Menu.IsKeyDownOnce(brstle.optionQuil) then
SprayToggle = not SprayToggle;
end
if Menu.IsKeyDown(brstle.optionKey) then
brstle.CastSomething(shiva,champMana,brstle.useshiva)
brstle.CastSomething(crson,champMana,brstle.usecrimson)
brstle.CastSomething(hood,champMana,brstle.usehood)
brstle.CastSomething(bm,champMana,brstle.usemail)
brstle.CastSomething(bkb,champMana,brstle.usebkb)
brstle.CastSomething(pipe,champMana,brstle.usepipe)
if not oneToggle then
brstle.DoBasic(agha,nasalgoo,spray,champMana,getMyChamp,hero,agha,false)
end
end
-- both nasal and spray spam
if oneToggle then
-- Log.Write("Toggle: "..tostring(oneToggle))
brstle.DoBasic(nasalgoo,spray,champMana,getMyChamp,hero,agha,false)
end
-- spray only if you are runnning and you dont want to turn back
if SprayToggle then
brstle.DoBasic(nasalgoo,spray,champMana,getMyChamp,hero,agha,true)
end
end
function brstle.DoBasic(nasalgoo,spray,champMana,getMyChamp,hero,agha,oneonly)
if not Menu.IsEnabled(brstle.autonasal) then
if not oneonly then
if agha then
brstle.DoSomething(nasalgoo,champMana,getMyChamp,hero,false)
else
brstle.DoSomething(nasalgoo,champMana,getMyChamp,hero,true)
end
end
end
if not Menu.IsEnabled(brstle.autospray) then
brstle.DoSomething(spray,champMana,getMyChamp,hero,false)
end
end
function brstle.CastSomething(item,champMana,getMenuName)
if item and Ability.IsCastable(item,champMana) and Menu.IsEnabled(getMenuName) then
Ability.CastNoTarget(item)
end
end
function brstle.DoSomething(skill,champMana,getMyChamp,hero,isTarget)
if Ability.IsCastable(skill, champMana) and
hero ~=nil and
NPC.IsPositionInRange(getMyChamp,NPC.GetAbsOrigin(hero), Ability.GetCastRange(skill) , 0) then
if isTarget then
Ability.CastTarget(skill, hero)
else
Ability.CastNoTarget(skill)
end
return end
end
return brstle