Как написать кликер на ahk

Автокликер, авто-нажатие на клавиши, скрипт, имитирующий клавиатуру

Софт » Медиа 22 Дек 2016, 00:03

(Всего: 119 259, сегодня: 42 )

За пару минут вы запустите свой кликер по клавишам. Когда понадобилось автоматом нажимать на кнопки клавиатуры, нормального решения в сети именно для клавиш я так и не нашел и случайно нашел ролик на Ютубе вот с этим.

Мы будем писать циклический скрипт, который будет обрабатывать программа AutoHotKey (AHK). Скрипт будет выполнять цикл и запускаться бесконечное количество раз. Итак, поехали.

В моем случае я использую всего две клавиши – пробел (space) и эскейп (esc). Коды всех остальных клавиш и других возможностей программы можно найти в документации AutoHotKey

Скрипт цикла нажатия на клавиши

Home::
Loop
{
send, {Esc}
sleep, 2000
send, {Space}
sleep, 2000
}
Return

End::
ExitApp
Return

Описание к коду выше

Home:: - а-ля "Паскалевское" начало программы - ключевое слово, которое изменять нельзя
Loop - слово, указывающее на начало цикла
{ - открытие цикла
send, {Esc) - дословно - нажимаить на
sleep, 2000 - ждать 2 тыс. миллисекунд (2 секунды)
} - закрытие цикла
Return - обязательное слово, для зацикливания кода
End:: 
ExitApp
Return - - обязательное слово, для зацикливания всего кода в целом

Сохраняем файл в формате *.ahk и скачиваем и устанавливаем программу AutoHotKey

Теперь ваш скрипт понятен для ОС Windows. Для удобства его можно скомпилировать в *.exe нажав правой кнопкой мыши и выбрав соответствующий пункт контекстного меню.

Файл запускается сразу в трей, активируется кнопкой HOME, деактивируется (удаляется из трея) – End.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

1
branch

1
tag

Code

  • Use Git or checkout with SVN using the web URL.

  • Open with GitHub Desktop

  • Download ZIP

Latest commit

@MohamedSaidSallam

Files

Permalink

Failed to load latest commit information.

Type

Name

Latest commit message

Commit time

Auto Clicker

GitHub Release
License

An auto hotkey script that rapidly clicks at the pointer location. Also includes windows notifications, adjustable speed, and a help menu.

How To Use

you can access the following menu after launching the script by holding F1:

Hotkeys List

How To Run

  1. Download AutoHotkey
  2. Double click autoclick.ahk

Authors

  • Mohamed Said Sallam — Main Dev — TheDigitalPhoenixX

See also the list of contributors who participated in this project and their work in CONTRIBUTORS.md.

License

This project is licensed under the MIT License — see the LICENSE file for details

Acknowledgments

  • README.md Template

About

An auto hotkey script that rapidly clicks at the pointer location. Also includes windows notifications, adjustable speed, and a help menu.

Topics

Resources

Readme

License

MIT license

Stars

0
stars

Watchers

2
watching

Forks

0
forks

Cookie Clicker AutoHotkey Script for Clicking

This post talks about the simple AutoHotkey script I have written for clicking repeatedly for Cookie Clicker.

AutoHotkey and Cookie Clicker

AutoHotkey is a scripting language for Windows that allows automation of the mouse and keyboard. The AutoHotkey scripting toolkit can be downloaded from their website.

Cookie Clicker is an online “idle game” where the objective is to progress through clicking repeatedly and idling it in your browser. Since you can progress faster by clicking faster, a script to click can help progress much faster than normal rates.

Creating the AutoHotkey Script to click

To progress faster I want my AutoHotkey script to click repeatedly until turned off.

The below script will continue to “click” once the F8 key is pressed. Pressing the F8 key again will stop clicking. During this time the mouse can be moved like normal which will not stop the clicking.

SetDefaultMouseSpeed, 0
SetBatchLines, -1
ListLines, Off

F8::
  bFlag := !bFlag
  While bFlag
    Click
Return

I have saved this script in a .ahk file which can be double clicked on to start the script once AutoHotkey is installed.

This can help in both Cookie Clicker and many other idle type games. This script can be used by anyone and is licensed under the standard MIT license

About Author

Chewett

This is not too hard if you study the help materials. Try the following and note, you can adjust the wait times or do other things in between the two times you press the mouse down:

click Down
sleep, 5000
click up

sleep, 500

click Down
sleep, 5000
click up

return

And, if you need multiple repeats, you can put it in a loop:

loop, 5
{
click Down
sleep, 5000
click up
sleep, 500
}

return

https://autohotkey.com/docs/commands/Click.htm

Click [v1.0.43+]

Clicks a mouse button at the specified coordinates. It can also hold down a mouse button, turn the mouse wheel, or move the mouse.

Here are examples of common usages (all commas are optional):

Click (by itself) Clicks the left mouse button once at the mouse cursor’s current position.

Click 44, 55 Clicks the left mouse button once at coordinates 44, 55 (based on CoordMode).

Click right 44, 55 Same as above but clicks the right mouse button.

Click 2 Clicks the left mouse button twice at the cursor’s current position (i.e. double-click).

Click down Presses the left mouse button down and holds it.

Click up right Releases the right mouse button.

Click %x% %y% Since click does not support expressions, variables should be enclosed in percent signs.

Zero or more of the following items can follow the word Click. Separate each item from the next with at least one space, tab, and/or comma. The items can appear in any order except ClickCount, which must occur somewhere to the right of the coordinates (if coordinates are present).

X, Y: The x/y coordinates to which the mouse cursor is moved prior to clicking. Coordinates are relative to the active window unless CoordMode was used to change that. If omitted, the cursor’s current position is used.

Button Name: Left (default), Right, Middle (or just the first letter of each of these); or the fourth or fifth mouse button (X1 or X2). NOTE: Unlike MouseClick, the left and right buttons behave consistently across all systems, even if the user has swapped the buttons via the system’s control panel.

Mouse Wheel: Specify WheelUp or WU to turn the wheel upward (away from you); specify WheelDown or WD to turn the wheel downward (toward you). In v1.0.48+, WheelLeft (or WL) or WheelRight (or WR) may also be specified (but they have no effect on older operating systems older than Windows Vista). For ClickCount (below), specify the number of notches to turn the wheel. However, some applications do not obey a ClickCount higher than 1 for the mouse wheel. For them, use a Loop such as the following:
Loop 5
Click WheelUp

ClickCount: The number of times to click the mouse (examples: Click 2, Click 100, 200, 2). If omitted, the button is clicked once. If coordinates are specified, ClickCount must appear after them. Specify zero (0) to move the mouse without clicking (for example: Click 100, 200, 0).

Down or Up: These words are normally omitted, in which case each click consists of a down-event followed by an up-event. Otherwise, specify Down (or the letter D) to press the mouse button down without releasing it. Later, use the word Up (or the letter U) to release the mouse button.

Relative: The word Rel or Relative treats the specified X and Y coordinates as offsets from the current mouse position. In other words, the cursor will be moved from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative).

Понравилась статья? Поделить с друзьями:
  • Как написать кликер для браузера
  • Как написать китайский алфавит
  • Как написать китайские иероглифы на клавиатуре
  • Как написать китайские буквы на клавиатуре
  • Как написать кислый английскими буквами