maorinn / ayaya-league-external

External script platform for League of Legends

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AyayaLeague

AyayaLeagueLogo

EVERYTHING CAN CHANGE AT ANY TIME SINCE THIS IS STILL AN ALPHA VERSION

UserScripts count   GitHub last commit   Release Date   GitHub all releases

What's AyayaLeague ?

AyayaLeague is an external script platform written in nodejs that supports custom user scripts.

Features

  • Show player attack range
  • Show enemy champions attack range
  • Show enemy champions summoner spells cooldown
  • Settings window [CTRL + SPACE]
  • Show enemy champions ultimate cooldown
  • Show missiles
  • Custom user scripts (Read more here)

How to setup and run

Prebuilt version

Release Date

  1. Download prebuilt version of AyayaLeague HERE

  2. Extract the folder content

  3. Run AyayaLeague.exe as Administrator (run it from a terminal if you want to read console.log outputs)

From source code

  1. Clone the repo git clone https://github.com/botkalista/ayaya-league-external.git

  2. Install Node.js 32bit v16.10.0

    Download for Windows: https://nodejs.org/dist/v16.10.0/node-v16.10.0-x86.msi

    Download for other OS: https://nodejs.org/fa/blog/release/v16.10.0/

  3. Install windows build tools if you don't have them npm install --g --production windows-build-tools

  4. Run npm run check-dependencies to check that everything is ok and automatically build packages

  5. Enter into a league game (must be windowed or no borders)

  6. Run npm start from a terminal with Administrator privileges

  7. Enjoy :3

Set game settings

To use correctly the script you must adjust some settings inside League.

  • Set screen mode to no borders
  • Set Player Move Click to U inside Settings > Shortcuts -> Player Movement
  • Set Player Attack Only to I inside Settings > Shortcuts -> Player Movement

User Scripts

UserScripts count

Every user script is located into: /scripts/userscripts/ (on prebuilt version /resources/app/scripts/userscripts/)

AyayaLeague comes with 2 default UserScripts called SimpleEvade.js and Orbwalker.js.

How to write a script

  1. Create your script file inside the /scripts/userscripts/ folder and call it _yourscriptname_.js

  2. Write a setup function to manage initialization

    function setup() {
      console.log("Script is loaded");
    }
  3. Write a onTick function to execute actions every tick. It accepts 2 arguments: manager and ticks.

    function onTick(manager, ticks) {
      if (manager.me.spells[3].ready == true) {
        console.log("R is up");
      }
    }
  4. Write a onMissileCreate function to execute actions every time a new missile is created

    function onMissileCreate(missile, manager) {
      if (missile.isAutoAttack) console.log("Auto attack missile created");
      if (missile.isTurretShot) console.log("Turret shot missile created");
    }
  5. Optionally you can add the JSDoc before the functions to get intellisense inside visual studio code

    /**
     * @param {import("../UserScriptManager").UserScriptManager} manager
     * @param {number} ticks Ticks counter
     **/
    function onTick(manager, ticks) {
      if (manager.me.spells[3].ready == true) {
        console.log("R is up");
      }
    }
    
    /**
     * @param {import("../../src/models/Missile").Missile} missile
     * @param {import("../UserScriptManager").UserScriptManager} manager
     **/
    function onMissileCreate(missile, manager) {
      if (missile.isAutoAttack) console.log("Auto attack missile created");
      if (missile.isTurretShot) console.log("Turret shot missile created");
    }
  6. Export the functions we just created

    module.exports = { setup, onTick, onMissileCreate };
  7. Start AyayaLeague (npm run start) and enjoy your script :3

Script functions

onTick

onTick(manager: UserScriptManager, ticks:number) - Called every tick. Used to execute actions inside user scripts.

setup

setup() - Called at script load. Used to initialize the script.

onMissileCreate

onMissileCreate(missile: Missile, manager: UserScriptManager) - Called every time a new missile is created

onMoveCreate

onMoveCreate(player: Entity, manager: UserScriptManager) - Called every an enemy clicks to move

onDraw

onDraw(ctx: DrawContext, manager: UserScriptManager) - Called every frame (16ms at 60fps)

UserScriptManager

How data is read Every time a property is used it gets read from the game and cached for subsequent calls on the same tick. The manager reads the game data only if a script use that specific piece of data

properties

  • spellSlot: SpellSlot - Enum of game key codes

  • game Game - Get game informations and execute actions

  • playerState PlayerState - Get player state

  • me Entity - Get local player

  • utils ScriptUtils - Get utility functions

  • missiles Missile - Get all missiles

  • monsters Entity[] - Get all monsters

  • champions:

  • turrets:

  • minions:

methods

  • checkCollision(target:Entity, missile:Missile): CollisionResult - Checks the collision between target and missile

  • worldToScreen(pos:Vector3): Vector2 - Return pos converted to screen position

  • setPlayerState(state: PlayerState) - Set the player state

DrawContext

  • line(p1: Vector2, p2: Vector2, color?: number, thickness?: number) - Draw a line from p1 to p2 with color color and thickness thickness

  • linePoints(x1: number, y1: number, x2: number, y2: number, color?: number, thickness?: number) - Draw a line from x1 y1 to x2 y2 with color color and thickness thickness

  • circle(c: Vector3, r: number, points?: number, color?: number, thickness?: number) - Draw a circle at c of r radius with color color and thickness thickness. It automatically transform the circle from game coordinates to screen coordinates using points points to rappresent it

  • text(str: string, x: number, y: number, size: number, color?: number) - Draw str at x,y with sizee size and color color

Models

Entity

properties

  • netId number - Entity network identifier

  • name string - Entity name

  • gamePos Vector3 - Entity position relative to the game map

  • screenPos Vector3 - Entity position relative to the screen

  • hp number - Entity current health points

  • maxHp number - Entity max health points

  • visible boolean - True if the entity is outside fog of war

  • dead boolean - True if the entity is dead

  • range number - Entity attack range

  • team number - Entity team identifier (100 = Team1, 200 = Neutral, 300 = Team2)

  • spells Spell[] - Entity spells

  • AiManager AiManager - Used to check player movement

  • satHitbox - Used internally to check collisions

Spell

properties

  • name string - Spell name

  • readyAt number - Timestamp when the spell will be ready

  • level number - Spell level (always 1 for summoner spells)

  • ready boolean - True if the spell is not on cooldown

  • readyIn boolean - Seconds to wait before the spell is ready

Missile

properties

  • gameStartPos Vector3 - Missile start position relative to the game map

  • gameEndPos Vector3 - Missile end position relative to the game map

  • screenStartPos Vector3 - Missile start position relative to the screen

  • screenEndPos Vector3 - Missile end position relative to the screen

  • team number - Missile team identifier (100 = Team1, 200 = Neutral, 300 = Team2)

  • isBasicAttack boolean - True if the missile is a basic attack

  • isTurretAttack boolean - True if the missile is a turret shot

  • isMinionAttack boolean - True if the missile is a minion attack

  • spellName string - Name of the spell that created the missile

  • satHitbox - Used internally to check collisions

AiManager

properties

  • startPath Vector3 - Start position of the player movement

  • endPath Vector3 - End position of the player movement

  • isDashing boolean - True if the entity is dashing

  • isMoving boolean - True if the entity is moving

  • dashSpeed number - Speed of the dash

CollisionResult

properties

  • result boolean - True if there is a collision

  • evadeAt Vector3 - Screen position to move the player in order to dodge the missile

Game

properties

  • time number - get seconds passed after game start

methods

  • issueOrder(pos:Vector2, isAttack:boolean, delay?:boolean): void - Moves the player to pos position. If isAttack is true attacks at pos position.
    NOTE: You must set PlayerMoveClick to U and PlayerAttackOnly to I. Read more here

  • castSpell(slot:number, pos1?:Vector2, pos2?: Vector2, selfCast?:boolean): void - Cast the spell slot at pos1 if provided to pos2 if provided.
    Self cast the spell if selfCast is true.
    Use pos2 for spells like Viktor Q or Viego W.
    You can use spellSlot of UserScriptManager for slot

  • isKeyPressed(key: number): boolean - Return true if the key is pressed.
    You can get the key numbers here

  • pressKey(key: number): void- Press the key key.
    You can use spellSlot of UserScriptManager.
    (Ex: manager.spellSlot.Q)

  • release(key: number): void- Release the key key.
    You can use spellSlot of UserScriptManager.
    (Ex: manager.spellSlot.Q)

  • getMousePos(): Vector2 - Return the mouse position

  • setMousePos(x:number, y: number): void - Set the mouse position to x, y

  • blockInput(value:boolean) - If true blocks user input (keyboard+mouse), if false unlocks it.

  • sleep(ms:number) - Wait ms milliseconds synchronously

ScriptUtils

methods

  • enemyChampsInRange(range: number): Entity[] - Returns all the enemy champions inside range

  • genericInRange(list: Entity[], range: number): Entity[] - Returns all the entities of list inside range

  • lowestHealthEnemyChampInRange(range: number): Entity - Return the lowest health enemy champion inside range

  • lowestHealthGenericInRange(list:Entity[], range: number) - Return the lowest health entity of list inside range

  • predictPosition(target: Entity, castTime: number) - Returns the position of target after castTime ms if he keeps moving in the same direction

Vector2

properties

  • x number - x

  • y number - y

  • static zero Vector2 - Returns a vector with x=0 y=0

methods

  • copy(): Vector2 - Returns a copy of the vector

  • flatten(): Vector2 - Returns a copy of the vector with x, y as integer (instead of float)

  • isEqual(vec: Vector2): Vector2 - Returns true if vectors have the same x, y

  • add(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y multiplied by x, y

  • sub(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y subtracted by x, y

  • mul(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y multiplied by x, y

  • div(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y divided by x, y

  • dist(v: Vector2): number - Returns the distance between this and v

  • static fromData(x: number, y: number): Vector2 - Returns a vector with x=x y=y

Vector3

properties

  • x number - x

  • y number - y

  • z number - z

  • static zero Vector2 - Returns a vector with x=x y=y z=z

methods

  • copy(): Vector3 - Returns a copy of the vector

  • flatten(): Vector3 - Returns a copy of the vector with x, y, z as integer (instead of float)

  • isEqual:(vec: Vector3): Vector3 - Returns true if vectors have the same x, y, z

  • add(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y, z multiplied by x, y, z

  • sub(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y, z subtracted by x, y, z

  • mul(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y, z multiplied by x, y, z

  • div(x: number, y: number): Vector2 - Returns a copy of the vector with his x, y, z divided by x, y, z

  • dist(v: Vector3): number - Returns the distance between this and v

  • static fromData(x: number, y: number, z: number): Vector3 - Returns a vector with x=x y=y z=z

Enums

PlayerState

  • isCasting
  • isMoving
  • isAttacking
  • isEvading
  • isCharging
  • isChanneling
  • idle

vFAQ (very Frequently Asked Questions)

  1. Why nodejs ? it's slow.

    Fuck you. It's fast enough.

TODO

  • Add width and height of missiles
  • Use better serialization for settings

Media

Simple evade SimpleEvade.js

simple_evade.mp4

Orbwalker Test 1

Orbwalker_1.mp4

Orbwalker Test 2

Orbwalker_2.mp4

Orbwalker Test 3

Orbwalker_3.mp4

Cooldown tracker

Settings window

UserScript example

About

External script platform for League of Legends

License:GNU General Public License v3.0


Languages

Language:TypeScript 76.0%Language:JavaScript 14.2%Language:Python 5.6%Language:HTML 2.0%Language:CSS 1.2%Language:C++ 1.0%