Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
require "VPrediction" require "Collision" local farmingMode local wRange = 1535 local eRange = 900 local rRange = 50000 local castR = string.byte("R") local PredictionW = nil function PluginOnLoad() AutoCarry.SkillsCrosshair.range = 1600 PredictionW = VPrediction() Menu = AutoCarry.PluginMenu ts = TargetSelector(TARGET_LOW_HP,4000,DAMAGE_PHYSICAL, false) --Menu:addParam("ultR","ultR", SCRIPT_PARAM_ONKEYDOWN, false, 32) Menu:addParam("autoQ","Auto use Q ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("autoW","Auto use W ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("autoE","Auto use E ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("autoR","Auto use R ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("ultR","Semi-manual cast R", SCRIPT_PARAM_ONKEYDOWN, false, 32) -- space Menu:addParam("drawW","Draw helper W ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("drawE","Draw helper E ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("drawR","Draw helper R ", SCRIPT_PARAM_ONOFF, true) Menu:addParam("manaMenager","Mana menager", SCRIPT_PARAM_ONOFF, true) end function PluginOnTick() Target = AutoCarry.Crosshair:GetTarget() manaMenager() QREADY = (myHero:CanUseSpell(_Q) == READY) WREADY = (myHero:CanUseSpell(_W) == READY) EREADY = (myHero:CanUseSpell(_E) == READY) RREADY = (myHero:CanUseSpell(_R) == READY) if ( AutoCarry.Keys.MixedMode or AutoCarry.Keys.LaneClear or AutoCarry.Keys.LastHit) then farmingMode = true else farmingMode = false end bonusRange = 525 + 120 + 25 * myHero:GetSpellData(_Q).level if Target ~= nil then if QREADY then if (GetDistance(Target) > 630 or CountEnemies(Target, 130) > 1 ) and (myHero.mana > WMANA + RMANA or myHero.totalDamage * 3 > Target.health) then if AutoCarry.Keys.AutoCarry then minigunOn() elseif farmingMode and myHero.mana > WMANA + RMANA + EMANA and GetDistance(Target) < bonusRange + 150 then minigunOn() else minigunOff() end else minigunOff() end end if Menu.autoW and WREADY then wDmg = getDmg("W", Target, myHero) local CastPosition, HitChance, Position = PredictionW:GetLineCastPosition(Target, 0.6, 75, wRange, 1600, myHero, true) if not AutoCarry.Orbwalker:IsShooting() and GetDistance(Target) > 525 and wDmg > Target.health and HitChance >= 1 and GetDistance(CastPosition) < wRange then CastSpell(_W, CastPosition.x, CastPosition.z) elseif not AutoCarry.Orbwalker:IsShooting() and AutoCarry.Keys.AutoCarry and myHero.mana > WMANA + RMANA and HitChance >= 2 and CountEnemies(myHero, bonusRange) == 0 and GetDistance(CastPosition) < wRange then CastSpell(_W, CastPosition.x, CastPosition.z) elseif not AutoCarry.Orbwalker:IsShooting() and farmingMode and (myHero.mana > 2 * (WMANA + RMANA + EMANA) or HitChance >= 3) and HitChance >= 2 and CountEnemies(myHero, bonusRange) == 0 and GetDistance(CastPosition) < wRange-200 then CastSpell(_W, CastPosition.x, CastPosition.z) end end if Menu.autoE and EREADY then local CastPosition, HitChance, Position = PredictionW:GetCircularCastPosition(Target, 2, 30, eRange) local ePos = GetAoESpellPosition(350, Target, 1900) if (Target.canMove ~= true or HitChance >= 3) and GetDistance(Target) < 900 and myHero.mana > RMANA + EMANA then CastSpell(_E, CastPosition.x, CastPosition.z) end end else if AutoCarry.Keys.LaneClear and myHero.mana > myHero.maxMana * 0.9 then minigunOn() elseif myHero.mana > WMANA + RMANA and AutoCarry.Keys.AutoCarry then minigunOn() else minigunOff() end end if RREADY then ts:update() if ts.target ~= nil then local CastPosition, HitChance, Position = PredictionW:GetLineCastPosition(ts.target, 0.58, 150, rRange, 2165, myHero, false) rPredistion = CastPosition rDmg = getDmg("R", ts.target, myHero) if Menu.ultR and HitChance >= 2 then CastSpell(_R, CastPosition.x, CastPosition.z) end if Menu.autoR and rDmg > ts.target.health and GetDistance(ts.target, myHero) < 3000 then Collision:__init(rRange, 2150, 0.58, 250) PrintFloatText(player,0,ts.target.charName) PrintFloatText(ts.target,0,"KILL R") if HitChance >= 2 and GetDistance(ts.target) > bonusRange + 150 and CountAlly(ts.target, 600) == 0 and not Collision:GetHeroCollision(myHero, ts.target, HERO_ENEMY) then CastSpell(_R, CastPosition.x, CastPosition.z) end if HitChance >= 2 and CountEnemies(ts.target, 350) > 1 and rDmg * 0.9 > ts.target.health then CastSpell(_R, CastPosition.x, CastPosition.z) end if HitChance >= 1 and myHero.health < myHero.maxHealth * 0.5 and 2.6 * rDmg > ts.target.health then CastSpell(_R, CastPosition.x, CastPosition.z) end if HitChance >= 2 and ts.target.canMove ~= true and 2.6 * rDmg > ts.target.health then CastSpell(_R, CastPosition.x, CastPosition.z) end end end end end function PluginOnDraw() if Menu.drawW and Target ~= nil then wDmg = getDmg("W", Target, myHero) if wDmg > Target.health then PrintFloatText(player,0,Target.charName) PrintFloatText(Target,0,"KILL W") DrawCircleNextLvl(myHero.x, myHero.y, myHero.z, wRange) DrawLineNextLvl(myHero,Target) end if WREADY then DrawCircleNextLvl(myHero.x, myHero.y, myHero.z, wRange) end end if Menu.drawE and Target ~= nil then if Target.canMove ~= true and EREADY then PrintFloatText(player,0,Target.charName) PrintFloatText(Target,0,"STUNE E") DrawCircleNextLvl(myHero.x, myHero.y, myHero.z, eRange) end end if Menu.drawR and ts.target ~= nil and RREADY then rDmg = getDmg("R", ts.target, myHero) if rDmg > ts.target.health or Menu.ultR then DrawLineNextLvl(myHero,rPredistion) end DrawCircleNextLvl(rPredistion.x, rPredistion.y, rPredistion.z, 100) end end function manaMenager() if Menu.manaMenager then WMANA = 40 + 10 * myHero:GetSpellData(_W).level EMANA = 50 if not RREADY then RMANA = WMANA-10 else RMANA = 100 end else WMANA = 0 RMANA = 0 EMANA = 0 RMANA = 0 end end function DrawLineNextLvl(point1, point2) local points = {} local c = WorldToScreen(D3DXVECTOR3(point1.x, point1.y, point1.z )) local c2 = WorldToScreen(D3DXVECTOR3(point2.x, point2.y, point2.z )) points[1] = D3DXVECTOR2(c.x, c.y) points[2] = D3DXVECTOR2(c2.x, c2.y) DrawLines2(points, 1, 4294967295) end function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength) radius = radius or 300 quality = math.max(8,math.floor(180/math.deg((math.asin((70/(2*radius))))))) quality = 2 * math.pi / quality radius = radius*.92 local points = {} for theta = 0, 2 * math.pi + quality, quality do local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta))) points[#points + 1] = D3DXVECTOR2(c.x, c.y) end DrawLines2(points, width or 1, color or 6294967295) end function CountEnemies(point, range) local ChampCount = 0 for j = 1, heroManager.iCount, 1 do local enemyhero = heroManager:getHero(j) if myHero.team ~= enemyhero.team and enemyhero.dead ~= true then if GetDistance(enemyhero, point) <= range then ChampCount = ChampCount + 1 end end end return ChampCount end function CountAlly(point, range) local ChampCount = 0 for j = 1, heroManager.iCount, 1 do local allyhero = heroManager:getHero(j) if myHero.team == allyhero.team and allyhero.dead ~= true then if GetDistance(allyhero, point) <= range then ChampCount = ChampCount + 1 end end end return ChampCount end function minigunOff() if (farmingMode or AutoCarry.Keys.AutoCarry) and Menu.autoQ and myHero.range > 530 and not AutoCarry.Orbwalker:IsShooting() then CastSpell(_Q) end end function minigunOn() if (farmingMode or AutoCarry.Keys.AutoCarry) and Menu.autoQ and myHero.range < 530 and not AutoCarry.Orbwalker:IsShooting() then CastSpell(_Q) end end --[[ AoE_Skillshot_Position 2.0 by monogato GetAoESpellPosition(radius, main_target, [delay]) returns best position in order to catch as many enemies as possible with your AoE skillshot, making sure you get the main target. Note: You can optionally add delay in ms for prediction (VIP if avaliable, normal else). ]] function GetCenter(points) local sum_x = 0 local sum_z = 0 for i = 1, #points do sum_x = sum_x + points[i].x sum_z = sum_z + points[i].z end local center = {x = sum_x / #points, y = 0, z = sum_z / #points} return center end function ContainsThemAll(circle, points) local radius_sqr = circle.radius*circle.radius local contains_them_all = true local i = 1 while contains_them_all and i <= #points do contains_them_all = GetDistanceSqr(points[i], circle.center) <= radius_sqr i = i + 1 end return contains_them_all end -- The first element (which is gonna be main_target) is untouchable. function FarthestFromPositionIndex(points, position) local index = 2 local actual_dist_sqr local max_dist_sqr = GetDistanceSqr(points[index], position) for i = 3, #points do actual_dist_sqr = GetDistanceSqr(points[i], position) if actual_dist_sqr > max_dist_sqr then index = i max_dist_sqr = actual_dist_sqr end end return index end function RemoveWorst(targets, position) local worst_target = FarthestFromPositionIndex(targets, position) table.remove(targets, worst_target) return targets end function GetInitialTargets(radius, main_target) local targets = {main_target} local diameter_sqr = 4 * radius * radius for i=1, heroManager.iCount do target = heroManager:GetHero(i) if target.networkID ~= main_target.networkID and ValidTarget(target) and GetDistanceSqr(main_target, target) < diameter_sqr then table.insert(targets, target) end end return targets end function GetPredictedInitialTargets(radius, main_target, delay) if VIP_USER and not vip_target_predictor then vip_target_predictor = TargetPredictionVIP(nil, nil, delay/1000) end local predicted_main_target = VIP_USER and vip_target_predictor:GetPrediction(main_target) or GetPredictionPos(main_target, delay) local predicted_targets = {predicted_main_target} local diameter_sqr = 4 * radius * radius for i=1, heroManager.iCount do target = heroManager:GetHero(i) if ValidTarget(target) then predicted_target = VIP_USER and vip_target_predictor:GetPrediction(target) or GetPredictionPos(target, delay) if target.networkID ~= main_target.networkID and GetDistanceSqr(predicted_main_target, predicted_target) < diameter_sqr then table.insert(predicted_targets, predicted_target) end end end return predicted_targets end -- I don't need range since main_target is gonna be close enough. You can add it if you do. function GetAoESpellPosition(radius, main_target, delay) local targets = delay and GetPredictedInitialTargets(radius, main_target, delay) or GetInitialTargets(radius, main_target) local position = GetCenter(targets) local best_pos_found = true local circle = Circle(position, radius) circle.center = position if #targets > 2 then best_pos_found = ContainsThemAll(circle, targets) end while not best_pos_found do targets = RemoveWorst(targets, position) position = GetCenter(targets) circle.center = position best_pos_found = ContainsThemAll(circle, targets) end return position, #targets end
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
18 hours ago | 0.16 KB
settings
18 hours ago | 0.10 KB
IT & AI
1 day ago | 1.62 KB
Stationeers - Sign Tags from Power Distributi...
HTML | 1 day ago | 2.00 KB
PM: Shopify Client Edits
1 day ago | 0.19 KB
PM: Shopify Assigning Design Task 2
1 day ago | 0.14 KB
PM: Shopify Assigning Design Task 1
1 day ago | 0.32 KB
Commodore Callback 8020
2 days ago | 0.18 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!