Script GTA:SA

Ask gaming related questions (AHK v1.1 and older)
antonioff
Posts: 2
Joined: 15 Jun 2021, 02:56

Script GTA:SA

15 Jun 2021, 03:05

i need help with this code on gta:sa:

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."
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Script GTA:SA

15 Jun 2021, 06:20

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
antonioff
Posts: 2
Joined: 15 Jun 2021, 02:56

Re: swagfag

15 Jun 2021, 11:55

@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 := ""
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Script GTA:SA

15 Jun 2021, 12:16

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)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 120 guests