abcz1114 / ayaya-league-external

External script platform for League of Legends

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AyayaLeague [ayaya-league-external]

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

WHY THE CIRCLES ARE LAGGING IN GAME ?

You should set the readTime from the settings window to a lower value and click update (That's the number of ms to wait for each tick)

read_time

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] (shortcut sometimes doesn't word while League is focused)
  • Show enemy champions ultimate cooldown
  • Show missiles (fixed length for now)
  • Custom user scripts (Read more here)

How to setup and run

Prebuilt version

  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

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

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

  • 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

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

Vector2

properties

  • x number - x

  • y number - y

methods

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

  • getFlat(): 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

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

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

  • static fromVector(v: Vector2): Vector2 - Returns a copy of the vector 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

methods

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

  • getFlat(): 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

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

  • static zero(): Vector3 - returns a vector with x=0 y=0 z=0

  • static fromVector(v: Vector3): Vector3 - Returns a copy of the vector 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


Languages

Language:TypeScript 68.5%Language:JavaScript 17.6%Language:Python 8.9%Language:HTML 2.6%Language:C++ 1.6%Language:CSS 0.7%