Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Trying but failing. Script for Ryze - League of Legends.



  • Please log in to reply
9 replies to this topic
Menteroth
  • Members
  • 23 posts
  • Last active: Oct 24 2014 05:24 PM
  • Joined: 27 Apr 2013

I am very new to AutoHotkey and just wanted to try a combo script for Ryze with his spells.

 

!d::
{
    Send {q down}
    Sleep 100
    Send {q up}
    Sleep 100
    Send {w down}
    Sleep 100
    Send {w up}
    Sleep 100
    Send {e down}
    Sleep 100
    Send {e up}
}
return

 

I want to use all three of his spells really quick. QWE.

but this doesn't work.

it works fine when I open chat and press ALT-D, it sends the keypresses/letters fine but not otherwise.

 

I'm also using smartcast, which means I just need to have cursor on top of target and then hit the key for whatever spell I want to use. but no luck getting it to work.



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013

Run as administrator, perhaps?, or could it be you'e in full screen mode? could be you need a different send mode like SendPlay or SendInput.


Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


Menteroth
  • Members
  • 23 posts
  • Last active: Oct 24 2014 05:24 PM
  • Joined: 27 Apr 2013

Just tried admin rights. Doesn't work. It's windowed borderless. And it works if I open chat so I can type. then it sends the characters qwe but it's like it doesn't simulate pressing them when I don't have chat opened. which is what I need. not just send visible characters.

SendPlay and SendInput won't work either.



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013

Is the !d combination bound to any native hotkey in the game? May i suggest you try one of the Numpad keys like NumpadEnter (just as a test) as the hotkey to see if the game is blocking the regular keys on the keyboard. Most games don't block the numeric keypad.


Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


Menteroth
  • Members
  • 23 posts
  • Last active: Oct 24 2014 05:24 PM
  • Joined: 27 Apr 2013

thought I looked through the bindings properly but ALT-D was bound. I removed it and tried again but did not work.
NumpadEnter on the other hand worked fine. !d only used spell W after I removed the ingame binding.

 

but NumpadEnter is kind of far away.



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013
✓  Best Answer

Here's the deal. The idea was that if a key is bound in the game or the game's keyboard driver is filtering the main keyboard keys you may have to go "off-grid" and use keys that the game isn't monitoring for your script hotkeys. Games typically don't monitor the numeric keypad keys and you could (if you're running your mouse right handed) hit the NumpadEnter key with the thumb on your right hand whenever you need that hotkey to activate. The NumpadAdd and NumpadSub keys are also really close too and you have 4 possible modifiers (Shift (+), Alt (!), Win (#) and Ctrl (^)) that could be used giving you a ton of diff hotkeys you could make using just those 3 numpad keys. If you'e also using a 5 button mouse (not everyone does) you have two extra buttons, XButton1 and XButton2, on the mouse that may also be available for hotkeys. And they can take modifiers too.

 

Those numpad keys appear to be free, Use them or not, it's up to you. Now you know you can get the script to work tho. What you actually use will depend on what you feel comfortable with.


Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


bigkevin112
  • Members
  • 22 posts
  • Last active: Jun 07 2013 04:29 AM
  • Joined: 17 Apr 2013

Try using a different key to activate it. I know that All the F1-F10 work. I know this because I use them for my jungle timer. So trying doing this:

#IfWinActive, League of Legends (TM) Client ;Make the hotkey only work when league is active
{
F1::
Send, {Q Down}
Sleep, 50
Send, {Q Up}
Sleep, 50
Send, {W Down}
Sleep, 50
Send, {W Up}
Sleep, 50
Send, {E Down}
Sleep, 50
Send, {E Up}
Sleep, 50
Return
}

I just opened league up and it works for me. So try and see this works and then check back with us.

Menteroth
  • Members
  • 23 posts
  • Last active: Oct 24 2014 05:24 PM
  • Joined: 27 Apr 2013

Thanks for the help.



bigkevin112
  • Members
  • 22 posts
  • Last active: Jun 07 2013 04:29 AM
  • Joined: 17 Apr 2013

Thanks for the help.

What I posted did that help you? Do what you needed it to do? Or did you find another solution?



Ruevil2
  • Members
  • 226 posts
  • Last active: Dec 04 2015 11:05 PM
  • Joined: 27 Mar 2012

AFAIK there are two types of key codes that can be sent. Hardware keys and virtual keys. League does not respond well to virtual keys unless the chat window is active. This is purposefully done to prevent this kind of automation and botting. You can rebind any key in League to whatever you wish, just know that you cannot send keys INTO the client window because AHK only produces "virtual" key codes which are discarded for the most part by the client.

Note: I use a Belkin N52te gamepad, since it operates by loading a keymap into an onboard memory in the device these keys are seen as "hardware" and the macros created on the hardware side DO WORK. It is very difficult, at least for me, to generate a DirectInput keypress in AHK so far.

 

Also something to note is that this game uses DirextX and DirectInput, which poll on a set interval the entire state of the keyboard at once, then on next poll they are compared to see which keys were "pressed". This is an advantage over older methods due to the ability to detect multiple key presses at the same time. Given this information we can determine that keypresses that are initiated(keydown) and ended(keyup) between polls will also be "lost".

 

Note: On my belkin gamepad(N52TE, these things are sweet BTW) this behavior caused me to have to turn the polling rate of the device down so I wasn't "losing" keypresses.

 

BigKevin: The reason the F1-F10 keys work for you is because you are not trying to send keypresses into league, they are only being picked up by AHK. In this case you could literally choose any key on the keyboard you want.


If I helped you out and you would like to show appreciation, feel free to buy me a beer.  grin.png   btn_donateCC_LG.gif