Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

Need suggestions about my spell cast logic


  • Please log in to reply
7 replies to this topic

#1
Zaloopa

Zaloopa

    Member

  • Members
  • 16 posts

Hi, everyone.

 

I'm new here. And new with lua.

Some time ago I was writing few scripts for another platform. And now after a brake I ended up here.  KappaRoss

Seems like GoS Ext overall is the best choice of all current alternative and I think I could spend some time here learning and making some stuff also.

 

I've started to recreate my old Ryze script. So on I've figured out how to initialize spells and how to cast them using ExternalPrediction, but encountered one problem. Code Below:

function Ryze:Combo ()
  local target = GOS:GetTarget (Q.range)
  if target == nil then return end
  
  if menu.combo.q:Value () and Game.CanUseSpell (_Q) == 0 then
    local qPred = Prediction:SetSpell (Q, TYPE_LINE, true)
    local prediction = qPred:GetPrediction (target, myHero.pos)
	
    if prediction and prediction.hitChance >= 0.5 and prediction:mCollision () == 0 and prediction:hCollision () == 0 then
      Control.CastSpell (HK_Q, prediction.castPos)
    end
  end
end

Sometimes it casts Q in random direction. Are there any inaccuracies in my code or miscalculations are going from the prediction?

Any help appreciated.  :godbless:


  • 0

#2
therealplayer

therealplayer

    Newbie

  • Members
  • 6 posts

Hi, everyone.

 

I'm new here. And new with lua.

Some time ago I was writing few scripts for another platform. And now after a brake I ended up here.  KappaRoss

Seems like GoS Ext overall is the best choice of all current alternative and I think I could spend some time here learning and making some stuff also.

 

I've started to recreate my old Ryze script. So on I've figured out how to initialize spells and how to cast them using ExternalPrediction, but encountered one problem. Code Below:

function Ryze:Combo ()
  local target = GOS:GetTarget (Q.range)
  if target == nil then return end
  
  if menu.combo.q:Value () and Game.CanUseSpell (_Q) == 0 then
    local qPred = Prediction:SetSpell (Q, TYPE_LINE, true)
    local prediction = qPred:GetPrediction (target, myHero.pos)
	
    if prediction and prediction.hitChance >= 0.5 and prediction:mCollision () == 0 and prediction:hCollision () == 0 then
      Control.CastSpell (HK_Q, prediction.castPos)
    end
  end
end

Sometimes it casts Q in random direction. Are there any inaccuracies in my code or miscalculations are going from the prediction?

Any help appreciated.  :godbless:

Actually, with an ezreal script I was using yesterday it was firing Qs in random directions too. I think it might be the prediction.


  • 0

#3
rorshaack

rorshaack

    Advanced Member

  • Members
  • 55 posts

Actually, with an ezreal script I was using yesterday it was firing Qs in random directions too. I think it might be the prediction.

 

With a Thresh script too.


  • 0

#4
Zaloopa

Zaloopa

    Member

  • Members
  • 16 posts

Actually, with an ezreal script I was using yesterday it was firing Qs in random directions too. I think it might be the prediction.


With a Thresh script too.


I'm wondering if it is possible to rewrite some things to get proper calculations. I should test some stuff today later on.
  • 0

#5
iSaga

iSaga

    Advanced Member

  • Trial Developer
  • 559 posts
Play with your delays. Orbwalker overrides spell usage and evade as well.
  • 1

#6
Zaloopa

Zaloopa

    Member

  • Members
  • 16 posts

Play with your delays. Orbwalker overrides spell usage and evade as well.

Thanks for good suggestion. I'll look into it.


  • 0

#7
RMAN

RMAN

    Advanced Member

  • Contributor
  • 523 posts

UX-wise:

 -Disable "QuickCast with Indicators", EXT works best with "QuickCast".

 

Code-wise:

 -Check if castPos is onScreen before casting. If the predicted position is outside of the screen you cant click on it, can you? :P

 -Control.CastSpell() is bad, try using a custom cast method.

 -Please dont use spaces between function name and args, doesnt change anything but looks ugly af on lua [function Ryze:Combo(), etc]

 

-------------------------

Good work and Good luck!


  • 1

#8
Zaloopa

Zaloopa

    Member

  • Members
  • 16 posts

UX-wise:

 -Disable "QuickCast with Indicators", EXT works best with "QuickCast".

 

Code-wise:

 -Check if castPos is onScreen before casting. If the predicted position is outside of the screen you cant click on it, can you? :P

 -Control.CastSpell() is bad, try using a custom cast method.

 -Please dont use spaces between function name and args, doesnt change anything but looks ugly af on lua [function Ryze:Combo(), etc]

 

-------------------------

Good work and Good luck!

- QuickCast already enabled.

 

- Sounds logical.  :D

- Oh. Alright, should try to make one then.

- The habit of C#  :lul:

 

Thanks for your advices. Very helpful.


  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users