View difference between Paste ID: gh96YAYy and He0RAbuJ
SHOW: | | - or go back to the newest paste.
1
--[[
2-
	Rengar The Rapist v1.4 by jbman
2+
	Rengar The Rapist v1.5 by jbman
3
]]
4
if myHero.charName ~= "Rengar" then return end
5
--[[		Code		]]
6
7
local mousemoving = true
8
local waitDelay = 400
9
local scanAdditionalRange = 750
10
local nextTick = 0
11
12
local AAmove = true
13
14-
local erange = 575
14+
15
local range = 750
16
local erange = 570
17
local rrange = 0
18-
local swingDelay = 0.15
18+
19
local lastQ = 0
20
21
local Qactive = false
22
local lastQActive = 0
23
24
local AArange = (myHero.range + (GetDistance(myHero.minBBox, myHero.maxBBox)/2))
25
26
local lastBasicAttack = 0
27-
local TMATSlot, SotDSlot BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil, nil, nil, nil
27+
local swingDelay = (0.3 - (GetLatency()/1000))
28-
local QREADY, WREADY, EREADY, RREADY, TMATREADY, SotDREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY = false, false, false, false, false, false, false, false, false, false
28+
29
local tick = nil
30
31
local targetSelected = true
32-
    velocityTimer = {}
32+
33-
    oldPos = {}
33+
34-
    Velocity = {}
34+
35-
    oldTick = {}
35+
36
37-
    velocity = 0
37+
local YMGBSlot, TMATSlot, SotDSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, ROSlot, ENTSlot, LOCKSlot = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
38-
    velocityTimeOut = 5
38+
local QREADY, WREADY, EREADY, RREADY, YMGBREADY, TMATREADY, SotDREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY, ROREADY, ENTREADY, LOCKREADY = false, false, false, false, false, false, false, false, false, false, false, false, false, false
39
40-
    conversionFactor = 975 --estimate. Converts coordinate velocity to game movement speed.
40+
41-
    msVarianceTrigger = 100 --will knock back when velocity > hero.ms + variance
41+
42-
    minMovementSpeed = 300 --minimum hero.ms to condemn. Sometimes hero.ms bugs and shows lesser values.    
42+
	RCConfig = scriptConfig("Rengar the Rapist", "rengartherapist v1.5")
43
	RCConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
44
	RCConfig:addParam("scriptActive1", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
45
	RCConfig:addParam("scriptActive2", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 90)
46-
      if hero.team == TEAM_ENEMY then
46+
  RCConfig:addParam("tripleQ", "Tiple Q", SCRIPT_PARAM_ONKEYDOWN, false, 89)
47-
        oldPos[hero.name] = {}
47+
48-
        oldTick[hero.name] = {}
48+
49-
        Velocity[hero.name] = 0
49+
50-
        velocityTimer[hero.name] = 0
50+
51
  RCConfig:addParam("autoEharass", "Auto E Harass", SCRIPT_PARAM_ONOFF, false)
52
	RCConfig:addParam("autoAAFarm", "Auto AA Farm", SCRIPT_PARAM_ONKEYDOWN, false, 192) -- `~
53-
	RCConfig = scriptConfig("Rengar the Rapist", "rengartherapist v1.4")
53+
54
	RCConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
55
  RCConfig:addParam("autoW", "Auto W", SCRIPT_PARAM_ONOFF, false)
56-
	RCConfig:addParam("scriptActive3", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)
56+
	RCConfig:permaShow("autoEharass")
57-
	RCConfig:addParam("escape", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 89)
57+
  RCConfig:permaShow("autoAAFarm")
58
  RCConfig:permaShow("autoEFarm")
59
  RCConfig:permaShow("autoW")
60
  RCConfig:permaShow("autoEKS")
61
	ts = TargetSelector(TARGET_LOW_HP,range+250,DAMAGE_PHYSICAL,true)	
62
	ts.name = "Rengar"
63
	RCConfig:addTS(ts)
64
  enemyMinions = minionManager(MINION_ENEMY, range+150, player, MINION_SORT_HEALTH_ASC)
65-
  RCConfig:addParam("autoW", "Auto W", SCRIPT_PARAM_ONKEYTOGGLE, false, 84)
65+
66-
	RCConfig:permaShow("autoAAFarm")
66+
67
  end
68
69
end
70-
	ts = TargetSelector(TARGET_LOW_HP,range+150,DAMAGE_PHYSICAL,true)	
70+
71
	function OnProcessSpell(unit, spell)
72
		if unit.isMe then
73
			if spell and spell.name:find("RengarBasicAttack" or "RengarCritAttack") then
74
				swing = 1
75
				lastBasicAttack = os.clock()
76
			end      
77
		end
78
	end
79
	
80
	function OnCreateObj(obj)
81
    if canQ == true and obj and obj.name:find("Rengar_Q_Attack_Hunter.troy") then
82-
      if spell and spell.name:find("RengarQ")then
82+
83-
        canQ = false
83+
      lastQ = os.clock()
84-
				swing = 0
84+
85-
			end
85+
86
		if obj and (obj.name == "Rengar_LeapEnd.troy") and GetDistance(obj) < 150 then        	
87
      swing = 1
88
      lastBasicAttack = os.clock()
89-
        canQ = true
89+
90
	end
91
92
function OnTick()
93
  
94
	if myHero.dead then
95-
    if canQ == true and obj and obj.name:find("RengarQ") then
95+
96
	end
97
  
98
  	ts:update()	
99
  
100
  if (myHero:CanUseSpell(_R) == READY) and myHero:GetSpellData(_R).level == 1 then
101
    rrange = (myHero.ms*1.2) * 7
102-
      canQ = true
102+
  elseif (myHero:CanUseSpell(_R) == READY) and myHero:GetSpellData(_R).level == 2 then
103
    rrange = (myHero.ms*1.25) * 7
104-
    --minionManager__OnCreateObj(object) -- OnCreateObj
104+
  elseif (myHero:CanUseSpell(_R) == READY) and myHero:GetSpellData(_R).level == 3 then
105
    rrange = (myHero.ms*1.3) * 7
106
  end
107-
  function findmyHeroVelocity(target, oldPos, oldTick)
107+
108-
    if oldPos.x and oldPos.z and target.x and target.z then
108+
109-
        local dis = math.sqrt((oldPos.x - target.x) ^ 2 + (oldPos.z - target.z) ^ 2)
109+
110-
        Velocity[target.name] = (dis / (GetTickCount() - oldTick)) * conversionFactor
110+
111
  
112
  if canQ == false and os.clock() > lastQ + 0.8 then
113
		canQ = true
114-
  --[[function OnDeleteObj(obj)
114+
115-
     minionManager__OnDeleteObj(object) -- OnDeleteObj 
115+
116-
  end]]
116+
117
118
	QREADY = (myHero:CanUseSpell(_Q) == READY)
119
	WREADY = (myHero:CanUseSpell(_W) == READY)
120
	EREADY = (myHero:CanUseSpell(_E) == READY)
121
	RREADY = (myHero:CanUseSpell(_R) == READY)
122
	IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
123
  
124
  YMGBSlot, TMATSlot, SotDSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, ROSlot, ENTSlot, LOCKSlot = GetInventorySlotItem(3142), GetInventorySlotItem(3077) or GetInventorySlotItem(3074) , GetInventorySlotItem(3131), GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100), GetInventorySlotItem(3143), GetInventorySlotItem(3184), GetInventorySlotItem(3190)
125
	
126
  DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
127-
			
127+
128-
	--[[if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then
128+
129-
		if IREADY then
129+
  BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
130-
			local ignitedmg = 0	
130+
131-
			for j = 1, heroManager.iCount, 1 do
131+
132-
				local enemyhero = heroManager:getHero(j)
132+
  YMGBREADY = (YMGBSlot ~= nil and myHero:CanUseSpell(YMGBSlot) == READY)
133-
				if ValidTarget(enemyhero,600) then
133+
  ROREADY = (ROSlot ~= nil and myHero:CanUseSpell(ROSlot) == READY)
134-
					ignitedmg = 50 + 20 * myHero.level
134+
  ENTREADY = (ENTSlot ~= nil and myHero:CanUseSpell(ENTSlot) == READY)
135-
					if enemyhero.health <= (ignitedmg - 50) then
135+
  LOCKREADY = (LOCKSlot ~= nil and myHero:CanUseSpell(LOCKSlot) == READY)
136-
						CastSpell(ignite, enemyhero)
136+
   
137-
					end
137+
138
  if RCConfig.harass and ts.target ~= nil then
139-
			end
139+
140
			CastSpell(_E, ts.target)
141-
	end]]
141+
142
	end
143
144
	
145-
	TMATSlot, SotDSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3077) or GetInventorySlotItem(3074) , GetInventorySlotItem(3131), GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100) -- 
145+
146
		for i = 1, heroManager.iCount, 1 do
147
      local hero = heroManager:getHero(i)
148
      if RCConfig.autoW and WREADY and hero.team ~= myHero.team then
149
        if myHero.mana < 5 and  ValidTarget(hero) and GetDistance(myHero, hero) < wrange then
150-
	DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
150+
          CastSpell(_W)
151
        end
152
      end
153
      if RCConfig.autoEKS and EREADY and hero.team ~= myHero.team then
154
        local edamage = getDmg("E",hero,myHero)
155
        if myHero.mana < 5 and ValidTarget(hero) and GetDistance(myHero, hero) < 560 and hero.health < edamage then          
156-
			
156+
          CastSpell(_E,hero)                              
157-
	ts:update()	
157+
158
      end
159-
	if RCConfig.harass and ts.target ~= nil then
159+
160
	end
161
  
162
  if (RCConfig.scriptActive or RCConfig.scriptActive1 or RCConfig.scriptActive2 or RCConfig.scriptActive3) and ts.target ~= nil and RCConfig.autoignite and IREADY then    
163
		local QWEDmg = RENIgniteCalculation(ts.target)
164
		local IDmg = getDmg("IGNITE",ts.target,myHero)    
165
		if GetDistance(ts.target) < 600 and ts.target.health > QWEDmg and ts.target.health <= IDmg+QWEDmg then CastSpell(ignite, ts.target) end
166
	end
167
  
168-
      if RCConfig.autoW then
168+
	if RCConfig.scriptActive then
169-
        if ValidTarget(hero, nil, true) then
169+
170-
          if velocityTimer[hero.name] <= GetTickCount() and hero and hero.x and hero.z then
170+
    if myHero.mana < 5 and WREADY then
171-
            velocityTimer[hero.name] = GetTickCount() + velocityTimeOut
171+
      for i = 1, heroManager.iCount, 1 do
172-
            findmyHeroVelocity(hero, oldPos[hero.name], oldTick[hero.name])
172+
        local hero = heroManager:getHero(i)
173-
            oldPos[hero.name].x = hero.x
173+
        if ValidTarget(hero) and GetDistance(hero) < wrange and hero.team ~= myHero.team then
174-
            oldPos[hero.name].z = hero.z
174+
          CastSpell(_W)         
175-
            oldTick[hero.name] = GetTickCount()
175+
176
      end
177-
          if Velocity[hero.name] > (hero.ms + msVarianceTrigger) and hero.ms > minMovementSpeed and GetDistance(myHero, hero) < 475 then
177+
178-
            if WREADY then
178+
179-
              CastSpell(_W)            
179+
    if ts.target ~= nil then
180
      
181
      if DFGREADY then CastSpell(DFGSlot, ts.target) end
182
      if HXGREADY then CastSpell(HXGSlot, ts.target) end
183-
        if ValidTarget(hero) and GetDistance(myHero, hero) < 450 then
183+
      if BWCREADY then CastSpell(BWCSlot, ts.target) end
184-
          if myHero.mana < 5 and WREADY then
184+
      if BRKREADY then CastSpell(BRKSlot, ts.target) end
185-
            CastSpell(_W)            
185+
      if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
186
      if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end
187
    
188
      if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then			
189-
      if RCConfig.autoEKS then
189+
          CastSpell(_W)
190
      end
191-
        if ValidTarget(hero) and GetDistance(myHero, hero) < erange and hero.health < edamage then
191+
192-
          if myHero.mana < 5 and EREADY then
192+
      if (GetDistance(ts.target) < erange and GetDistance(ts.target) > AArange) and EREADY then			
193-
            CastSpell(_E)            
193+
        CastSpell(_E, ts.target)
194-
          end                    
194+
195
      if swing == 0 then
196
      
197
        if GetDistance(ts.target) < AArange + 250 then
198
          myHero:Attack(ts.target)
199
          if YMGBREADY and GetDistance(ts.target) > AArange + 250 then -- YMGB
200
            if ts.target.type == "obj_AI_Hero" then
201-
		local QWEDmg = RENDmgCalculation(ts.target)
201+
              CastSpell(YMGBSlot)
202
            end
203
          end
204-
	end  
204+
205
      elseif swing == 1 then
206-
	if RCConfig.scriptActive and ts.target ~= nil then
206+
        if QREADY == false and EREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
207-
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
207+
          if ts.target ~= nil then
208-
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
208+
            swing = 0
209-
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
209+
            if AAmove == true then
210-
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
210+
              player:MoveTo(ts.target.x, ts.target.z)
211-
    if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then			
211+
212-
				CastSpell(_W)
212+
            myHero:Attack(ts.target)        
213
          elseif ts.target == nil then
214-
		if swing == 0 then
214+
            swing = 0
215-
      if (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then			
215+
216-
				CastSpell(_E, ts.target)
216+
        end      
217-
			end
217+
        if YMGBREADY then -- YMGB
218-
      if ts.target ~= nil and ValidTarget(ts.target, wrange) then
218+
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
219-
				myHero:Attack(ts.target)
219+
            CastSpell(YMGBSlot)
220-
			end
220+
221-
    elseif swing == 1 then
221+
222-
      if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
222+
        if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
223-
        CastSpell(TMATSlot)
223+
          CastSpell(TMATSlot)
224-
        swing = 0
224+
          swing = 0
225
        end
226-
      if SotDREADY then
226+
        if SotDREADY then
227-
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
227+
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
228-
          CastSpell(SotDSlot)
228+
            CastSpell(SotDSlot)
229
          end
230-
      end      
230+
231-
			if EREADY and os.clock() - lastBasicAttack > swingDelay then
231+
        if ENTREADY then -- YMGB
232-
				CastSpell(_E, ts.target)
232+
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
233-
				swing = 0	
233+
            CastSpell(ENTSlot)
234-
	elseif myHero.mana < 5 and QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
234+
235-
				CastSpell(_Q)
235+
        end      
236-
        myHero:Attack(ts.target)
236+
        if EREADY and os.clock() - lastBasicAttack > swingDelay then
237-
				swing = 0
237+
          CastSpell(_E, ts.target)
238-
			end
238+
          swing = 0	
239-
		end					
239+
        elseif myHero.mana < 5 and QREADY and EREADY == false and os.clock() - lastBasicAttack > swingDelay then
240
          CastSpell(_Q)
241-
  	
241+
          myHero:Attack(ts.target)
242-
	if RCConfig.scriptActive2 and ts.target ~= nil then
242+
          swing = 0
243-
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
243+
244-
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
244+
      end					
245-
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
245+
246-
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
246+
247-
    if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then			
247+
248-
				CastSpell(_W)
248+
249-
		end				
249+
250-
		if swing == 0 then
250+
	if RCConfig.scriptActive1 then
251-
      if myHero.mana == 4 and not (WREADY or QREADY) and (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then			
251+
252-
				CastSpell(_E, ts.target)
252+
    if myHero.mana < 5 and WREADY then
253-
			end
253+
      for i = 1, heroManager.iCount, 1 do
254-
			if ts.target ~= nil and ValidTarget(ts.target, wrange) then
254+
        local hero = heroManager:getHero(i)
255-
				myHero:Attack(ts.target)
255+
        if ValidTarget(hero) and GetDistance(hero) < wrange and hero.team ~= myHero.team then
256-
			end
256+
          CastSpell(_W)         
257-
    elseif swing == 1 then
257+
258-
      if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
258+
259-
        CastSpell(TMATSlot)
259+
260-
        swing = 0
260+
261-
      end      
261+
    if ts.target ~= nil then
262-
      if SotDREADY then
262+
      if canQ == false then
263-
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
263+
        if ts.target ~= nil then
264-
          CastSpell(SotDSlot)
264+
          if AAmove == true then
265
            player:MoveTo(ts.target.x, ts.target.z)
266-
      end      
266+
            myHero:Attack(ts.target)
267-
      if canQ == true then
267+
          end        
268-
       if QREADY and os.clock() - lastBasicAttack > swingDelay and canQ == true then
268+
          if os.clock() - lastQ > 0.01  then
269-
         canQ = false
269+
            myHero:Attack(ts.target)
270-
         CastSpell(_Q)         
270+
            canQ = true 
271-
         myHero:Attack(ts.target)
271+
272-
         swing = 0
272+
        elseif ts.target == nil then
273-
	elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
273+
          canQ = true        
274-
				CastSpell(_E, ts.target)
274+
275-
				swing = 0
275+
276
      if DFGREADY then CastSpell(DFGSlot, ts.target) end
277-
			end
277+
      if HXGREADY then CastSpell(HXGSlot, ts.target) end
278-
		end							
278+
      if BWCREADY then CastSpell(BWCSlot, ts.target) end
279-
	end	
279+
      if BRKREADY then CastSpell(BRKSlot, ts.target) end
280
      if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
281-
	if RCConfig.scriptActive3 and ts.target ~= nil then
281+
      if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end
282-
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
282+
283-
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
283+
      if myHero.mana < 5 and GetDistance(ts.target) < wrange and WREADY then			
284-
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
284+
        CastSpell(_W)
285-
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
285+
286
      if myHero.mana == 4 and WREADY == false and QREADY == false and (GetDistance(ts.target) > AArange and GetDistance(ts.target) < erange) and EREADY then			
287-
    if GetDistance(ts.target) < wrange and WREADY then			
287+
        CastSpell(_E, ts.target)
288-
				CastSpell(_W)
288+
289-
		end				
289+
      if swing == 0 then      
290-
		if swing == 0 then
290+
        if GetDistance(ts.target) < AArange + 250 then
291-
      if myHero.mana == 4 and not (WREADY or QREADY) and (GetDistance(ts.target) < erange and GetDistance(ts.target) > 225) and EREADY then			
291+
          myHero:Attack(ts.target)
292-
				CastSpell(_E, ts.target)
292+
          if YMGBREADY and GetDistance(ts.target) > AArange + 250 then -- YMGB
293-
			end
293+
            if ts.target.type == "obj_AI_Hero" then
294-
			if ts.target ~= nil and ValidTarget(ts.target, wrange) then
294+
              CastSpell(YMGBSlot)
295-
				myHero:Attack(ts.target)
295+
296-
			end
296+
297-
    elseif swing == 1 then
297+
298-
      if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
298+
      elseif swing == 1 then      
299-
        CastSpell(TMATSlot)
299+
        if QREADY and os.clock() - lastBasicAttack > swingDelay and canQ == true then
300-
        swing = 0
300+
          canQ = false
301
          swing = 0
302-
      if SotDREADY then
302+
          CastSpell(_Q)         
303-
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
303+
          myHero:Attack(ts.target)
304-
          CastSpell(SotDSlot)
304+
          swing = 0
305
        elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
306
          CastSpell(_E, ts.target)
307-
      if myHero.mana < 5 and QREADY and os.clock() - lastBasicAttack > swingDelay then
307+
          swing = 0        
308-
         CastSpell(_Q)
308+
309-
         myHero:Attack(ts.target)
309+
        if QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
310-
         swing = 0
310+
          if ts.target ~= nil then
311-
	elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
311+
            swing = 0
312-
				CastSpell(_E, ts.target)
312+
            if AAmove == true then
313-
				swing = 0
313+
              player:MoveTo(ts.target.x, ts.target.z)
314
            end
315-
		end							
315+
            myHero:Attack(ts.target)        
316
          elseif ts.target == nil then
317
            swing = 0
318
          end
319
        end      
320
        if YMGBREADY then -- YMGB
321
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
322
            CastSpell(YMGBSlot)
323
          end
324
        end
325
        if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
326
          CastSpell(TMATSlot)
327
          swing = 0
328
        end      
329
        if SotDREADY then
330
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
331
            CastSpell(SotDSlot)
332
          end
333
        end
334
        if ENTREADY then -- YMGB
335
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
336
            CastSpell(ENTSlot)
337
          end
338
        end      
339
      end							
340
    end
341
  end
342
	
343-
    --[[if mousemoving and GetTickCount() > nextTick then
343+
344
  
345
	if RCConfig.scriptActive2 then
346
    
347-
			local myE = getDmg("E",minion,myHero)
347+
    if myHero.mana < 5 and WREADY then
348-
			if minion and EREADY and myHero:GetDistance(minion) <= erange and minion.health <= myE and minion.dead == false then
348+
      for i = 1, heroManager.iCount, 1 do
349-
				CastSpell(_E, minion)
349+
        local hero = heroManager:getHero(i)
350-
			end
350+
        if ValidTarget(hero) and GetDistance(hero) < wrange and hero.team ~= myHero.team then
351
          CastSpell(_W)         
352
        end
353
      end
354-
		for k = 1, objManager.maxObjects do
354+
355-
			local minionObjectI = objManager:GetObject(k)      
355+
356-
			if minionObjectI ~= nil and string.find(minionObjectI.name,"Minion_") == 1 and minionObjectI.team ~= myHero.team and minionObjectI.dead == false then
356+
    if ts.target ~= nil then
357-
        local myE = getDmg("E",minionObjectI,myHero)
357+
      if DFGREADY then CastSpell(DFGSlot, ts.target) end
358-
				if myHero:GetDistance(minionObjectI) < 575 and minionObjectI.health <= myHero:CalcDamage(minionObjectI, myE) then
358+
      if HXGREADY then CastSpell(HXGSlot, ts.target) end
359-
					CastSpell(_E, minionObjectI)
359+
      if BWCREADY then CastSpell(BWCSlot, ts.target) end
360
      if BRKREADY then CastSpell(BRKSlot, ts.target) end
361-
			end
361+
      if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
362
      if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end
363-
	end]]
363+
364
      if GetDistance(ts.target) < wrange and WREADY then			
365
        CastSpell(_W)
366
      end
367
      if myHero.mana == 4 and WREADY == false and QREADY == false and (GetDistance(ts.target) > AArange and GetDistance(ts.target) < erange) and EREADY then			
368
        CastSpell(_E, ts.target)
369
      end
370
      if swing == 0 then
371
        if GetDistance(ts.target) < AArange + 250 then
372-
		if lasthiton then
372+
          myHero:Attack(ts.target)
373-
			for index, minion in pairs(enemyMinions.objects) do
373+
          if YMGBREADY and GetDistance(ts.target) > AArange + 250 then -- YMGB
374-
        if minion and minion.dead == false then
374+
            if ts.target.type == "obj_AI_Hero" then
375-
          local myAA = getDmg("AD",minion,myHero)
375+
              CastSpell(YMGBSlot)
376
            end
377-
              player:Attack(minion)
377+
378-
              nextTick = GetTickCount() + waitDelay
378+
379
      elseif swing == 1 then
380
        if QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
381
          if ts.target ~= nil then
382
            swing = 0
383
            if AAmove == true then
384
              player:MoveTo(ts.target.x, ts.target.z)
385
            end
386-
function RENDmgCalculation(enemy)
386+
            myHero:Attack(ts.target)        
387
          elseif ts.target == nil then
388
            swing = 0
389
          end
390
        end      
391
        if YMGBREADY then -- YMGB
392
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
393
            CastSpell(YMGBSlot)
394
          end
395
        end
396
        if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
397
          CastSpell(TMATSlot)
398
          swing = 0
399
        end
400
        if SotDREADY then
401
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
402
            CastSpell(SotDSlot)
403
          end
404
        end
405
        if ENTREADY then -- YMGB
406
          if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
407
            CastSpell(ENTSlot)
408
          end
409
        end
410
        if myHero.mana < 5 and QREADY and os.clock() - lastBasicAttack > swingDelay then
411
          CastSpell(_Q)
412
          myHero:Attack(ts.target)
413
          swing = 0
414
        elseif myHero.mana == 4 and not (WREADY or QREADY) and os.clock() - lastBasicAttack > swingDelay then
415
          CastSpell(_E, ts.target)
416-
			for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
416+
          swing = 0
417
        end
418
      end							
419
    end
420
  end
421
422
423
  if RCConfig.tripleQ then    
424
    if ts.target ~= nil then
425
    
426
      if myHero.mana == 4 and RREADY then
427
        
428
        if QREADY and RREADY and GetDistance(ts.target) < range then
429
          canQ = false
430
          CastSpell(_Q)
431
          CastSpell(_R)
432
          lastQActive = os.clock()
433
          canQ = false
434
          --myHero:HoldPosition()
435
        end
436
      elseif myHero.mana == 5 and RREADY then
437
        if QREADY and RREADY and GetDistance(ts.target) < range + 250 then
438
          canQ = false
439
          CastSpell(_Q)
440
          CastSpell(_R)
441
          lastQActive = os.clock()
442
          canQ = false
443
          --myHero:HoldPosition()
444
        end
445
      end
446
      
447
      if RREADY == false and os.clock() - lastQActive > 3.75 then
448
        
449
        myHero:Attack(ts.target)        
450
      
451
        if canQ == false then
452
          if ts.target ~= nil then
453
            if AAmove == true then
454
              player:MoveTo(ts.target.x, ts.target.z)
455
              myHero:Attack(ts.target)
456
            end        
457
            if os.clock() - lastQ > 0.01  then
458
              myHero:Attack(ts.target)
459
              canQ = true 
460
            end
461
          elseif ts.target == nil then
462
            canQ = true        
463
          end
464
        end
465
        
466
        if myHero.mana < 4 and (GetDistance(ts.target) < erange and GetDistance(ts.target) > AArange) and EREADY then			
467
          CastSpell(_E, ts.target)
468
        end
469
        
470
        if myHero.mana < 4 and GetDistance(ts.target) < wrange and WREADY then			
471
          CastSpell(_W)
472
        end
473
        
474
        if swing == 0 then      
475
          if GetDistance(ts.target) < AArange + 250 then
476
            myHero:Attack(ts.target)            
477
          end
478
        elseif swing == 1 then
479
          
480
          if QREADY and os.clock() - lastBasicAttack > swingDelay and canQ == true then
481
            canQ = false
482
            swing = 0
483
            CastSpell(_Q)         
484
            myHero:Attack(ts.target)
485
            swing = 0              
486
          end
487
          if EREADY and myHero.mana < 4 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
488
            CastSpell(_E, ts.target)
489
            swing = 0
490
          end
491
          if myHero.mana < 4 and EREADY and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
492
            CastSpell(_E, ts.target)
493
            swing = 0
494
          end
495
          if QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
496
            if ts.target ~= nil then
497
              swing = 0
498
              if AAmove == true then
499
                player:MoveTo(ts.target.x, ts.target.z)
500
              end
501
              myHero:Attack(ts.target)        
502
            elseif ts.target == nil then
503
              swing = 0
504
            end
505
          end  
506
          if YMGBREADY then -- YMGB
507
            if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
508
              CastSpell(YMGBSlot)
509
            end
510
          end
511
          if TMATREADY and GetDistance(ts.target) < 375 and  QREADY == false and os.clock() - lastBasicAttack > swingDelay then
512
            CastSpell(TMATSlot)
513
            swing = 0
514
          end
515
          if SotDREADY then
516
            if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
517
              CastSpell(SotDSlot)
518
            end
519
          end
520
          if ENTREADY then -- YMGB
521
            if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
522
              CastSpell(ENTSlot)
523
            end
524
          end    
525
        end							
526
      end
527
    end
528
  end
529
530
  if RCConfig.autoEFarm then
531
    enemyMinions:update()
532
    if mousemoving and GetTickCount() > nextTick then
533
			player:MoveTo(mousePos.x, mousePos.z)
534
		end		
535
    for index, minion in pairs(enemyMinions.objects) do
536
     	if minion and minion.dead == false then
537
        local myE = getDmg("E",minion,myHero)
538
        local myAA = getDmg("AD",minion,myHero)
539
        if EREADY then
540
          if player:GetDistance(minion) < range and minion.health <= myE and EREADY then	
541
            CastSpell(_E, minion)
542
          end
543
        elseif EREADY == false then
544
          if minion and minion.health <= myAA and GetDistance(minion) <= (player.range + scanAdditionalRange) and GetTickCount() > nextTick then
545
            player:Attack(minion) ---PrintChat("ATTACKING")
546
            nextTick = GetTickCount() + waitDelay
547
          end
548
				end
549
      end
550
    end
551
  end
552
  
553
  
554
	if RCConfig.autoAAFarm then
555
    enemyMinions:update()
556
		if mousemoving and GetTickCount() > nextTick then
557
			player:MoveTo(mousePos.x, mousePos.z)
558
		end						
559
		local tick = GetTickCount()
560
		for index, minion in pairs(enemyMinions.objects) do
561
      if minion and minion.dead == false then
562
        local myAA = getDmg("AD",minion,myHero)
563
        if minion and minion.health <= myAA and GetDistance(minion) <= (player.range + scanAdditionalRange) and GetTickCount() > nextTick then
564
          player:Attack(minion)
565
          nextTick = GetTickCount() + waitDelay          
566
				end
567
			end     
568
		end
569
	end
570
  if RCConfig.autoAAFarm and RCConfig.autoEharass and EREADY then
571
    for i = 1, heroManager.iCount, 1 do
572
      local hero = heroManager:getHero(i)
573
      if ValidTarget(hero) and GetDistance(hero) < erange and hero.team ~= myHero.team then
574
        CastSpell(_E,hero)
575
      end
576
    end
577
  end
578
end
579
580
function RENIgniteCalculation(enemy)
581
  local hitdamage = getDmg("AD",enemy,myHero)
582
	local qdamage = getDmg("Q",enemy,myHero)
583
  local qdamage2 = getDmg("Q",enemy,myHero,2) --to Isolated Target
584
	local wdamage = getDmg("W",enemy,myHero)
585
	local edamage = getDmg("E",enemy,myHero)
586
	local combo5 = 0
587
  
588
  if GetDistance(enemy) < 350 then
589
      combo5 = hitdamage
590
    if QREADY and myHero.mana < 5 then
591
      combo5 = combo5 + qdamage + hitdamage
592
    elseif QREADY and myHero.mana == 5 then
593
      combo5 = combo5 + qdamage2 + hitdamage
594
    end    
595
  end
596
	if WREADY and GetDistance(enemy) < wrange then
597
		combo5 = combo5 + wdamage
598
	end
599
	if EREADY and GetDistance(enemy) < erange then
600
		combo5 = combo5 + edamage
601
	end
602
	return combo5
603
end
604
605
function OnDraw()
606
	if RCConfig.drawcircles and not myHero.dead then		
607
    --DrawCircle(myHero.x, myHero.y, myHero.z, AArange, 0x00FF00)
608
		if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wrange, 0x992D3D) end
609
		if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, erange, 0xFFFFFF) end
610
    if RREADY then DrawCircle(myHero.x, myHero.y, myHero.z, rrange, 0x992D3D) end
611
		if ts.target ~= nil then
612
			for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, (GetDistance(ts.target.minBBox, ts.target.maxBBox)/2) + j*1.5, 0x00FF00) end
613
		end
614
	end
615
end
616
function OnSendChat(msg)
617
	ts:OnSendChat(msg, "pri")
618
end
619
PrintChat(" >> Rengar the Rapist v1.4 loaded!")