Skip to content
TheChatArchiveThe Chat Archive
Coherecommand-a-03-2025· CohereHugging Face LMArena Human Preference 140K

Write AHK Script to make player walk in circles. Script should be toggled by pressing F1.

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with grok-4-0709’s answer.
  1. User

    Write AHK Script to make player walk in circles. Script should be toggled by pressing F1.

  2. Cohere Assistant

    Below is an AutoHotkey (AHK) script that makes a player walk in circles. The script is toggled by pressing the F1 key. When activated, it will send a sequence of movement keys (e.g., W, A, S, D) in a loop to simulate walking in circles. You can adjust the keys and timing to match your game's controls.

    #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases
    SendMode Input  ; Recommended for new scripts due to its improved reliability and speed
    SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory
    
    ; Variables for controlling the script
    isWalking := false
    walkInterval := 500  ; Time interval between key presses in milliseconds
    
    ; Function to toggle walking in circles
    F1::
        isWalking := !isWalking  ; Toggle the walking state
        if (isWalking) {
            MsgBox, Walking in circles is now ON. Press F1 to stop.
            WalkInCircles()
        } else {
            MsgBox, Walking in circles is now OFF.
        }
    return
    
    ; Function to simulate walking in circles
    WalkInCircles() {
        global isWalking
        while (isWalking) {
            Send, {w down}
            Sleep, %walkInterval%
            Send, {w up}
            Send, {a down}
            Sleep, %walkInterval%
            Send, {a up}
            Send, {s down}
            Sleep, %walkInterval%
            Send, {s up}
            Send, {d down}
            Sleep, %walkInterval%
            Send, {d up}
        }
    }
    

    Explanation:

    1. Toggle Function (F1):

      • Pressing F1 toggles the isWalking variable between true and false.
      • If isWalking is true, the WalkInCircles function is called.
      • If isWalking is false, the script stops the loop.
    2. WalkInCircles Function:

      • This function sends a sequence of key presses (W, A, S, D) in a loop to simulate walking in circles.
      • The Sleep command introduces a delay between key presses to control the speed of movement.
    3. Customization:

      • Adjust the walkInterval variable to change the speed of movement.
      • Modify the keys (W, A, S, D) to match your game's movement controls if they are different.

    Notes:

    • Ensure the game window is active for the script to work correctly.
    • Test the script in a safe environment before using it in a game to avoid unintended consequences.

    Save the script with a .ahk extension and run it using AutoHotkey. Press F1 to start/stop the circular walking.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.