delete i guess Topic is solved
Re: Need help with samp
No one?
Re: Need help with samp
No one?
Re: Need help with samp
I don't understand, could you give an example of the code you have so far?
Re: Need help with samp
maybe post a bigger sample of this chatlog.txt
also it would be useful to know how it gets filled up. are entries appended? do they appear at the top? are 2 messages('sms' and 'heal') always fired simultaneously? has it ever occurred that a totally unrelated message has snuck in between?
also it would be useful to know how it gets filled up. are entries appended? do they appear at the top? are 2 messages('sms' and 'heal') always fired simultaneously? has it ever occurred that a totally unrelated message has snuck in between?
Re: Need help with samp Topic is solved
Code: Select all
#NoEnv
#Persistent
#SingleInstance Force
SendMode Input
SetBatchLines -1
CHATLOG_PATH := A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt"
SetTimer WatchChatlog, 50
WatchChatlog:
FileRead chatlog, % CHATLOG_PATH
if (chatlog != lastChatlog)
{
Lines := StrSplit(chatlog, "`n", "`r")
last := Lines.Pop()
secondToLast := Lines.Pop()
if (InStr(last, "heal") && RegExMatch(secondToLast, "(?<= \[SMS\] \[).*\((\d+)\) >>", M))
{
playerID := M1
Send % "t/heal " playerID "{Enter}"
}
}
lastChatlog := chatlog
Return
Who is online
Users browsing this forum: Bing [Bot] and 28 guests