Script GTA:SA
Posted: 15 Jun 2021, 03:05
by antonioff
i need help with this code on gta
Code: Select all
Player1 = %Temp%
PlayerID1 = %Temp%
F2::
FileRead, logs, %A_Documents%\GTA San Andreas User Files\chatlog.txt ;
if (RegExMatch(logs, "Report: %Player1% (%PlayerID1%) is stuck.")) {
Send t/spec %PlayerID1%{Enter}
}
logs := ""
report structure is: "Report: PlayerNickname (PlayerID) is stuck."
Re: Script GTA:SA
Posted: 15 Jun 2021, 06:20
by swagfag
Code: Select all
regexForMatchingPlayerNicknames := ??????
regexForMatchingPlayerIDs := ??????
if (RegExMatch(logs, "`aim)Report: " regexForMatchingPlayerNicknames " \((?P<ID1>" regexForMatchingPlayerIDs ")\) is stuck.", Player)) {
u havent specified the format for nicknames and IDs
Re: swagfag
Posted: 15 Jun 2021, 11:55
by antonioff
@swagfag
It doesn't work like this either:
Code: Select all
regexForMatchingPlayerNicknames := ??????
regexForMatchingPlayerIDs := ??????
F2::
FileRead, logs, %A_Documents%\GTA San Andreas User Files\chatlog.txt ;
if (RegExMatch(logs, "`aim)Report: " regexForMatchingPlayerNicknames " \((?P<ID1>" regexForMatchingPlayerIDs ")\) is stuck.", Player)) {
Send t/spec regexForMatchingPlayerIDs {Enter}
}
logs := ""
Re: Script GTA:SA
Posted: 15 Jun 2021, 12:16
by swagfag
naturally
it would only work if u specify which regex patterns match nicknames and IDs(see the question marks)... which u havent done, u simply copypasted as is
the result(ie the matching id) would then be emitted in the PlayerID1 variable(per ur original code structure)