Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Want to start learning


Best Answer Pazamolam , 29 August 2015 - 07:45

Finally i got the kayle script done. I will love to hear how i can improve it:

local info = "Kayle v1.0.0 By Vegita"
textTable = {info}
PrintChat(textTable[1])

Config = scriptConfig("Kayle", "Kayle:")
Config.addParam("Q", "Use Q", SCRIPT_PARAM_ONOFF, true)
Config.addParam("W", "Use W", SCRIPT_PARAM_ONOFF, true)
Config.addParam("E", "Use E", SCRIPT_PARAM_ONOFF, true)
Config.addParam("R", "Use R", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig = scriptConfig("Drawings", "Drawings:")
DrawingsConfig.addParam("DrawQ", "Draw Q", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawW", "Draw W", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawE", "Draw E", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawR", "Draw R", SCRIPT_PARAM_ONOFF, true)

OnLoop(function(myHero)
Drawings()

        local target = GetCurrentTarget()
        if KeyIsDown (string.byte(" ")) and ValidTarget(target) then
				
					if IsInDistance(target, GetCastRange(myHero,_Q)) and CanUseSpell(myHero, _Q) == READY and Config.Q then     
							CastTargetSpell(target, _Q)
					end	
					
					if IsInDistance(target, 525) and CanUseSpell(myHero, _E) == READY and Config.E then 
							CastTargetSpell(myHero, _E) 
					end
		
					for _, ally in pairs(GetAllyHeroes()) do
						if Config.W then
							if (GetCurrentHP(ally)/GetMaxHP(ally))<0.5 and
								CanUseSpell(myHero, _W) == READY and IsInDistance(ally, 600) then
								CastTargetSpell(ally, _W)		
							end
						end
					end
							if Config.W then
								if (GetCurrentHP(myHero)/GetMaxHP(myHero))<0.6 and
									CanUseSpell(myHero, _W) == READY then
									CastTargetSpell(myHero, _W)
								end
							end			
										if Config.R then
											if (GetCurrentHP(myHero)/GetMaxHP(myHero))<0.3 and
												CanUseSpell(myHero, _R) == READY then
												CastTargetSpell(myHero, _R)
											end
										end
									
										for _, ally in pairs(GetAllyHeroes()) do
											if Config.R then
												if (GetCurrentHP(ally)/GetMaxHP(ally))<0.3 and
													CanUseSpell(myHero, _R) == READY and IsInDistance(ally, 900) then
													CastTargetSpell(ally, _R)			
												end
											end
										end						
			end								
end)				

function Drawings()

	local myHero = GetMyHero()
	local target = GetCurrentTarget()
	local myHeroPos = GetOrigin(myHero)
	if "Kayle" == GetObjectName(myHero) then
			
	myHeroPos = GetOrigin(myHero)
		if DrawingsConfig.DrawQ then
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_Q),3,100,0xff00ff00)
		end
		
		if DrawingsConfig.DrawW then	
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_W),3,100,0xff00ff00)
		end
			
		if DrawingsConfig.DrawE then	
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,525),3,100,0xff00ff000)
		end
		
		if DrawingsConfig.DrawR then	
					DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_R),3,100,0xff00ff00)
		end		
	end		
end
Go to the full post »


  • This topic is locked This topic is locked
45 replies to this topic

#21
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

25 is the default damage without growth, you can get it if you do this simple calculation :

80 is damage at lvl 1

55 is Q growth stat

25 is difference which is 80-55

 

and this works for every lvl if you try another calculation

135 is damage

55 is Q growth stat for every lvl so lvl 2 = 55*2 = 110

135-110 = 25 which is difference

 

Oh that's awesome i get it. thank for all those helpful comments.

 

local target = GetTarget(1000, DAMAGE_MAGIC) while blitz Q is 925 Range is still difficult for me to understand why :o


  • 0

#22
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

 

25 is the default damage without growth, you can get it if you do this simple calculation :

80 is damage at lvl 1

55 is Q growth stat

25 is difference which is 80-55

 

and this works for every lvl if you try another calculation

135 is damage

55 is Q growth stat for every lvl so lvl 2 = 55*2 = 110

135-110 = 25 which is difference

 

Oh that's awesome i get it. thank for all those helpful comments.

 

local target = GetTarget(1000, DAMAGE_MAGIC) while blitz Q is 925 Range is still difficult for me to understand why :o

 

 

i said already :P


  • 0

#23
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

It will select  target  in bigger radius instead of  925 to be grabbed by Q 


  • 0

#24
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

It will select  target  in bigger radius instead of  925 to be grabbed by Q 

Thank you, do you know why its efficient?

i said already :P

Yea i typed it before you answered, thanks very much :)


  • 0

#25
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

and this

http://gamingonstero...ha-version-010/

 

I doubt you don't see it yet


  • 0

#26
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

Lets say you will make  range 925  and  if  in that range  comes any champion  "even tank  or something that you don't want to get grabbed "  Q will grab .  But if you make target select range bigger it will look for other  champions/enemies  that has low hp  to be grabbed  


  • 0

#27
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

Ok i have attempted to do something, can someone tell me what's wrong with this code?

OnLoop(function(myHero)
Drawings()

		if IWalkConfig.Combo then
			local target = GetTarget(700, DAMAGE_MAGIC)
			
				if CanUseSpell(myHero, _Q) == READY and Config.Q and ValidTarget(target, GetCastRange(myHero,_Q)) then
					CastSkillShot(_Q,QPred.PredPos.x,QPred.PredPos.y,QPred.PredPos.z)
					
				if CanUseSpell(myHero, _E) == READY and Config.E and ValidTarget(target, 525) then
					CastSpell(_E)
				end
			end
		end

function Drawings()
	myHeroPos = GetOrigin(myHero)
		if DrawingsConfig.DrawQ and DrawingsConfig.DrawW and DrawingsConfig.DrawE and DrawingsConfig.DrawR then
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_Q),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_W),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_E),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_R),3,100,0xff00ff00) end
		end
end

it tells me to close an ')' on DrawCircle from this line  OnLoop(function(myHero)


  • 0

#28
Deftsu

Deftsu

    donthackourgames

  • Ex-Core Dev
  • PipPipPip
  • 4,812 posts

Ok i have attempted to do something, can someone tell me what's wrong with this code?

OnLoop(function(myHero)
Drawings()

		if IWalkConfig.Combo then
			local target = GetTarget(700, DAMAGE_MAGIC)
			
				if CanUseSpell(myHero, _Q) == READY and Config.Q and ValidTarget(target, GetCastRange(myHero,_Q)) and QPred.HitChance == 1 then
					CastSkillShot(_Q,QPred.PredPos.x,QPred.PredPos.y,QPred.PredPos.z)
					
				if CanUseSpell(myHero, _E) == READY and Config.E and ValidTarget(target, 525) then
					CastSpell(_E)
				end
			end
		end

function Drawings()
	myHeroPos = GetOrigin(myHero)
		if DrawingsConfig.DrawQ and DrawingsConfig.DrawW and DrawingsConfig.DrawE and DrawingsConfig.DrawR then
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_Q),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_W),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_E),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_R),3,100,0xff00ff00) end
		end
end

it tells me something between DrawCircle in line 35 to close ( on line 14 something like that.

 

first of all you don't have any menu to make config.Q or DrawingsConfig, and your Drawings() format is wrong, you changed mine in a wrong way, it will draw all the circles if only all the DrawingsConfig are ON so if you disable Q Drawing  in the menu every drawing will be off.. 2nd you don't have QPred for the Q cast

 

and when you changed my Drawings() function you have useless end's in DrawCircle lines


  • 0

#29
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

Ok i have attempted to do something, can someone tell me what's wrong with this code?

OnLoop(function(myHero)
Drawings()

		if IWalkConfig.Combo then
			local target = GetTarget(700, DAMAGE_MAGIC)
			
				if CanUseSpell(myHero, _Q) == READY and Config.Q and ValidTarget(target, GetCastRange(myHero,_Q)) then
					CastSkillShot(_Q,QPred.PredPos.x,QPred.PredPos.y,QPred.PredPos.z)
					
				if CanUseSpell(myHero, _E) == READY and Config.E and ValidTarget(target, 525) then
					CastSpell(_E)
				end
			end
		end

function Drawings()
	myHeroPos = GetOrigin(myHero)
		if DrawingsConfig.DrawQ and DrawingsConfig.DrawW and DrawingsConfig.DrawE and DrawingsConfig.DrawR then
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_Q),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_W),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_E),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_R),3,100,0xff00ff00) end
		end
end

it tells me to close an ')' on DrawCircle from this line  OnLoop(function(myHero)

you must learn to walk before you can run.... :fappa:


  • 0

#30
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

first of all you don't have any menu to make config.Q or DrawingsConfig, and your Drawings() format is wrong, you changed mine in a wrong way, it will draw all the circles if only all the DrawingsConfig are ON so if you disable Q Drawing  in the menu every drawing will be off.. 2nd you don't have QPred for the Q cast

 

and when you changed my Drawings() function you have useless end's in DrawCircle lines

Actually i have a menu i just didn't include it. and i fixed the QPred here is the new code: now it tells me to put an '<eof>' in one before the last line.

infoConfig = scriptConfig("Kayle", "Kayle")
infoConfig.addParam("Kayle", "Kayle v1.00", SCRIPT_PARAM_INFO)
Config = scriptConfig("Kayle", "Kayle:")
Config.addParam("Q", "Use Q", SCRIPT_PARAM_ONOFF, true)
Config.addParam("E", "Use E", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig = scriptConfig("Drawings", "Drawings:")
DrawingsConfig.addParam("DrawQ", "Draw Q", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawW", "Draw W", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawR", "Draw R", SCRIPT_PARAM_ONOFF, true)

myIAC = IAC()

OnLoop(function(myHero)
Drawings()

		if IWalkConfig.Combo then
			local target = GetTarget(700, DAMAGE_MAGIC)
			
				if CanUseSpell(myHero, _Q) == READY and Config.Q and ValidTarget(target, GetCastRange(myHero,_Q)) then
					CastSpell(_Q)
					
				if CanUseSpell(myHero, _E) == READY and Config.E and ValidTarget(target, 525) then
					CastSpell(_E)
				end
			end
		end

function Drawings()
	myHeroPos = GetOrigin(myHero)
		if DrawingsConfig.DrawQ and DrawingsConfig.DrawW and DrawingsConfig.DrawR then
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_Q),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_W),3,100,0xff00ff00) end
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_R),3,100,0xff00ff00) end)
		end
end

  • 0

#31
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

you must learn to walk before you can run.... :fappa:

 

:D I will in time, but for now I'm trying make at least a fast and simple script and improve from there Kappa


  • 0

#32
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

:D I will in time, but for now I'm trying make at least a fast and simple script and improve from there Kappa

rly? as I see you are making a complex script.....


  • 0

#33
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

rly? as I see you are making a complex script.....

That's a 38 lines script O_O I think that's the most simple one i have seen so far. By the way do you know why won't the new code work? i posted it 2 comments above


  • 0

#34
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

That's a 38 lines script O_O I think that's the most simple one i have seen so far. By the way do you know why won't the new code work? i posted it 2 comments above

my kayle is 16 lines Doge

 

 

and your OnLoop didn't have "end" 


  • 0

#35
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

my kayle is 16 lines Doge

 

 

and your OnLoop didn't have "end" 

I will have a look at your kayle, 16 lines sounds interesting.

 

Any ideas how i fix the OnLoop?


  • 0

#36
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

I will have a look at your kayle, 16 lines sounds interesting.

 

Any ideas how i fix the OnLoop?

just go check my kayle you will know how


  • 0

#37
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

Okay guys i have a new problem. I have made this script:

infoConfig = scriptConfig("Kayle", "Kayle")
infoConfig.addParam("Kayle", "Kayle v1.00", SCRIPT_PARAM_INFO)
Config = scriptConfig("Kayle", "Kayle:")
Config.addParam("Q", "Use Q", SCRIPT_PARAM_ONOFF, true)
Config.addParam("W", "Use W", SCRIPT_PARAM_ONOFF, true)
Config.addParam("E", "Use E", SCRIPT_PARAM_ONOFF, true)
Config.addParam("R", "Use R", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig = scriptConfig("Drawings", "Drawings:")
DrawingsConfig.addParam("DrawQ", "Draw Q", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawW", "Draw W", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawE", "Draw E", SCRIPT_PARAM_ONOFF, true)
DrawingsConfig.addParam("DrawR", "Draw R", SCRIPT_PARAM_ONOFF, true)

myIAC = IAC()

function OnLoad()
	PrintChat("Kayle v1.0.0")
end	

OnLoop(function(myHero)
Drawings()

		if IWalkConfig.Combo then
			local target = GetCurrentTarget()
			
				if IsInDistance(target, GetCastRange(myHero,_Q)) and CanUseSpell(myHero, _Q) == READY and Config.Q then     
                        CastTargetSpell(target, _Q)
				end	
					
				if IsInDistance(target, 525) and CanUseSpell(myHero, _E) == READY and Config.E then 
                        CastTargetSpell(myHero, _E) 
				end
		end
		
			for _, ally in pairs(GetAllyHeroes()) do
				if Config.W then
					if (GetCurrentHP(ally)/GetMaxHP(ally))<0.5 and
						CanUseSpell(myHero, _W) == READY and IsInDistance(ally, 600) then
						CastTargetSpell(ally, _W)		
					end
				end
			end
						if Config.W then
							if (GetCurrentHP(myHero)/GetMaxHP(myHero))<0.6 and
								CanUseSpell(myHero, _W) == READY then
								CastTargetSpell(myHero, _W)
							end
						end			
									if Config.R then
										if (GetCurrentHP(myHero)/GetMaxHP(myHero))<0.3 and
											CanUseSpell(myHero, _R) == READY then
											CastTargetSpell(myHero, _R)
										end
									end
									
									for _, ally in pairs(GetAllyHeroes()) do
										if Config.R then
											if (GetCurrentHP(ally)/GetMaxHP(ally))<0.3 and
												CanUseSpell(myHero, _R) == READY and IsInDistance(ally, 900) then
												CastTargetSpell(ally, _R)			
											end
										end
									end		
end)				

function Drawings()
	myHeroPos = GetOrigin(myHero)
		if DrawingsConfig.DrawQ then
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_Q),3,100,0xff00ff00)
		end
		
		if DrawingsConfig.DrawW then	
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_W),3,100,0xff00ff00)
		end
			
		if DrawingsConfig.DrawE then	
			DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,525),3,100,0xff00ff000)
		end
		
		if DrawingsConfig.DrawR then	
					DrawCircle(myHeroPos.x,myHeroPos.y,myHeroPos.z,GetCastRange(myHero,_R),3,100,0xff00ff00)
		end						
end

Actually it surprisingly worked, and it was nice and all, and then in the middle of the game right after i killed Kog Maw i got this error:

 

Z8esKAL.jpg

 

Any ideas?


  • 0

#38
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

try dis http://pastebin.com/ZFgUwSP7


  • 0

#39
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

What were the changes i can't seem to find any it's hard searching them :P


  • 0

#40
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

as I said, plz learn walk first.

 

if you really understand that 16 lines code, you won't make the mistake like now.

 

 

and don't copy any code you don't understand.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users