4

The Dowsing Rod requires you to spam the use (F) key while looking for deep arrowheads. Spamming keys sucks. You wouldn't really need it if sound was enough clue to go on (the PS2 version made your controller rumble when in position), but it turns out it's not.

AutoHotKey should be able to make it much easier on my fingers. Something such as this should suffice:

$f::
While GetKeyState("f","P")
 Send f
return

It works in all places but Psychonauts. I've tried the SendPlay, the SendInput, the SendMode Play, the SetKeyDelay workarounds suggested here to no avail.

How can I make searching with the dowsing rods less tedious?

6
  • I played it on the Xbox, so I can't help. But, thank you for reminding me about this game. One of the best platformers ever...
    – Niro
    Commented Dec 26, 2011 at 21:08
  • Have you tried looking at the wiki? autohotkey.com/wiki/index.php?title=Autofire
    – Krazer
    Commented Dec 26, 2011 at 21:22
  • This is just a wild guess really, but maybe you need to handle DirectInput or Xinput to get AHK working in Psychonauts. See autohotkey.com/forum/topic39091.html and autohotkey.net/~Lexikos/XInput.ahk for examples.
    – bkzland
    Commented Dec 27, 2011 at 2:40
  • 2
    I’m voting to close this question because, according to Timmy Jim, "writing scripts for key mapping software is not about gaming".
    – pppery
    Commented Sep 8, 2022 at 21:00
  • 1
    @pppery I wouldn't close due to the lack of community consensus on the matter. We have a long history of allowing [autohotkey] questions here, dating more than 10 years ago. This should be discussed in Arqade Meta first. Commented Sep 9, 2022 at 3:10

4 Answers 4

4

I tried a different approach with the "automatic shooting" function that JoyToKey offers, but the problem seems to be in Psychonauts itself. While it does register keys remapped through JoyToKey, it does not accept repeated inputs without registering a release of the button you pressed.

This led me to the idea to send raw input events, which works. In this AHK example I just assigned the hotkey CTRL-r to make Raz jump 20 times.

^r::
Loop 20
{
    Send {Space down}
    Sleep 10
    Send {Space up}
    Sleep 1000
}
return

Should work with any other key as well.

1
  • 1
    All three of the answers probably have working scripts, but this answer differs in that it specifically outlines the mechanism of the solution.
    – NiteCyper
    Commented May 31, 2013 at 13:49
2

I finally got it to work

loop
{
^#f::
If getkeystate("f")
    send {f up}
else
    loop
        {
        send {f down}
        sleep 20
        send {f up}
        sleep 20
        if getkeystate("f")
            break
        }
return
}
1

I have the Mac version of Psychonauts, so I used Sikuli as the scripting engine, which works on both Windows and Mac. Sikuli uses Python as its scripting language.

This script presses F every 0.12 seconds until either 30 seconds has passed or you stop the script with C. You can configure it by changing the values of the constants at the top.

# Psychonauts: repeat F to collect deep arrowheads

APP_NAME = "Psychonauts"
KEY_TO_MASH = "f"
TIME_TO_RUN = 30*1 + 00
TIME_OF_PRESS = 0.02
TIME_OF_WAIT = 0.10

def holdKeyForTime(key, time):
    keyDown(key)
    wait(time)
    keyUp(key)

def mainAction():
    time_to_run = TIME_TO_RUN
    time_of_press = TIME_OF_PRESS
    time_of_wait = TIME_OF_WAIT
    time_per_press = time_of_press + time_of_wait
    num_presses = time_to_run / time_per_press

    for i in range(num_presses):
        holdKeyForTime(KEY_TO_MASH, time_of_press)
        wait(time_of_wait)

App.focus(APP_NAME); wait(1)
mainAction()


# full docs: http://doc.sikuli.org/
1
^1::
     SetTimer, AUTOFIRE, 10
     Gosub, AUTOFIRE
return
^2::
     SetTimer, AUTOFIRE, Off
return

AUTOFIRE:
     Send, F
return

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .