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

Warklot

Участник
112
3
@Котовский.


[CODE = autohotkey] {
health: = getPlayerHealth (getClosestPlayerId ())
addchatmessage (health)
} [/ CODE]


Too many parameters passed to function.
"health: = getPlayerHealth (getClosestPlayerId ())" doesn't work why
 

Warklot

Участник
112
3
ur udf don't have getPlayerHealth()
try to use my udf



tr:
Loop

{

Players: = []

Players: = getStreamedInPlayersInfo ()

For i, o in Players

{

Name: = getPlayerNameById (i)

HP: = Floor (o.HP)

if (HP <99)

{

addChatMessage ("/ pagydyti" i "` n ")

sleep 500

}
}
}

return


I could use this code but the range of this too big the command of server says that "you cannot heal them they are too far away)
 

meowprd

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

{

Players: = []

Players: = getStreamedInPlayersInfo ()

For i, o in Players

{

Name: = getPlayerNameById (i)

HP: = Floor (o.HP)

if (HP <99)

{

addChatMessage ("/ pagydyti" i "` n ")

sleep 500

}
}
}

return


I could use this code but the range of this too big the command of server says that "you cannot heal them they are too far away)

I don’t quite understand what goal you want to achieve. You make floor to the HP value, but nowhere do you get it inside the loop
 

Warklot

Участник
112
3
Fixed everything works
i have one more question
why this code starts from 008 106 125 and not from 002 051 210 what I'm doing wrong

1590947054204.png


asd:
if(isdialogopen())
{
if (regexmatch(getDialogText(), "(Ban)(.*)({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)\s({.*})(\d+)", out))
{
sleep 1500

addchatmessage(out4 " " out6 " " out8)
addchatmessage(out10 " " out12 " " out14)
addchatmessage(out16 " " out18 " " out20)
addchatmessage(out22 " " out24 " " out26)
addchatmessage(out28 " " out30 " " out32)
addchatmessage(out34 " " out36 " " out38)
addchatmessage(out40 " " out42 " " out44)
addchatmessage(out46 " " out48 " " out50)
addchatmessage(out52 " " out54 " " out56)
addchatmessage(out58 " " out60 " " out62)
    sleep 1500

}
}
return
 

Вложения

  • 1590947044320.png
    1590947044320.png
    25.1 KB · Просмотры: 120
Последнее редактирование:

Warklot

Участник
112
3
Код:
Loop
{
id := getClosestPlayerId()
FileAppend,id`n,medikai.txt
}
return
why doesn't it work
i want it to write id in my text file and after that check if there is any id that match in that file
 

Teez

Известный
76
2
Код:
Loop
{
id := getClosestPlayerId()
FileAppend,id`n,medikai.txt
}
return
why doesn't it work
i want it to write id in my text file and after that check if there is any id that match in that file
AutoHotKey:
Loop
{
id := getClosestPlayerId()
FileAppend,%id%`n,medikai.txt
}
return
Как обнулить A_LoopReadLine? Типо он начинает писать первую строчку, потом первую, вторую, потом первую ,вторую, третюю и т.д. Как сделать так, чтоб он брал только одну строчку? ( т.е. 1, потом только 2, потом только 3 и т.д.)
 
Последнее редактирование:

meowprd

Тот самый Котовский
Проверенный
1,280
712
AutoHotKey:
Loop
{
id := getClosestPlayerId()
FileAppend,%id%`n,medikai.txt
}
return
Как обнулить A_LoopReadLine? Типо он начинает писать первую строчку, потом первую, вторую, потом первую ,вторую, третюю и т.д. Как сделать так, чтоб он брал только одну строчку? ( т.е. 1, потом только 2, потом только 3 и т.д.)
нумеровать строки юзая A_Index, затем выцеплять нужные иды строк через regexmatch
 

eqipatential

Участник
36
5
как сделать чтобы данный скрипт был привязан к окну RAGE MP и работал там в свернутом режиме?
сам код:

Код:
Loop
{
SendInput, {I}
Sleep 1000
MouseMove, 352, 345, 0
MouseClick, left
MouseMove, 352, 399, 0
MouseClick, left
Sleep 15500
}
end::pause
return
 

croix

Известный
2
0
Здравствуйте. Как например забиндить кое-что на букву L к примеру, и чтобы оно активировалось только при выключенном чате, а не работало когда печатаешь что-то в чате? Буду благодарен за помощь!
 

degrando

Известный
362
127
Здравствуйте. Как например забиндить кое-что на букву L к примеру, и чтобы оно активировалось только при выключенном чате, а не работало когда печатаешь что-то в чате? Буду благодарен за помощь!
AutoHotKey:
#include samp.ahk ; подключаешь samp udf
#SingleInstance force

L::
if (isInChat() == 0) {
addchatmessage("Эл))")
}
else {
addchatmessage("друг мой, у тебя чат открыт")
}
return
 
  • Нравится
Реакции: croix