ARK: Survival Evolved

ARK: Survival Evolved

データを表示:
Making an "auto run" key on my Logitech G series keyboard
Can someone help me write a script to toggle Shift+W on a G-key for my Logitech keyboard?
I found one for "W" but not "Shift+W", and don't understand the language necessary to add it.

Of course, it would be ideal if the devs would just add one to the game, but we make do.


EDIT!!! SOLVED! TWICE!

Thanks to StormWeaker for his script


Stormweaker の投稿を引用:
Walter Matthau の投稿を引用:
I found this solution on the Logitech website
https://forums.logitech.com/t5/Logitech-G-Keyboards/Macro-for-holding-down-W/td-p/847508
It works perfectly for W, but not Shift+W, and I'm not sure how to add it.

If you or someone else still want the script i changed it so it works with Shift+W :

(tested in .txt file but should work in ARK or any game)

function OnEvent(event, arg, family)
if event == "G_PRESSED" then -- this is for when the G key is pressed
if arg == 1 then -- 1 is the G key number tested
toggle = not toggle -- This changes the toggle state back and forth
if toggle then
PressKey(0x36, 0x11)
else
ReleaseKey(0x11, 0x36)
end
end
end
end




This does a great job, and/but it toggles shift with every other press, necessitating multiple clicks to turn on/off run. Thank you StormWeaker


Also thanks to Abusive for pointing out that Right Shift will toggle run, allowing the older script to be used (credit Skylaw from the Logitech forums for this script)



function OnEvent(event, arg)

if (event=="G_PRESSED" and arg==3) then

if (toggle==null) then

PressKey(0x11);

toggle=1;

elseif (toggle==1) then

ReleaseKey(0x11);

toggle=nil;

end

end

end




This script toggles "W" with G3. used with a press of Right shift, and your bird will take you straight across the map.

(here's instructions on inputing the script for your Logitech keyboard https://forums.logitech.com/t5/Logitech-G-Keyboards/Macro-for-holding-down-W/td-p/847508 )

Thanks for all the help ARK forum!
最近の変更はWalter Matthauが行いました; 2015年11月25日 19時15分
< >
16-30 / 31 のコメントを表示
Abusive 2015年11月25日 18時48分 
Well, I was going off of what the OP said.

I found one for "W" but not "Shift+W"

Armed with the information that he had found a way to automatically hold W down, I provided him with the missing piece, the shift aspect.
最近の変更はAbusiveが行いました; 2015年11月25日 18時49分
You're right Abusive.
I wasn't aware that Right Shift would toggle run. It's good to know, and it is relevant to this thread. Thank you.
Abusive 2015年11月25日 18時49分 
Walter Matthau の投稿を引用:
You're right Abusive.
I wasn't aware that Right Shift would toggle run. It's good to know, and it is relevant to this thread. Thank you.

No probs ;)
Abusive の投稿を引用:
Well, I was going off of what the OP said.

I found one for "W" but not "Shift+W"

Armed with the information that he had found a way to automatically hold W down, I provided him with the missing piece, the shift aspect.


oooohhh, I hadn't put those two together. that actually make perfect sense. :conwayfacepalm:
you've earned an honorable mention in the edit!
Abusive 2015年11月25日 18時56分 
Hehehe. Have yourselves a nice day!
This doesn't seem to work for me at all. I'm playing Sniper Elite 4. I've tried about half a dozen different scripts but none of them are working.
Do the scripts work in a .txt file (open a new file with the notepad and start the script, if it outputs what is needed (like a lot of 'z') then the script works) ? If yes then the part might be on Sniper Elite not getting the key presses from the script, so you'd have to tweak a bit or search for something working in this particular game.
If not then I might take a look at the script, but the one I posted was working in ARK if I remember correctly.
Dwza 2017年11月21日 15時59分 
Obviously there are still people who try to solve this autowalk srcipt for Ark.
Here is my working script

function OnEvent(event, arg, family) if event == "G_PRESSED" then if arg == 11 then toggle = not toggle -- This changes the toggle state back and forth if toggle then PressKey("w") PressAndReleaseKey("rshift") -- From here status-messages are send to G19 display ClearLCD () OutputLCDMessage("AutoWalk ON") OutputLCDMessage("Speed ON") OutputLCDMessage("", 5000) else ReleaseKey("w") PressAndReleaseKey("rshift") -- From here status-messages are send to G19 display ClearLCD () OutputLCDMessage("AutoWalk OFF") OutputLCDMessage("Speed OFF") OutputLCDMessage("", 3000) end end end end
This code binds it self to G11. Of course you are free to change the keynumber to bind this toggle behavior in line 3.

Enjoy
最近の変更はDwzaが行いました; 2017年11月21日 16時03分
Λ 2018年1月26日 7時35分 
function OnEvent(event, arg) OutputLogMessage("event = %s, arg = %s\n", event, arg) if (event=="MOUSE_BUTTON_PRESSED" and arg==4) then if (toggle0==null) then PressKey("w"); toggle0=1; else ReleaseKey("w"); toggle0=nil; end end if (event=="MOUSE_BUTTON_PRESSED" and arg==5) then if (toggle1==null) then PressKey("lshift"); PressKey("w"); toggle1=1; else ReleaseKey("lshift"); ReleaseKey("w"); toggle1=nil; end end end

w and lshift +w.

Replace arg==4/5 with mouse key. see bottom log in Script editor.

unassign key if needed :steamhappy:

最近の変更はΛが行いました; 2018年1月26日 7時38分
Syee 2018年2月12日 22時05分 
Got a friend to help me out on this sorry to revitalize an old thread but here we go. Works perfectly in ark and most games.


This will map it to G1 on the game board


autorunGKey = 1
toggleRun = true

function OnEvent(event,arg,family)
if event == "G_PRESSED" and arg == autorunGKey then
toggleRun = not toggleRun
if toggleRun then
PressKey("lshift")
PressKey("w")
else
ReleaseKey("w")
ReleaseKey("lshift")
end
end
end



NECRO
I'll give it a try. Thanks Syee.
Klibo 2019年1月1日 10時05分 
So I wanted this for atlas and I wanted to keep the default KB control set up, so tweaked the script to this...

function OnEvent(event, arg)
if (event=="G_PRESSED" and arg==17) then
if (toggle==null) then
PressKey(0x11, 0x2A);
toggle=1;
elseif (toggle==1) then
ReleaseKey(0x11, 0x2A);
toggle=nil;
end
end
end

Works grate thanks.

After trying to understand the "G-seriesLuaAPI.pdf"

The problem I'm having is my "M key's" (On a G13) are set up to do different things and this script takes over all "G17" key when in M2 and M3. I just want this working when I'm in M1 mode. I don't code and have some exp with target by thrustmaster.

I'm trying stuff like...

if {current_mkey = 1} then

if (current_mkey = GetMKeyState“lhc”) 1 then

With added "end" commands


Hope somone can help.




最近の変更はKliboが行いました; 2019年1月1日 10時51分
Szily 2019年12月29日 4時49分 
autorunGKey = 1
toggleRun = true

function OnEvent(event,arg,family)
if event == "G_PRESSED" and arg == 1 then
toggleRun = not toggleRun
if toggleRun then
PressKey("lshift")
PressKey("w")
else
ReleaseKey("w")
ReleaseKey("lshift")
end
end
end

This works great for me, DayZ Autowalk. Thanks everone.
Klibo の投稿を引用:
So I wanted this for atlas and I wanted to keep the default KB control set up, so tweaked the script to this...

function OnEvent(event, arg)
if (event=="G_PRESSED" and arg==17) then
if (toggle==null) then
PressKey(0x11, 0x2A);
toggle=1;
elseif (toggle==1) then
ReleaseKey(0x11, 0x2A);
toggle=nil;
end
end
end

Works grate thanks.

After trying to understand the "G-seriesLuaAPI.pdf"

The problem I'm having is my "M key's" (On a G13) are set up to do different things and this script takes over all "G17" key when in M2 and M3. I just want this working when I'm in M1 mode. I don't code and have some exp with target by thrustmaster.

I'm trying stuff like...

if {current_mkey = 1} then

if (current_mkey = GetMKeyState“lhc”) 1 then

With added "end" commands


Hope somone can help.
Interesting that that didnt work. Perhaps output key register values when in different m modes to see how it works; it could just have a separate m value, could add values to all other keys, or have separate tables for each m mode.

Given the get m state function exists it seems it's the first.

You said you changed what your M keys do. Did you perhaps change them to do something other than swap modes?

Also, the value of the m key when in mode one could easily be zero.
最近の変更はVeeshanが行いました; 2019年12月29日 7時44分
< >
16-30 / 31 のコメントを表示
ページ毎: 1530 50

投稿日: 2015年11月23日 9時19分
投稿数: 31