need help with reading minecraft chat
-
- Posts: 9
- Joined: 27 Nov 2021, 19:37
need help with reading minecraft chat
Hey, im currently trying to make a script that reads the minecraft chat, and if the keyword "reset" comes, it presses y and 30 seconds after that o. This is the log file path:C:\Users\Henry\AppData\Roaming\minecraft\mods2\logs\latest.log
Re: need help with reading minecraft chat
Hi there, drop a sample from the log file.
Re: need help with reading minecraft chat
Code: Select all
#Persistent
log = %A_AppData%\minecraft\mods2\logs\latest.log
word = reset
If !FileExist(log) {
MsgBox, 48, Error, File not found. Aborting. `n`n%log%
Return
} Else SetTimer, Check, 1000
Check:
FileGetTime, modTime, % (log, lastModTime := modTime)
If (modTime = lastModTime)
Return
FileRead, logText, %log%
lastPos := pos, pos := RegExMatch(logText, "is).*\K\b" word "\b")
If !pos || pos <= lastPos
Return
Send y
SoundBeep, 1500
Sleep, 30000
Send o
Return
Who is online
Users browsing this forum: No registered users and 40 guests