Libs, do nothing if no Script handle them
Utility Scripts work alone.
Libs: Wallfunction/MapPos, FaceDetection, CreepBlock, MinionCollision, IsBetween
Download: https://github.com/M.../Common/Utility
--[Wall Functions]--
1. How to Draw the Walls (needed for Debug or fun)
Spoiler
2. Installation (GOS automatically installs the files, but if u need them somehow...)
Spoiler
Put all the files:
NOTE: Bushes and Walls files get created at first start, this will take 10seconds. after that have fun forever.
Put all the files:
- MapPosition.lua
- MapPositionGOS.lua
- 2DGeometry.lua
NOTE: Bushes and Walls files get created at first start, this will take 10seconds. after that have fun forever.
3. How to use the Lib
Spoiler
------------------------------------------------------WALL (working on all Maps)------------------------------------------------------
-Its very simple, if u want a Script to use the Wall Lib simply write a require 'MapPositionGOS' at first lines (where ur other required Libs are, if u have any)
-If u want to check a Position for inWall do the following Check:
if MapPosition:inWall(POSITION) then
...
end
-POSITION have to be a Point with x,y,z coordinates, example: MapPosition:inWall(Point(WPred.PredPos.x, WPred.PredPos.y, WPred.PredPos.z))
-if the Point/Position is inWall the function returns true
------------------------------------------------------BUSH (currently SR only)------------------------------------------------------
-Its very simple, if u want a Script to use the Wall Lib simply write a require 'MapPositionGOS' at first lines (where ur other required Libs are, if u have any)
if MapPosition:inBush(POSITION) then
...
end
-POSITION have to be a Point with x,y,z coordinates, example: MapPosition:inBush(Point(myHero.x, myHero.y, myHero,z))
-If the Point/Position is inBush the function returns true
------------------------------------------------------LANE (currently SR only)------------------------------------------------------
-Its very simple, if u want a Script to use the Wall Lib simply write a require 'MapPositionGOS' at first lines (where ur other required Libs are, if u have any)
if MapPosition:xyz(POSITION) then
...
end
-POSITION have to be a Point with x,y,z coordinates, example: MapPosition:inRiver(Point(myHero.x, myHero.y, myHero,z))
-If the Point/Position is inRIver the function returns true
replace xyz by:
All the credits are in the .lua files i just made them usable for GOS and updated them.
------------------------------------------------------WALL (working on all Maps)------------------------------------------------------
-Its very simple, if u want a Script to use the Wall Lib simply write a require 'MapPositionGOS' at first lines (where ur other required Libs are, if u have any)
-If u want to check a Position for inWall do the following Check:
if MapPosition:inWall(POSITION) then
...
end
-POSITION have to be a Point with x,y,z coordinates, example: MapPosition:inWall(Point(WPred.PredPos.x, WPred.PredPos.y, WPred.PredPos.z))
-if the Point/Position is inWall the function returns true
------------------------------------------------------BUSH (currently SR only)------------------------------------------------------
-Its very simple, if u want a Script to use the Wall Lib simply write a require 'MapPositionGOS' at first lines (where ur other required Libs are, if u have any)
if MapPosition:inBush(POSITION) then
...
end
-POSITION have to be a Point with x,y,z coordinates, example: MapPosition:inBush(Point(myHero.x, myHero.y, myHero,z))
-If the Point/Position is inBush the function returns true
------------------------------------------------------LANE (currently SR only)------------------------------------------------------
-Its very simple, if u want a Script to use the Wall Lib simply write a require 'MapPositionGOS' at first lines (where ur other required Libs are, if u have any)
if MapPosition:xyz(POSITION) then
...
end
-POSITION have to be a Point with x,y,z coordinates, example: MapPosition:inRiver(Point(myHero.x, myHero.y, myHero,z))
-If the Point/Position is inRIver the function returns true
replace xyz by:
Spoiler
-- River Positions --------------------------------------------------------
MapPosition:inRiver(unit)
MapPosition:inTopRiver(unit)
MapPosition:inTopInnerRiver(unit)
MapPosition:inTopOuterRiver(unit)
MapPosition:inBottomRiver(unit)
MapPosition:inBottomInnerRiver(unit)
MapPosition:inBottomOuterRiver(unit)
MapPosition:inOuterRiver(unit)
MapPosition:inInnerRiver(unit)
-- Base Positions ---------------------------------------------------------
MapPosition:inBase(unit)
MapPosition:inLeftBase(unit)
MapPosition:inRightBase(unit)
-- Lane Positions ---------------------------------------------------------
MapPosition:onLane(unit)
MapPosition:onTopLane(unit)
MapPosition:onMidLane(unit)
MapPosition:onBotLane(unit)
-- Jungle Positions -------------------------------------------------------
MapPosition:inJungle(unit)
MapPosition:inOuterJungle(unit)
MapPosition:inInnerJungle(unit)
MapPosition:inLeftJungle(unit)
MapPosition:inLeftOuterJungle(unit)
MapPosition:inLeftInnerJungle(unit)
MapPosition:inTopLeftJungle(unit)
MapPosition:inTopLeftOuterJungle(unit)
MapPosition:inTopLeftInnerJungle(unit)
MapPosition:inBottomLeftJungle(unit)
MapPosition:inBottomLeftOuterJungle(unit)
MapPosition:inBottomLeftInnerJungle(unit)
MapPosition:inRightJungle(unit)
MapPosition:inRightOuterJungle(unit)
MapPosition:inRightInnerJungle(unit)
MapPosition:inTopRightJungle(unit)
MapPosition:inTopRightOuterJungle(unit)
MapPosition:inTopRightInnerJungle(unit)
MapPosition:inBottomRightJungle(unit)
MapPosition:inBottomRightOuterJungle(unit)
MapPosition:inBottomRightInnerJungle(unit)
MapPosition:inTopJungle(unit)
MapPosition:inTopOuterJungle(unit)
MapPosition:inTopInnerJungle(unit)
MapPosition:inBottomJungle(unit)
MapPosition:inBottomOuterJungle(unit)
MapPosition:inBottomInnerJungle(unit)
-- River Positions --------------------------------------------------------
MapPosition:inRiver(unit)
MapPosition:inTopRiver(unit)
MapPosition:inTopInnerRiver(unit)
MapPosition:inTopOuterRiver(unit)
MapPosition:inBottomRiver(unit)
MapPosition:inBottomInnerRiver(unit)
MapPosition:inBottomOuterRiver(unit)
MapPosition:inOuterRiver(unit)
MapPosition:inInnerRiver(unit)
-- Base Positions ---------------------------------------------------------
MapPosition:inBase(unit)
MapPosition:inLeftBase(unit)
MapPosition:inRightBase(unit)
-- Lane Positions ---------------------------------------------------------
MapPosition:onLane(unit)
MapPosition:onTopLane(unit)
MapPosition:onMidLane(unit)
MapPosition:onBotLane(unit)
-- Jungle Positions -------------------------------------------------------
MapPosition:inJungle(unit)
MapPosition:inOuterJungle(unit)
MapPosition:inInnerJungle(unit)
MapPosition:inLeftJungle(unit)
MapPosition:inLeftOuterJungle(unit)
MapPosition:inLeftInnerJungle(unit)
MapPosition:inTopLeftJungle(unit)
MapPosition:inTopLeftOuterJungle(unit)
MapPosition:inTopLeftInnerJungle(unit)
MapPosition:inBottomLeftJungle(unit)
MapPosition:inBottomLeftOuterJungle(unit)
MapPosition:inBottomLeftInnerJungle(unit)
MapPosition:inRightJungle(unit)
MapPosition:inRightOuterJungle(unit)
MapPosition:inRightInnerJungle(unit)
MapPosition:inTopRightJungle(unit)
MapPosition:inTopRightOuterJungle(unit)
MapPosition:inTopRightInnerJungle(unit)
MapPosition:inBottomRightJungle(unit)
MapPosition:inBottomRightOuterJungle(unit)
MapPosition:inBottomRightInnerJungle(unit)
MapPosition:inTopJungle(unit)
MapPosition:inTopOuterJungle(unit)
MapPosition:inTopInnerJungle(unit)
MapPosition:inBottomJungle(unit)
MapPosition:inBottomOuterJungle(unit)
MapPosition:inBottomInnerJungle(unit)
All the credits are in the .lua files i just made them usable for GOS and updated them.
--[Face Detection]--
1. Installation
Spoiler
place the IsFacing.lua in common
place the IsFacing.lua in common
2. How to use
Spoiler
-Its very simple, if u want a Script to use the IsFacing Lib simply write a require 'IsFacing' at first lines (where ur other required Libs are, if u have any)
if IsFacing(targetFace,range,unit) then
...
end
-targetFace, the one u want to check if he is facing unit
-unit, the one who get faced by targetFace, if not set it will automatically be myHero
-range, then range in which u want to check for facing, if not set it will automatically be 99999
--> returns true if targetFace is facing UNIT in given RANGE
-Its very simple, if u want a Script to use the IsFacing Lib simply write a require 'IsFacing' at first lines (where ur other required Libs are, if u have any)
if IsFacing(targetFace,range,unit) then
...
end
-targetFace, the one u want to check if he is facing unit
-unit, the one who get faced by targetFace, if not set it will automatically be myHero
-range, then range in which u want to check for facing, if not set it will automatically be 99999
--> returns true if targetFace is facing UNIT in given RANGE
--[CreepBlock]--
1. Installation
Spoiler
place the CreepBlock.lua in your common folder
place the CreepBlock.lua in your common folder
2. How to use
Spoiler
-Its very simple, if u want a Script to use the CreepBlock Lib simply write a require 'CreepBlock' at first lines (where ur other required Libs are, if u have any)
if CreepBlock(x,y,z,width) == value then
...
end
-x,y,z are the coordinates of the position u want to check
-width is the radius of the point in center of x,y,z
-value have to be either 1 for block or 0 for no block
-Example:
if CreepBlock(WPred.PredPos.x, WPred.PredPos.y, WPred.PredPos.z, 100) == 1 then
..
end
This means if there is a creep or wall at the point WPred.PredPos in given radius 100 then execute the inner function ...
-Its very simple, if u want a Script to use the CreepBlock Lib simply write a require 'CreepBlock' at first lines (where ur other required Libs are, if u have any)
if CreepBlock(x,y,z,width) == value then
...
end
-x,y,z are the coordinates of the position u want to check
-width is the radius of the point in center of x,y,z
-value have to be either 1 for block or 0 for no block
-Example:
if CreepBlock(WPred.PredPos.x, WPred.PredPos.y, WPred.PredPos.z, 100) == 1 then
..
end
This means if there is a creep or wall at the point WPred.PredPos in given radius 100 then execute the inner function ...
--Minion Collision--
1. Installation
Spoiler
place Collision.lua in your common folder
place Collision.lua in your common folder
2. How to Use
Spoiler
-Its very simple, if u want a Script to use the Collision Lib simply write a require 'Collision' at first lines (where ur other required Libs are, if u have any)
-Set for every spell u want to check:
"name" = Collision(range,projSpeed,delay,width)
example: SpellQ = Collision(2000,1800,250,70)
-to Check the spell for Collision and even colliding Minions use this:
Param1, Param2 = "name":__GetMinionCollision(from,to,type)
-from is the spell caster
-to is the end Position/target
-type is the kind of objects u want to check for collision (ALLY, ALL, ENEMY)
--> returns Param1 (true/false), Param2(ListOfObjects)
example: OK, Objects = SpellQ:__GetMinionCollision(myHero,target,ENEMY)
--> returns if there is a Collision OK (true/false)
--> if there is a Collison returns all Objects (table)
-To check the colliding units simply do
for i, object in ipairs(Param2) do
...
end
Example Script (outdated):
NOTE if u want to check collision between myHero and mousePos or any other point and not unit do this:
example: Param1, Param2 = "name":__GetMinionCollision(myHero,Point(X,Z),type)
where X and Z is your coordinate to check.
-Its very simple, if u want a Script to use the Collision Lib simply write a require 'Collision' at first lines (where ur other required Libs are, if u have any)
-Set for every spell u want to check:
"name" = Collision(range,projSpeed,delay,width)
example: SpellQ = Collision(2000,1800,250,70)
-to Check the spell for Collision and even colliding Minions use this:
Param1, Param2 = "name":__GetMinionCollision(from,to,type)
-from is the spell caster
-to is the end Position/target
-type is the kind of objects u want to check for collision (ALLY, ALL, ENEMY)
--> returns Param1 (true/false), Param2(ListOfObjects)
example: OK, Objects = SpellQ:__GetMinionCollision(myHero,target,ENEMY)
--> returns if there is a Collision OK (true/false)
--> if there is a Collison returns all Objects (table)
-To check the colliding units simply do
for i, object in ipairs(Param2) do
...
end
Example Script (outdated):
Spoiler
local myHero = GetMyHero()
local target
OnLoop(function(myHero)
local mousePos = GetMousePos()
SpellQ = Collision(2000,1800,250,70)
target = GetCurrentTarget()
DrawCircle(GetOrigin(myHero),2000,0,0,0xffff0000)
if target and ValidTarget(target) then
if GetDistance(target)<=2000 then
OK, Objects = SpellQ:__GetMinionCollision(myHero,target,ENEMY)
if OK then PrintChat("blocked")
for i, object in ipairs(Objects) do
DrawCircle(GetOrigin(object),50,0,0,0xffff0000)
end
end
end
end
end)
local myHero = GetMyHero()
local target
OnLoop(function(myHero)
local mousePos = GetMousePos()
SpellQ = Collision(2000,1800,250,70)
target = GetCurrentTarget()
DrawCircle(GetOrigin(myHero),2000,0,0,0xffff0000)
if target and ValidTarget(target) then
if GetDistance(target)<=2000 then
OK, Objects = SpellQ:__GetMinionCollision(myHero,target,ENEMY)
if OK then PrintChat("blocked")
for i, object in ipairs(Objects) do
DrawCircle(GetOrigin(object),50,0,0,0xffff0000)
end
end
end
end
end)
NOTE if u want to check collision between myHero and mousePos or any other point and not unit do this:
example: Param1, Param2 = "name":__GetMinionCollision(myHero,Point(X,Z),type)
where X and Z is your coordinate to check.
CREDITS: All Credits are given in the Script itself.
but... TY Valdorian