i am new here, want study how to use lua,and write some scripts。 thanks everyone。
Login to Account Create an Account
how to get skill range and draw
#1
Posted 16 January 2017 - 02:36
#2
Posted 16 January 2017 - 02:43
check the Draw.Circle API from the api documentation for more infos on how to draw
#3
Posted 16 January 2017 - 02:52
unit:GetSpellData(slot).range
check the Draw.Circle API from the api documentation for more infos on how to draw
thankyou~
#4
Posted 16 January 2017 - 03:19
You can easily check the -official- scripts which come pre-downloaded with Loader, or you can find them here:
They can be used as a good example on what can be done and how.
http://gamingonstero...ficial-utility/
#5
Posted 17 January 2017 - 07:14
Im new to Lua and don´t know how to get the Data. I need the Data for the SpellData, and i dont know if there is an Console, or how can i print it?
#6
Posted 18 January 2017 - 01:35
Im new to Lua and don´t know how to get the Data. I need the Data for the SpellData, and i dont know if there is an Console, or how can i print it?
you need the unit you want the spell Data from and the slot of the spell, like so:
spelldata = Game.MyHero:GetSpellData(_Q)
now you have a SpellData table and you can access its elements. They are not documented in the api, so I don't know what they are. I would expect a range element at least.
to print somethin on screen just type
print([anything goes here])
#7
Posted 18 January 2017 - 04:20
now you have a SpellData table and you can access its elements. They are not documented in the api, so I don't know what they are. I would expect a range element at least.
:GetSpellData(iSlot) .name .level .castTime -- time the spell was casted last .cd .currentCd .ammo .ammoTime .ammoCd .ammoCurrentCd .toggleState .range .mana .width .speed .targetingType .coneAngle .coneDistance .acceleration .castFrame .maxSpeed .minSpeed
#8
Posted 18 January 2017 - 04:53
:GetSpellData(iSlot) .name .level .castTime -- time the spell was casted last .cd .currentCd .ammo .ammoTime .ammoCd .ammoCurrentCd .toggleState .range .mana .width .speed .targetingType .coneAngle .coneDistance .acceleration .castFrame .maxSpeed .minSpeed
That's really awesome. could you ask someone to get this into the docs, separated from GameObject api, since this is, in fact, the SpellData api?
#9
Posted 18 January 2017 - 05:10
That's really awesome. could you ask someone to get this into the docs, separated from GameObject api, since this is, in fact, the SpellData api?
It's already in the API, it's just a little hard to read.
Here, i've dumped the API so it's formatted:
MenuElement - Class
MenuElement({}) -- initial call; returns instance
possible properties of the input table:
- id = "string", can be omitted but then it will not save
- name = "string"
- type = MENU|PARAM|SPACE,BUTTON, for PARAM type can be omitted
- leftIcon = "string" [URL!], -> icon displayed on the left, 100% menu height
- rightIcon = "string" [URL!] -> automatically converts param to boolean, 50% menu height
- icon = "string" [URL!] -> icon displayed on the right, e.g. sub menu, 100% menu height
- value =
-> true|false, creates boolean param
-> number, creates slider param
-> + min = "number" + max = "number" [+ step = "number"] [+ identifier = "string"]
or
-> drop = {"string"[, "string", ...]}
-> table {"number", "number"}, creates min/max slider param
-> + min = "number" + max = "number" [+ step = "number"]
- color = "color", creates color param
-> Draw.Color(integer)
or
-> Draw.Color(hex)
or
-> Draw.Color(alpha, red, green, blue)
or
-> Draw.Color(hue, saturation, lightness)
- key = "number", creates key param
- callback = "function"
-> gets called on param change with changed value as input
- onhover = "function"
-> gets called on param hover with the param as input
- onclick = "function"
-> gets called on param click with the param as input
- tooltip = "string"
-> gets displayed on hover
instance:MenuElement({})
creates submenu
instance:Value([newVal])
-> if called without newVal it returns the current value
-> if called with newVal it'll set the current value to newVal and return it
instance:Sprite(which[, url])
-> which = "string"; "leftIcon"|"rightIcon"|"icon"
-> if called without url it returns the current sprite
-> if called with url it'll set the current sprite to that url
instance:Hide([bool])
-> if called without bool it'll toggle the hide property between true|false and return it
-> if called with bool it'll set the hide property to that value and return it
instance:Remove()
-> this will permanently remove the MenuElement
Example:
local menu = MenuElement({id = "myMenu", name = "This is my Menu", type = MENU})
menu:MenuElement({id = "bool", name = "My boolean Value", value = true})
menu:MenuElement({id = "slide", name = "My slider", value = 0.7, min = 0, max = 1, step = 0.1})
menu:MenuElement({id = "space", name = "This will get hidden on mouse click", type = SPACE, onclick = function() menu.space:Hide() end})
menu:MenuElement({type = BUTTON, id = "button", name = "My button", rightIcon = "http://wwww.example.com/button.png", callback = function() print"I have been pressed!" end})
Callback.Add("Tick", function()
PrintChat("My bool: "..tostring(menu.bool:Value()).."; My slider: "..menu.slide:Value()..";")
end)
Vector - Class
Vector(...) -- initial call; returns instance
overloads:
() => 'nullvector' => (0, 0, 0)
({x = 100, y = 100}) => (xy-table) => (100, 100)
({x = 100, y = 0, z = 100}) => (xyz-table) => (100, 0, 100)
(100, 0, 100) => (number, number, number) => (100, 0, 100)
({x = 0, y = 50, z = 75}, {x = 100, y = 100, z = 100}) => (startVec, endVec) => (100, 50, 25)
properties:
.x -- the x value
.y -- the y value
.z -- the z value
.onScreen -- for 2D vectors
functions:
:To2D() -- returns screenpos from Vector3 (alias ToScreen)
:Clone() -- returns a new vector
:Unpack() -- returns x, y, z
:DistanceTo(Vector) -- returns distance to another vector or, if ommited, myHero
:Len() -- returns length
:Len2() -- returns squared length
:Normalize() -- normalizes a vector
:Normalized() -- creates a new vector, normalizes it and returns it
:Center(Vector) -- center between 2 vectors
:CrossProduct(Vector) -- cross product of 2 vectors (alias: CrossP)
:DotProduct(Vector) -- dot product of 2 vectors (alias: DotP)
:ProjectOn(Vector) -- projects a vector on a vector
:MirrorOn(Vector) -- mirrors a vector on a vector
:Sin(Vector) -- calculates sin of 2 vector
:Cos(Vector) -- calculates cos of 2 vector
:Angle(Vector) -- calculates angle between 2 vectors
:AffineArea(Vector) -- calculates area between 2 vectors
:TriangleArea(Vector) -- calculates triangular area between 2 vectors
:RotateX(phi) -- rotates vector by phi around x axis
:RotateY(phi) -- rotates vector by phi around y axis
:RotateZ(phi) -- rotates vector by phi around z axis
:Rotate(phiX, phiY, phiZ) -- rotates vector
:Rotated(phiX, phiY, phiZ) -- creates a new vector, rotates it and returns it
:Polar() -- returns polar value
:AngleBetween(Vector, Vector) -- returns the angle formed from a vector to both input vectors
:Compare(Vector) -- compares both vectors, returns difference
:Perpendicular() -- creates a new vector that is rotated 90° right
:Perpendicular2() -- creates a new vector that is rotated 90° left
:Extend(Vector, distance) -- extends a vector towards a vector
:Extended(Vector, distance) -- creates a new vector, extends it and returns it
:Shorten(Vector, distance) -- shortens a vector towards a vector
:Shortened(Vector, distance) -- creates a new vector, shortens it and returns it
:Lerp(Vector, delta) -- creates a new vector, lerps it towards vector by delta
Sprite - Class
Sprite(path)
overloads:
Sprite(path, scale)
Sprite(path, scaleX, scaleY)
properties (READ-ONLY):
.x -- the x value
.y -- the y value
.pos -- Vector2
.path -- file path
.width -- the width
.height -- the height
.scale -- the scale
.color -- the color
functions:
:Draw() -- draws the sprite at .pos
:Draw(Vector2) -- draws the sprite at Vector2
:Draw(x, y) -- draws the sprite at x y
:Draw({x, y, w, h}, Vector2) -- draws a rectangle of the sprite at Vector2
:Draw({x, y, w, h}, x, y) -- draws a rectangle of the sprite at x y
:SetScale(scale) -- sets a sprite's scale
:SetScale(scaleX, scaleY) -- sets a sprite's scale
:SetPos(Vector2) -- sets a sprite's pos
:SetPos(x, y) -- sets a sprite's pos
:SetColor(Color) -- sets a sprite's color
GameObject
-- not callable by user
properties:
.networkID
.handle -- use for missile owner/target check
.chnd --use for camp handle
.buffCount
.isMe
.isAlly
.isEnemy
.team
.owner
.targetID --Turret Target
.type
.name
.charName
.health
.maxHealth
.mana
.maxMana
.shieldAD
.shieldAP
.cdr
.armorPen
.armorPenPercent
.bonusArmorPenPercent
.magicPen
.magicPenPercent
.baseDamage
.bonusDamage
.totalDamage
.ap
.lifeSteal
.spellVamp
.attackSpeed
.critChance
.armor
.bonusArmor
.magicResist
.bonusMagicResist
.hpRegen
.mpRegen
.ms
.range
.boundingRadius
.gold
.totalGold
.dead
.visible
.isTargetable
.distance
.pos
.posTo
.pos2D
.posMM
.dir
.isCampUp -- for camps only
.valid -- for units only
.attackData -- for units only
.state -- STATE_UNKNOWN, STATE_ATTACK, STATE_WINDUP, STATE_WINDDOWN
.windUpTime
.windDownTime
.animationTime
.endTime
.castFrame
.projectileSpeed
.target -- GameObject handle
.levelData -- for heroes only
.exp
.lvl
.lvlPts
.missileData -- for missiles only
.name -- string
.owner -- GameObject handle
.target -- GameObject handle
.startPos -- Vector
.endPos -- Vector
.placementPos -- Vector
.range
.delay
.speed
.width
.manaCost
.bonusDamagePercent -- for minions only
.flatDamageReduction -- for minions only
functions: -- for units only
:GetSpellData(iSlot)
.name
.level
.castTime -- time the spell was casted last
.cd
.currentCd
.ammo
.ammoTime
.ammoCd
.ammoCurrentCd
.toggleState
.range
.mana
.width
.speed
.targetingType
.coneAngle
.coneDistance
.acceleration
.castFrame
.maxSpeed
.minSpeed
:GetItemData(index)
.itemID
.stacks
.ammo
:GetBuff(index)
.type
.name
.startTime
.expireTime
.duration
.stacks
.count
.sourcenID
.sourceName
:GetPrediction(speed,delay) --Vector
.x
.y
.z
:GetCollision(width,speed,delay)
number --Collision Count
:IsValidTarget(range,team check,source or pos)
Draw API: {
Circle = Draws a 3D Circle; Input: (x, y, z)
Circle = Draws a 3D Circle; Input: (x, y, z, Color)
Circle = Draws a 3D Circle; Input: (x, y, z, radius)
Circle = Draws a 3D Circle; Input: (x, y, z, radius, Color)
Circle = Draws a 3D Circle; Input: (x, y, z, radius, width)
Circle = Draws a 3D Circle; Input: (x, y, z, radius, width, Color)
Circle = Draws a 3D Circle; Input: (Vector3)
Circle = Draws a 3D Circle; Input: (Vector3, Color)
Circle = Draws a 3D Circle; Input: (Vector3, radius)
Circle = Draws a 3D Circle; Input: (Vector3, radius, Color)
Circle = Draws a 3D Circle; Input: (Vector3, radius, width)
Circle = Draws a 3D Circle; Input: (Vector3, radius, width, Color)
CircleMinimap = Draws a 2D Circle; Input: (x, y, z)
CircleMinimap = Draws a 2D Circle; Input: (x, y, z, Color)
CircleMinimap = Draws a 2D Circle; Input: (x, y, z, radius)
CircleMinimap = Draws a 2D Circle; Input: (x, y, z, radius, Color)
CircleMinimap = Draws a 2D Circle; Input: (x, y, z, radius, width)
CircleMinimap = Draws a 2D Circle; Input: (x, y, z, radius, width, Color)
CircleMinimap = Draws a 2D Circle; Input: (Vector3)
CircleMinimap = Draws a 2D Circle; Input: (Vector3, Color)
CircleMinimap = Draws a 2D Circle; Input: (Vector3, radius)
CircleMinimap = Draws a 2D Circle; Input: (Vector3, radius, Color)
CircleMinimap = Draws a 2D Circle; Input: (Vector3, radius, width)
CircleMinimap = Draws a 2D Circle; Input: (Vector3, radius, width, Color)
Rect = Draws a 2D Rectangle; Input: (x, y, width, height)
Rect = Draws a 2D Rectangle; Input: (x, y, width, height, Color)
Rect = Draws a 2D Rectangle; Input: (Vector2, width, height)
Rect = Draws a 2D Rectangle; Input: (Vector2, width, height, Color)
Line = Draws a 2D Line; Input: (x1, y1, x2, y2)
Line = Draws a 2D Line; Input: (x1, y1, x2, y2, Color)
Line = Draws a 2D Line; Input: (x1, y1, x2, y2, width)
Line = Draws a 2D Line; Input: (x1, y1, x2, y2, width, Color)
Line = Draws a 2D Line; Input: (Vector2, x2, y2)
Line = Draws a 2D Line; Input: (Vector2, x2, y2, Color)
Line = Draws a 2D Line; Input: (Vector2, x2, y2, width)
Line = Draws a 2D Line; Input: (Vector2, x2, y2, width, Color)
Line = Draws a 2D Line; Input: (x1, y1, Vector2)
Line = Draws a 2D Line; Input: (x1, y1, Vector2, Color)
Line = Draws a 2D Line; Input: (x1, y1, Vector2, width)
Line = Draws a 2D Line; Input: (x1, y1, Vector2, width, Color)
Line = Draws a 2D Line; Input: (Vector2, Vector2)
Line = Draws a 2D Line; Input: (Vector2, Vector2, Color)
Line = Draws a 2D Line; Input: (Vector2, Vector2, width)
Line = Draws a 2D Line; Input: (Vector2, Vector2, width, Color)
Color = Creates a drawable Color; Input: (a, r, g, b); Returns Color
Color = Creates a drawable Color; Input: (hex); Returns Color
Color = Creates a drawable Color; Input: (unsigned); Returns Color
Color = Creates a drawable Color; Input: (h, s, l); Returns Color
Color = Creates a drawable Color; Input: (); Returns Color
Default Color is White.
Text = Draws a 2D Text; Input: (text, x, y)
Text = Draws a 2D Text; Input: (text, size, x, y)
Text = Draws a 2D Text; Input: (text, size, x, y, Color)
Text = Draws a 2D Text; Input: (text, size, x, y, Color, Font)
Text = Draws a 2D Text; Input: (text, Vector2)
Text = Draws a 2D Text; Input: (text, size, Vector2)
Text = Draws a 2D Text; Input: (text, size, Vector2, Color)
Text = Draws a 2D Text; Input: (text, size, Vector2, Color, Font)
Font = Creates a drawable Font; Input: (path, fontName)
FontRect = Gets a Font Rectangle; Input: (text, fontSize); Return {width, height}
FontRect = Gets a Font Rectangle; Input: (text, fontSize, Font); Return {width, height}
}
Control API: {
CastSpell = Executes a keystroke; Input: (char | byte)
CastSpell = Executes a keystroke; Input: (char | byte, GameObject)
CastSpell = Executes a keystroke and moves mouse; Input: (char | byte, x, y) --screen position
CastSpell = Executes a keystroke and moves mouse; Input: (char | byte, x, y, z)
CastSpell = Executes a keystroke and moves mouse; Input: (char | byte, Vector3)
Move = Sends a move command towards mousePos; Input: none
Move = Sends a move command; Input: (x, y) --screen position
Move = Sends a move command; Input: (x, y, z)
Move = Sends a move command; Input: (Vector3)
Attack = Sends an attack command; Input: (GameObject)
IsKeyDown = Check for a key being held down; Input: none; Return bool
SetCursorPos = Sets the cursor position; Input: (Object | Vector3 | Vector2 | x, y) Return: bool
KeyDown = Holds down a keystroke; Input: (char | byte) Return: bool
KeyUp = Releases up a keystroke; Input: (char | byte) Return: bool
mouse_event = Sends a mouse click (down or up, depending on flag); Input: (byte) Return: bool
}
Game API: {
MyHero = Input none; Returns myHero
Resolution = Input none; Returns Resolution as Vector
FPS = Input none; Returns the total FPS
IsOnTop = Input none; Return true/false if Game is on top
IsChatOpen = Input none; Return true/false if chat is open
Timer = Input none; Return the Game Timer
mapID = The current map ID
HeroCount = Input none; Return the total Hero Count
Hero = Input (index); Return the Hero at index
ObjectCount = Input none; Return the total Object Count
Object = Input (index); Return the Object at index
HeroCount = Input none; Return the total Hero Count
Hero = Input (index); Return the Hero at index
CampCount = Input none; Return the total Camp Count
Camp = Input (index); Return the Camp at index
TurretCount = Input none; Return the total Turret Count
Turret = Input (index); Return the Turret at index
MissileCount = Input none; Return the total Object Count
Missile = Input (index); Return the Object at index
ParticleCount = Input none; Return the total Object Count
Particle = Input (index); Return the Object at index
MinionCount = Input none; Return the total Minion Count
Minion = Input (index); Return the Minion at index
WardCount = Input none; Return the total Wards Count
Ward = Input (index); Return the Wards at index
ObjectCount = Input none; Return the total Object Count
Object = Input (index); Return the Object at index
GetObjectByNetID(networkID); returns the object with the networkID requested
}
Callback API: {
Add = Adds a new Callback; Input: (iType, function); Return: callbackID
Del = Deletes a callback, Input: (iType, callbackID)
}
iTypes: {
"Load",
"UnLoad",
"GameEnd",
"Tick",
"Draw",
"WndMsg", -- (msg, wParam)
"ProcessRecall" -- (unit, proc)
}
Global Constants:
SCRIPT_PATH
COMMON_PATH
SPRITE_PATH
SOUNDS_PATH
FONTS_PATH
WM_MOUSEHWHEEL
WM_MBUTTONUP
WM_MBUTTONDOWN
WM_RBUTTONUP
WM_RBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDOWN
KEY_UP
KEY_DOWN
CRYSTAL_SCAR
TWISTED_TREELINE
SUMMONERS_RIFT
HOWLING_ABYSS
STATE_UNKNOWN
STATE_ATTACK
STATE_WINDUP
STATE_WINDDOWN
_Q
_W
_E
_R
ITEM_1
ITEM_2
ITEM_3
ITEM_4
ITEM_5
ITEM_6
ITEM_7 --(trinket)
SUMMONER_1
SUMMONER_2
HK_Q
HK_W
HK_E
HK_R
HK_ITEM_1
HK_ITEM_2
HK_ITEM_3
HK_ITEM_4
HK_ITEM_5
HK_ITEM_6
HK_ITEM_7 --(trinket)
HK_SUMMONER_1
HK_SUMMONER_2
HK_TCO -- Target Champions Only
HK_LUS -- Level Up Spell Hotkey
MOUSEEVENTF_LEFTDOWN --used by mouse_event
MOUSEEVENTF_LEFTUP
MOUSEEVENTF_RIGHTDOWN
MOUSEEVENTF_RIGHTUP
Obj_AI_SpawnPoint
Obj_AI_Camp
Obj_AI_Barracks
Obj_AI_Hero
Obj_AI_Minion
Obj_AI_Turret
Obj_AI_LineMissle
Obj_AI_Shop
cursorPos (Vector2)
mousePos (Vector3)
myHero (GameObject)
Global Functions:
GetTickCount()
GetImageInfoFromFile(path)
PrintChat(message) -- prints one string
print(...) -- prints everything
DumpDocumentation(path) -- writes this text to a file
#10
Posted 18 January 2017 - 03:39
Okay thanks :3
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Sign In
Create Account

Back to top
Report








