Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ajuda e Suporte Geral • PostMessage Autohotkey

$
0
0
alguem poderia me ajudar a por as funcoes do postmessage api windows nesse script

CODE:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent
#SingleInstance force
#include api_misc.ahk
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetTitleMatchMode, 3
DetectHiddenWindows, On
CoordMode, Pixel, Client
CoordMode, ToolTip, Client
CoordMode, Mouse, Client
SetKeyDelay, 0
SetMouseDelay, 0
ListLines On ; increase script performance
SetBatchLines, 10ms ;higher values increase script performance, but consume more cpu
SetDefaultMouseSpeed, 0

tool_tip_id := 5

Global sqm := 60
Global half_sqm := 12 ;less than half sqm

;char position
char_x := 680
char_y := 350

LALT::
TrayTip BOT INICOU, BOT INICOU
INICIO:
PixelSearch, AtacarX, AtacarY, 1172, 278, 1338, 584, 0x000000, 0, Fast RGB
If (ErrorLevel = 0)
{
; Array de teclas
teclas := ["{F1}", "{F2}", "{F3}", "{F4}", "{F5}", "{F6}", "{F7}", "{F8}", "{F9}", "{F10}"]

; Embaralhar as teclas
Loop, % teclas.MaxIndex()
{
Random, rand, 1, teclas.MaxIndex()
temp := teclas[A_Index]
teclas[A_Index] := teclas[rand]
teclas[rand] := temp
}

; Enviar as teclas
Loop, % teclas.MaxIndex()
{
SendInput, % teclas[A_Index]
Sleep, 100 ; Esperar um pouco entre cada tecla
}
Loop, 2
{
loot_all(char_x, char_y)
loot_all(byRef char_x, byref char_y) {

MouseGetPos, mouse_x, mouse_y

send("{Ctrl down}")
loot(char_x, char_y, -1, -1) ;north-west
loot(char_x, char_y, 0, -1) ;north
loot(char_x, char_y, 1, -1) ;north-east
loot(char_x, char_y, 1, 0) ;east
loot(char_x, char_y, 1, 1) ;south-east
loot(char_x, char_y, 0, 1) ;south
loot(char_x, char_y, -1, 1) ;south-west
loot(char_x, char_y, -1, 0) ;west
send("{Ctrl up}")


}

loot(x, y, byRef x_sign, byRef y_sign) {

x := x + x_sign*sqm
y := y + y_sign*sqm
x_min := x - half_sqm
x_max := x + half_sqm
y_min := y - half_sqm
y_max := y + half_sqm

click_random(x_min, x_max, y_min, y_max, "right")
random_sleep(100, 150)
Click, 1188, 629 Right, 5
click, 1343, 600 Left, 1
}
}
}
ImageSearch, ChatRedX, ChatRedY, 0, 0, 1360, 768, C:\Users\diego\OneDrive\Área de Trabalho\teste\src\img\ChatRed.png
If ErrorLevel = 0
SoundBeep
ImageSearch, CheckinX, CheckinY, 0, 0, 1360, 768, C:\Users\diego\OneDrive\Área de Trabalho\teste\src\img\Relogio.png
If ErrorLevel = 0
SoundBeep
Goto, INICIO
CONTROL::pause

Statistics: Posted by DiegoSouto — Today, 18:17



Viewing all articles
Browse latest Browse all 579

Trending Articles