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

#1
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

Hello, not sure if that's the right forum to post that topic. I have found that site and i think GoS is an amazing tool and looks like a nice community here Kappa .
I want to learn how to script from zero to hero Doge and try to make my own scripts and be a part of this community growth :P if anyone can help me with guides and stuff I'll be happy. I know some basics but i want to know more and start making scripts :)


  • 0

#2
Platypus

Platypus

    Bitcoin and Paysafecard payments are now available

  • Banned
  • PipPipPip
  • 1,289 posts

make a garen


  • 0

#3
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

make a garen

Be serious or feel my wrath


  • 0

#4
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

Be serious or feel my wrath

Kappa


  • 0

#5
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

Keppo 


  • 0

#6
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

Keppo

DrawHand(target,handsize,slapspeed)

 

DrawHand(Zypppy,150,100000000)

 

if myHand.slap "Zypppy" then

DrawText ("Don't Keppo me", 30, 100, 100, 0xFFFFFF00)

 

how is it for first script?


  • 0

#7
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

Im learning myself doe :D 
You can look at  my  screpts  they are simple AF 


  • 0

#8
Feretorix

Feretorix

    Administrator

  • Administrators
  • 3,016 posts
You might look around for some super simple and basic scripts, try to understand what's in there and code something similar.
  • 0

#9
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

you can learn from my script, they are all simple and readable. :popcorn:


  • 0

#10
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

Im learning myself doe :D 
You can look at  my  screpts  they are simple AF 

I will have a look. thanks

 

You might look around for some super simple and basic scripts, try to understand what's in there and code something similar.

Do you have any recommendations for begginers? thanks for the comment

 

you can learn from my script, they are all simple and readable. :popcorn:

Which script is it?


  • 0

#11
ilovesona

ilovesona

    Sona's wife

  • Contributor
  • 1,096 posts

I will have a look. thanks

 

Do you have any recommendations for begginers? thanks for the comment

 

Which script is it?

hmmm.....

 

start from kayle and karthus for basic spell usage

 

then vayne for lib usage


  • 0

#12
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

hmmm.....

 

start from kayle and karthus for basic spell usage

 

then vayne for lib usage

I'm starting to learn a little but a bit confused with some numbers. I took Deftsu's Blitzcrank for example, why those numbers are used?

local target = GetTarget(1000, DAMAGE_MAGIC)
	        if ValidTarget(target, 1000) then

and also this one:

local QPred = GetPredictionForPlayer(GetMyHeroPos(),target,GetMoveSpeed(target),1800,250,GetCastRange(myHero,_Q),70,true,true)

i can't figure what those numbers are


  • 0

#13
Zypppy

Zypppy

    Ex Global Support

  • Contributor
  • 1,817 posts

local target = GetTarget(1000, DAMAGE_MAGIC)
     if ValidTarget(target, 1000) then


Is for  selecting target in that range for spells 

local QPred = GetPredictionForPlayer(GetMyHeroPos(),target,GetMoveSpeed(target),1800,250,GetCastRange(myHero,_Q),70,true,true)


This is for  Qprediction     1800-Missile speed "how fast spell  reaches end of  range"   250 is delay before cast   GetCast range  is Q cast range   , 70  is  Radius of that spell that will hit enemy     true is for minion collision  true  for AOE / enemy champion collision

 


  • 0

#14
Deftsu

Deftsu

    donthackourgames

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

I'm starting to learn a little but a bit confused with some numbers. I took Deftsu's Blitzcrank for example, why those numbers are used?

local target = GetTarget(1000, DAMAGE_MAGIC)
	        if ValidTarget(target, 1000) then

and also this one:

local QPred = GetPredictionForPlayer(GetMyHeroPos(),target,GetMoveSpeed(target),1800,250,GetCastRange(myHero,_Q),70,true,true)

i can't figure what those numbers are

 

local target = GetTarget(1000, DAMAGE_MAGIC)
     if ValidTarget(target, 1000) then

 

1000 is the range, DAMAGE_MAGIC/DAMAGE_PHYSICAL will get our current target depending on AD/AP Champ so if i'm playing Jinx i'll get Target with DAMAGE_PHYSICAL else if i play Cassio or any other AP i get target with DAMAGE_MAGIC

ValidTarget will Check if Target is Valid and not Dead/Immune and is Targetable

 

(you can find this functions in Inspired.lua)

 

 

 

for prediction it's like this :

 

local QPred = GetPredictionForPlayer(startPosition, targetUnit, targetUnitMoveSpeed, spellTravelSpeed, spellDelay, spellRange, spellWidth, collision, addHitBox)

 

so startPosition is our Hero Position for most of spells : GetMyHeroPos() will get our Position

-targetUnit is the target : you need to get a target first

-targetUnitMoveSpeed is the target move speed : GetMoveSpeed(target) will get target move speed

-spelltravelSpeed (aka projectilespeed) : you need to get it from external sources like lolwikia

-spelldelay : with milliseconds usually it's 250 for most of spells but some spells like chogath Q or Ezreal R have more delay, you still can get it from external sources

-spellRange : it's the spell max Range for example Blitz Q is 925 i think, GetCastRange(myHero, _Q) will get the spell range for Q or just put 925 if you want a custom range

-spellWidth : this is spell width, you can get it from external sources

-Collision : if it's true that means it will collide with minions for ex Blitz Q, NidaQ if you put it false it means that the spell won't collide ex ezreal R,Ekko Q

-addHitBox : i still don't know what's this, put it true by default

 

tip : local QPred can be named to what you want since it's local


  • 0

#15
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

local target = GetTarget(1000, DAMAGE_MAGIC)
     if ValidTarget(target, 1000) then


Is for  selecting target in that range for spells 

local QPred = GetPredictionForPlayer(GetMyHeroPos(),target,GetMoveSpeed(target),1800,250,GetCastRange(myHero,_Q),70,true,true)


This is for  Qprediction     1800-Missile speed "how fast spell  reaches end of  range"   250 is delay before cast   GetCast range  is Q cast range   , 70  is  Radius of that spell that will hit enemy     true is for minion collision  true  for AOE / enemy champion collision
 

I see, thanks. So how do i find all that information? The missile speed, delay before cast, and the Spell Radius?

 

Also about ValidTarget, Blitzcrank's Q has 925 Range, but the number is 1000. Why is that?


  • 0

#16
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

local target = GetTarget(1000, DAMAGE_MAGIC)
     if ValidTarget(target, 1000) then

 

1000 is the range, DAMAGE_MAGIC/DAMAGE_PHYSICAL will get our current target depending on AD/AP Champ so if i'm playing Jinx i'll get Target with DAMAGE_PHYSICAL else if i play Cassio or any other AP i get target with DAMAGE_MAGIC

ValidTarget will Check if Target is Valid and not Dead/Immune and is Targetable

 

(you can find this functions in Inspired.lua)

 

 

 

for prediction it's like this :

 

local QPred = GetPredictionForPlayer(startPosition, targetUnit, targetUnitMoveSpeed, spellTravelSpeed, spellDelay, spellRange, spellWidth, collision, addHitBox)

 

so startPosition is our Hero Position for most of spells : GetMyHeroPos() will get our Position

-targetUnit is the target : you need to get a target first

-targetUnitMoveSpeed is the target move speed : GetMoveSpeed(target) will get target move speed

-spelltravelSpeed (aka projectilespeed) : you need to get it from external sources like lolwikia

-spelldelay : with milliseconds usually it's 250 for most of spells but some spells like chogath Q or Ezreal R have more delay, you still can get it from external sources

-spellRange : it's the spell max Range for example Blitz Q is 925 i think, GetCastRange(myHero, _Q) will get the spell range for Q or just put 925 if you want a custom range

-spellWidth : this is spell width, you can get it from external sources

-Collision : if it's true that means it will collide with minions for ex Blitz Q, NidaQ if you put it false it means that the spell won't collide ex ezreal R,Ekko Q

-addHitBox : i still don't know what's this, put it true by default

 

tip : local QPred can be named to what you want since it's local

Thank's for the very helpful comment i will try to use this information right now. But if blit'z range is 925 then why if ValidTarget(target, 1000) 


  • 0

#17
Deftsu

Deftsu

    donthackourgames

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

Thank's for the very helpful comment i will try to use this information right now. But if blit'z range is 925 then why if ValidTarget(target, 1000) 

 

look, i updated my code again, now it's more understandable https://github.com/D.../Blitzcrank.lua


  • 1

#18
Pazamolam

Pazamolam

    Advanced Member

  • Members
  • 35 posts

look, i updated my code again, now it's more understandable https://github.com/D.../Blitzcrank.lua

Thank's I'm getting it really fast. Two things i did not figure out:

 

same as before if ValidTarget(target, 1000) but blitz Q has 925 Range. 

 

and (55*GetCastLevel(myHero,_Q)+25+GetBonusAP(myHero))) that's on the kill steal section. I figured that the 55 states the damage growth each level of Q, but didn't understand the +25 number


  • 0

#19
Deftsu

Deftsu

    donthackourgames

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

Thank's I'm getting it really fast. Two things i did not figure out:

 

same as before if ValidTarget(target, 1000) but blitz Q has 925 Range. 

 

and (55*GetCastLevel(myHero,_Q)+25+GetBonusAP(myHero))) that's on the kill steal section. I figured that the 55 states the damage growth each level of Q, but didn't understand the +25 number

 

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


  • 0

#20
Deftsu

Deftsu

    donthackourgames

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

i don't have if ValidTarget(target , 1000) anymore, anyway it's used for more better Q, for example if we have ADC at 1000 range and support at 925 range, it will try to focus ADC in most cases if the target selector will get it


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users