Could You guys help me with the script for GTA samp server? I will repay in donations
I need a script that reads from chat log file and If appears in the file
"You caught Seriol, weighing 43 kg." and the number of x kg is greater than 80kg it will type "/fishing", but if the value is less than 80kg it will type "/thorwfish". And so until it catches a maximum of 4 fish, so it must have 4 fish over 80 kg. Sometimes, after entering the command "/fishing", the system gives the following messages:
You caught Sausage so you eat it!
You caught old pants, so you put them on!
You caught the lard, so you eat it!
You grabbed a money purse, you found $ x inside
The line broke!
The script should bypass these messages.
So far, I only have a command that reads a given phrase from the file and does something when it appears.
Reading text from chatlog file and make actions
Re: Reading text from chatlog file and make actions
Here is a starting point, but it sounds like-- and not described-- you actually want to read the file as it is being generated. To accomplish that, you could process the file and then delete it, and read it again, in a loop.
Code: Select all
log := A_Desktop "\log.log", n := 0
If !FileExist(log) {
MsgBox, 48, Error, File not found.`n`n%log%
Return
}
Loop, Read, %log%
{
RegExMatch(A_LoopReadLine, "You caught Seriol, weighing \K\d+?(?= kg)", kg)
If !kg
Continue
If (kg >= 80) {
Send /fishing`n
If (++n < 4)
Continue
MsgBox, 64, Done, You won!
Return
} Else Send /throwfish`n
}
Re: Reading text from chatlog file and make actions
Can you share IP address of server Gta San Andreas multiplayer?
I can join and share scripts for you.
I can join and share scripts for you.
I have & am using AHK to do anything in windows microsoft.
The first time, I know it in around year 2013.
Re: Reading text from chatlog file and make actions
@mikeyww
Thanks for your help The file is generated in the location C:\Users\PC\Documents\GTA San Andreas User Files\SAMP\chatlog.txt. How can I link this file to the script?
Thanks for your help The file is generated in the location C:\Users\PC\Documents\GTA San Andreas User Files\SAMP\chatlog.txt. How can I link this file to the script?
Re: Reading text from chatlog file and make actions
@ThewarII
Its Polish server. I have translated the commands. It's a basic fishing script like one on samp.hzgaming.net:7777
Its Polish server. I have translated the commands. It's a basic fishing script like one on samp.hzgaming.net:7777
Re: Reading text from chatlog file and make actions
You can update the first line.
Code: Select all
log := A_MyDocuments "\GTA San Andreas User Files\SAMP\chatlog.txt", n := 0
Re: Reading text from chatlog file and make actions
Tell me your server is playing.
I will make script fishing for you when i can.
I will make script fishing for you when i can.
I have & am using AHK to do anything in windows microsoft.
The first time, I know it in around year 2013.
Who is online
Users browsing this forum: No registered users and 79 guests