delete i guess Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Malka
Posts: 5
Joined: 29 Sep 2018, 03:52

delete i guess

29 Sep 2018, 04:05

.
Last edited by Malka on 04 Oct 2018, 05:57, edited 1 time in total.
Malka
Posts: 5
Joined: 29 Sep 2018, 03:52

Re: Need help with samp

01 Oct 2018, 07:13

No one?
Malka
Posts: 5
Joined: 29 Sep 2018, 03:52

Re: Need help with samp

01 Oct 2018, 07:13

No one?
User avatar
Onimuru
Posts: 107
Joined: 08 Sep 2018, 18:35
Contact:

Re: Need help with samp

01 Oct 2018, 15:10

I don't understand, could you give an example of the code you have so far?
Malka
Posts: 5
Joined: 29 Sep 2018, 03:52

Re: Need help with samp

03 Oct 2018, 09:58

.
Last edited by Malka on 04 Oct 2018, 05:57, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Need help with samp

03 Oct 2018, 10:44

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?
Malka
Posts: 5
Joined: 29 Sep 2018, 03:52

Re: Need help with samp

03 Oct 2018, 11:36

.
Last edited by Malka on 04 Oct 2018, 05:57, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Need help with samp  Topic is solved

03 Oct 2018, 15:09

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

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 28 guests