Auto Hot Key
213 subscribers
7 files
17 links
Created using ahk with love ❤️

@Lencore
Download Telegram
Translator.ahk.untrusted
56.7 KB
Google Translator via @AutoHotKey
#App
👍5
🔹 Определение размера изображения в PSD/PSB-файле

Информацию о размерах изображения в psd/psb-файле можно получить из его заголовка (File Header Section). Высота изображения находится по смещению 14 от начала заголовка, ширина по смещению 18. Данные записаны в формате big-endian, для конвертации в формат little-endian, используемый в процессорах архитектуры x86-64, можно применить api-функцию ntohl().

В скрипте надо указать путь к файлу и запустить скрипт.

Information about the size of the image in the psd / psb file can be obtained from its header (File Header Section). The height of the image is at offset 14 from the beginning of the header, the width is at offset 18. The data is written in big-endian format, to convert to the little-endian format used in x86-64 architecture processors, you can use the ntohl() api function.

In the script, you must specify the path to the file and run the script.

Автор / Author:
teadrinker
#App
👍2
psd size.ahk.untrusted
336 B
PSD/PSB size extractor via @AutoHotKey
#App
👍2
🔎 Google From Everywhere

Скрипт позволяет загуглить выделенный текст из любого окна, либо посмотреть значение выделенного слова. Чтобы загуглить, нужно выделить текст и нажать Win + Shift + G. Для просмотра значения — Win + Shift + W.

The script allows to google selected text from any window or to google any query with "definition" word. Select any text and press Win + Shift + G to google or press Win + Shift + G to get definition of word using Google Dictionary.

Автор / Author: @ArminGh02
#App
🔥4
GoogleFromEverywhere.ahk.untrusted
1.4 KB
Google From Everywhere
@AutoHotKey
#App
🔥3
🔢 FormatNumber()

Функция превращает обычные числа в более читаемые, разделяя каждые три символа с конца числа запятой для улучшения читаемости. Символ разделения можно заменить на пробел, точку или любой другой. В приложении код для первой и второй версии ahk.

The function creates comma-separated numbers from integers for better readability. It separates every 3 symbols from the ending by comma. Separator can be changed to space, dot etc. There are scripts for both ahk v1 and v2 in the attachment.

v1:
FormatNumber(Amount) {
StringReplace Amount, Amount, -
IfEqual ErrorLevel,0, SetEnv Sign,-
Loop Parse, Amount, .
If (A_Index = 1) {
len := StrLen(A_LoopField)
Loop Parse, A_LoopField
If (Mod(len-A_Index,3) = 0 and A_Index != len)
x = %x%%A_LoopField%,
Else x = %x%%A_LoopField%
} Else Return Sign x " " A_LoopField
Return Sign x
}

v2:
FormatNumber(Amount) 
{
Amount := StrReplace(Amount, "-",,,, 1)
x := ""
Sign := ""
Loop Parse, Amount, "."
If (A_Index = 1) {
len := StrLen(A_LoopField)
Loop Parse, A_LoopField
If (Mod(len-A_Index,3) = 0 and A_Index != len)
x := x . "" . A_LoopField . ","
Else x := x . "" . A_LoopField
} Else Return Sign x " " A_LoopField
Return Sign x
}

Источник / Source: link
v2: @Lencore
#Script
👍2
🔥 AutoHotKey

Добро пожаловать. Здесь собраны полезные скрипты и функции со всего интернета, написанные на AutoHotKey. Чтобы предложить скрипт для публикации, напишите @Lencore.

Welcome. Here we collect useful scripts and functions from all the Internet created with AutoHotKey. To suggest a script to publish contact @Lencore.
🔥1
Auto Hot Key pinned «🔥 AutoHotKey Добро пожаловать. Здесь собраны полезные скрипты и функции со всего интернета, написанные на AutoHotKey. Чтобы предложить скрипт для публикации, напишите @Lencore. Welcome. Here we collect useful scripts and functions from all the Internet created…»
📆 Получение Unix-времени / Getting Unix-time

Получение текущего Unix-времени (количество секунд от января 1970) для первой и второй версии ahk.

Getting current Unix-timestamp (measure in seconds since 1970's January) for both v1 and v2.

v1:
Time := A_NowUTC
EnvSub, Time, 19700101000000, Seconds

v2:
UnixTime := DateDiff(A_NowUTC, 19700101000000, "Seconds")

Источник / Source: документация / docs
#Script
👍3
📆 Конвертация UNIX-времени в DATE / Convert from UNIX to DATE

Облазил кучу сайтов, но почему-то для всех это оказалось слишком трудной задачей, хотя решается в одну строку. Вместо UNIXTIME подставить свое значение.

Replace the UNIXTIME with your value.

v1:
Date := 19700101000000
Date += UNIXTIME, seconds

v2:
Date := FormatTime(DateAdd(19700101000000, UNIXTIME, "seconds"), "d MMMM yyyy, H:mm")


Источник / Source: документация / docs
#Script
🔥4
💱 Кодирование текста в URI / Encoding text to URI

Скрипт форматирует заданный текст в URI по одному символу без использования сторонних скриптов.

The script converts given text to URI char by char without using external scripts/libs.

v1:
URIEncodeChar(c) {
char := Chr(c)
If (c >= 65 and c <= 90) or (c >= 97 and c <= 122) or (c >= 48 and c <= 57) or (c = 45) or (c = 95) or (c = 46) or (c = 33) or (c = 126) or (c = 42) or (c = 39) or (c = 40) or (c = 41) {
Return char
}
enc := ""
hex := Format("{:x}", c)
if (Len(hex) = 1)
hex := "0" . hex
enc .= "%" . hex
Return enc
}

URIEncode(str) {
encStr := ""
Loop, Parse, str
{
c := Ord(A_LoopField)
encStr .= URIEncodeChar(c)
}
Return encStr
}


v2:
URIEncodeChar(c) 
{
char := Chr(c)
If (c >= 65 and c <= 90) or (c >= 97 and c <= 122) or (c >= 48 and c <= 57) or (c = 45) or (c = 95) or (c = 46) or (c = 33) or (c = 126) or (c = 42) or (c = 39) or (c = 40) or (c = 41)
Return char
enc := ""
hex := Format("{:x}", c)
if (strLen(hex) = 1)
hex := "0" . hex
enc .= "%" . hex
Return enc
}

URIEncode(str)
{
encStr := ""
Loop Parse str
{
c := Ord(A_LoopField)
encStr .= URIEncodeChar(c)
}
Return encStr
}

Источник / Source: ChatGPT
#Script
👍2
📩 Отправка и получение данных по MQTT / Sending and receiving data using MQTT

Скрипт отправляет и получает данные от брокера. Можно добавить логин и пароль. На v1 не переводил, если кому-то не лень, можете заняться, добавлю. В папку со скриптом нужно закинуть папку mosquitto.

The script sends and gets data from broker. It is possible to use login and password. Have no time to transfer to v1, pm me if you are ready to do this. The script needs a mosquitto folder in the script's folder.

v2:

Send data

publish(topic, message)
{
shell := ComObject("WScript.Shell")
pubCmd := a_scriptdir "\mosquitto\mosquitto_pub.exe -h test.mosquitto.org -p 1883 -t " topic " -m '" message "'"
shell.Run(pubCmd, 0, true)
shell.ObjRelease()
}


Get data

shell := ComObject("WScript.Shell")
subCmd := a_scriptdir "\mosquitto\mosquitto_sub.exe -h " mqttHost " -p " mqttPort " -t " topic
subProcess := shell.Exec(subCmd)
OnMessage(subProcess)

OnMessage(subProcess) {
While (!subProcess.StdOut.AtEndOfStream) {
msg := subProcess.StdOut.ReadLine()
MsgBox "Сообщение получено:" "`n" msg
}
}

Источник / Source:
GPT-4, @Lencore
#Script
Please open Telegram to view this post
VIEW IN TELEGRAM
👍2
WORDSAPI

Простой сервис-словарь по английскому. Дает определения словам, синонимы, антонимы, рифмы, примеры и так далее. Переводов на другие языки нет. Бесплатно 2,500 запросов в день.

Simple English dictionary service. Gives an definitions, synonyms, antonyms, rhymes, examplec etc. There are no translations onto other languages. 2,500 requests per day are free.

https://www.wordsapi.com/

@AutoHotKey
#API
Poker API

Сервис для определения комбинаций и победителей для игры в покер. Принимает карты на столе и карты игроков и возвращает комбинацию каждого игрока, а также победителей. Бесплатно.

A service for determining combinations and winners for playing poker. Takes the cards on the table and the players' cards and returns the combination of each player, as well as the winners. Free.

https://www.pokerapi.dev/

@AutoHotKey
#API
Quick Chart API

Простой сервис для быстрого создания графиков для визуализации данных. Бесплатно.

A simple service to generate charts to visualize data. Free to use.

https://quickchart.io/

@AutoHotKey
#API
IMGIX API

Мощный сервис для редактирования изображений. Подключается напрямую к облачному хранилищу или сайту, чтобы вытаскивать картинки. Имеет кучу настроек для наложения текста и редактирования. Бесплатный тариф дает 1000 изображений в месяц бесплатно. Ссылка на песочницу, для использования API нужно зарегаться.

A powerful service to edit images. Connects directly to your cloud storage or website to get images. Has a lot of settings for overlay. Free plan allows to create 1000 images per months. The given link leads to sandbox, to use an API you need to register.

https://sandbox.imgix.com/

@AutoHotKey
#API
Google Translate API

Быстрый перевод через неофициальный апи гугла. Точных лимитов нет, но можно поймать ограничение при многократных запросах, так как гугл начнет помечать их как автоматические.

Quick translations via unofficial Google API. No determined limits, but you may get restrictions if google detects automatic requests.

SL = source lang (en, ru, auto etc)
TL = target lang (ru, en etc)
DT = data type (t = translation, at = alt. translation, rm = transliteration. bd = reverse translation)
IE = input encoding (utf-8 etc)
OE = output encoding (same as prev)
Q = query

https://translate.googleapis.com/translate_a/single?client=gtx&dt=t&sl=en&tl=ru&q=hello

@AutoHotKey
#API
File transfer API

Простой сервис для загрузки файлов в облако, чтобы кто-то мог скачать его по ссылке. Бесплатный тариф включает 2 ГБ облака, лимит загрузки 4 ГБ в час и удаление файла после 1 скачивания.

Simple cloud storage to share links of files. Free plan includes 2 GB storage, 4 GB hourly upload limit and auto deletion of files after 1 download.

https://www.file.io/developers

@AutoHotKey
#API
Web Database

Онлайн-база данных, которую можно использовать в проектах вместо поднятия своей. Цены максимально доступные: $1 за каждый 1 млн обычных запросов и $1 за каждые 10,000 запросов CREATE.

Online database which can be used in own projects instead of deploying another ones. Prices are cool: $1 for each $1M requests and $1 for each 10K CREATE requests.

https://m3o.com/db

@AutoHotKey
#API
👍1
Read QR-code

Простой сервис для декодирования QR и баркодов. Принимает картинку в виде ссылки, возвращает содержимое.

A simple service for decoding QR and barcodes. Receives image as URL and returns the content.

http://api.qrserver.com/v1/read-qr-code/?fileurl=URL

@AutoHotKey
#API
Playing Cards API

Сервис для работы с колодой карт. Можно создать колоду, перемешивать, вытягивать карты, раскладывать по стопкам и даже получать изображение карт. Бесплатно.

A service to work with card deck. Creating, shuffling, drawing and adding cards to piles. It even gives an image of cards. Full free.

https://www.deckofcardsapi.com/

@AutoHotKey
#API
👍2🔥1