Вопросы по AHK-скриптингу

Teez

Известный
76
2
Ребзя, как извлечить из чата ID и вставить его в команду.
Т.е.

Xyilo_Xuilovich[228]: Ты лох
/su ID 6 сам лох
саси

Как такое замутить?
 

meowprd

Тот самый Котовский
Проверенный
1,280
712
Ребзя, как извлечить из чата ID и вставить его в команду.
Т.е.

Xyilo_Xuilovich[228]: Ты лох
/su ID 6 сам лох
саси

Как такое замутить?

AutoHotKey:
#SingleInstance force
#IfWinActive GTA:SA:MP
#Persistent

#include samp.ahk

SetTimer, update, 50
global file_update := A_MyDocuments "/GTA San Andreas User Files/SAMP/chatlog.txt"

F2::
reload
return

update:
FileRead, chatlog, % file_update
save(chatlog)
if(RegExMatch(chatlog, ".*\[([0-9]*)\]: .*", out))
{
    SendChat("/su " out1 " 6 сам ты лох")
    return
}
return
 

Вложения

  • SAMP.ahk
    253.1 KB · Просмотры: 3
  • Нравится
Реакции: Teez

XiaoTriton

Новичок
11
0
А картиночки я тебе где достану?
Заливай и код и картинки.
unsmert.png

smert.png
 

XiaoTriton

Новичок
11
0

meowprd

Тот самый Котовский
Проверенный
1,280
712
понял, cорян, туплю
AutoHotKey:
F1::
Loop, 10
{

ImageSearch, xp, yp, 665, 812, 1427, 857, *50 smert.png

If xp > 0

Click %xp% %yp%

SendInput 1

Break

}
Loop,

{

ImageSearch, bx, pb, 1251, 937, 1334 758, *50 unsmert.png

Sleep 200

If bx > 0

Click %bx% %pb%

Break

}

Sleep 10000

Return
а чо код должен делать то?
фармить сообщения что-ли?
 

meowprd

Тот самый Котовский
Проверенный
1,280
712

AutoHotKey:
#Persistent
#SingleInstance force

global temp_x := 0
global temp_y := 0

F2::
ImageSearch, temp_x, temp_y, 0, 0, A_ScreenWidth, A_ScreenHeight, smert.png
if(errorlevel){
    msgbox, smert.png errorlevel = %errorlevel%
    return
}
MouseMove, temp_x+10, temp_y+10
MouseClick, Left, temp_x+10, temp_y+10
sleep 50
SendInput, 1
sleep 50
ImageSearch, temp_x, temp_y, 0, 0, A_ScreenWidth, A_ScreenHeight, unsmert.png
if(errorlevel){
    msgbox, unsmert.png errorlevel = %errorlevel%
    return
}
MouseMove, temp_x+10, temp_y+10
MouseClick, Left, temp_x+10, temp_y+10
return
 
  • Влюблен
Реакции: XiaoTriton

AterEX

Участник
44
1
Привет.
Хочу сделать переключатель в скрипте. При нажатие клавиши A, я нажимаю B и проигрывается один скрипт, при повторном нажатие клавиши A, и затем нажатие B проигрывается другой скрипт.
 

XiaoTriton

Новичок
11
0
AutoHotKey:
#Persistent
#SingleInstance force

global temp_x := 0
global temp_y := 0

F2::
ImageSearch, temp_x, temp_y, 0, 0, A_ScreenWidth, A_ScreenHeight, smert.png
if(errorlevel){
    msgbox, smert.png errorlevel = %errorlevel%
    return
}
MouseMove, temp_x+10, temp_y+10
MouseClick, Left, temp_x+10, temp_y+10
sleep 50
SendInput, 1
sleep 50
ImageSearch, temp_x, temp_y, 0, 0, A_ScreenWidth, A_ScreenHeight, unsmert.png
if(errorlevel){
    msgbox, unsmert.png errorlevel = %errorlevel%
    return
}
MouseMove, temp_x+10, temp_y+10
MouseClick, Left, temp_x+10, temp_y+10
return
если я правильно понял мне надо поменять координаты в temp и в строках с картинками?
 
Последнее редактирование:

meowprd

Тот самый Котовский
Проверенный
1,280
712
если я правильно понял мне надо поменять координаты в temp и в строках с картинками?
Я тебе скинул готовый код, бери и юзай
Привет.
Хочу сделать переключатель в скрипте. При нажатие клавиши A, я нажимаю B и проигрывается один скрипт, при повторном нажатие клавиши A, и затем нажатие B проигрывается другой скрипт.
Если я все правильно понял.

AutoHotKey:
#SingleInstance force
#Persistent

global number := 0

NumPad1::
number += 1
goto, label%number%
return

label1:
msgbox, label number 1
return

label2:
msgbox, label number 2
return