Help with samp heal
Help with samp heal
Hello, i basically need a code that would work in game. The code must do this: When a player sends me a message with a keyword "Heal" or [ID] the code must type out "/heal (The name of the person who's sending me a message or ID)" just for the record the game is GTA San Andreas, I need this for SA-MP server. Can anoyone make a code for me or atleast help me?
Re: Help with samp heal
how is he sending "Heal"?
where you could read it? in a website?
is it a picture?
where you could read it? in a website?
is it a picture?
github>g_IntelliSense + next improvements + forum
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Help with samp heal
-Like /sms Warklot heal and i get message "heal"
-in the Documents>gta san andreas user files> samp > chatlog
-in the Documents>gta san andreas user files> samp > chatlog
Re: Help with samp heal
heal stands in the chatlog file?Warklot wrote:-Like /sms Warklot heal and i get message "heal"
-in the Documents>gta san andreas user files> samp > chatlog
so simply scan this file every second or so. works?
github>g_IntelliSense + next improvements + forum
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Help with samp heal
some guy asked for something similar a couple of days ago: https://autohotkey.com/boards/viewtopic ... hilit=samp
but they seem to have decided to overwrite the posts lol. what a drag...
but they seem to have decided to overwrite the posts lol. what a drag...
Re: Help with samp heal
dat code doesn't work;/swagfag wrote:some guy asked for something similar a couple of days ago: https://autohotkey.com/boards/viewtopic ... hilit=samp
but they seem to have decided to overwrite the posts lol. what a drag...
Re: Help with samp heal
what you mean by not work?Warklot wrote:dat code doesn't work;/swagfag wrote:some guy asked for something similar a couple of days ago: https://autohotkey.com/boards/viewtopic ... hilit=samp
but they seem to have decided to overwrite the posts lol. what a drag...
github>g_IntelliSense + next improvements + forum
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ahk..org>onlineAHKprettyfy, ahk..com>Refactoring
ahk..com>newposts Unanswrd myposts, Donations are appreciated if I could help you
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Help with samp heal
like someone writes to me "heal" andSL5 wrote:what you mean by not work?Warklot wrote:dat code doesn't work;/swagfag wrote:some guy asked for something similar a couple of days ago: https://autohotkey.com/boards/viewtopic ... hilit=samp
but they seem to have decided to overwrite the posts lol. what a drag...
Send % "t/heal " playerID "{Enter}"
doesn't work
maybe i'm doing something wrong , i'm newbie:D
Re: Help with samp heal
no, its unlikely it would work without making some modifications.
in the thread the guy need to have the last line of the chatlog checked whether it contained "heal", and the previous line ran through a regexp to extract the "playerID"
so, besides the chatlog path, ud have to change at least those 2 things for the script to work at all.
in the thread the guy need to have the last line of the chatlog checked whether it contained "heal", and the previous line ran through a regexp to extract the "playerID"
so, besides the chatlog path, ud have to change at least those 2 things for the script to work at all.
Re: Help with samp heal
mm can you help me?:D what to change:Dswagfag wrote:no, its unlikely it would work without making some modifications.
in the thread the guy need to have the last line of the chatlog checked whether it contained "heal", and the previous line ran through a regexp to extract the "playerID"
so, besides the chatlog path, ud have to change at least those 2 things for the script to work at all.
Re: Help with samp heal
swagfag wrote:no, its unlikely it would work without making some modifications.
in the thread the guy need to have the last line of the chatlog checked whether it contained "heal", and the previous line ran through a regexp to extract the "playerID"
so, besides the chatlog path, ud have to change at least those 2 things for the script to work at all.
so how to exract the playerd id through regexp? sorry i'm so dumb;/
Re: Help with samp heal
idk, i have no idea what ur chatlog.txt looks like
Re: Help with samp heal
swagfag wrote:idk, i have no idea what ur chatlog.txt looks like
Last edited by Warklot on 09 Oct 2018, 13:01, edited 1 time in total.
Re: Help with samp heal
look, i dont play samp, this is all gibberish to me
craft a regexp to match the ID. eg. assuming its a number enclosed in braces:
craft a regexp to match the ID. eg. assuming its a number enclosed in braces:
Code: Select all
RegExMatch("wasd {1234} asdf", "{\K[^}]+", match)
msgbox % match
Re: Help with samp heal
what does "{\K[^}]+" mean?:P sorry if its sounds dumb to you:Dswagfag wrote:look, i dont play samp, this is all gibberish to me
craft a regexp to match the ID. eg. assuming its a number enclosed in braces:Code: Select all
RegExMatch("wasd {1234} asdf", "{\K[^}]+", match) msgbox % match
Re: Help with samp heal
https://autohotkey.com/docs/misc/RegEx-QuickRef.htm
The escape sequence \K is similar to a look-behind assertion because it causes any previously-matched characters to be omitted from the final matched string. For example, foo\Kbar matches "foobar" but reports that it has matched "bar".
The escape sequence \K is similar to a look-behind assertion because it causes any previously-matched characters to be omitted from the final matched string. For example, foo\Kbar matches "foobar" but reports that it has matched "bar".
Re: Help with samp heal
[20:31:01] [SMS] [Mantuxx_Downhiller {00FF00}[P] {E3B924}(67) >> Rusteze_Dinoco]:swagfag wrote:https://autohotkey.com/docs/misc/RegEx-QuickRef.htm
The escape sequence \K is similar to a look-behind assertion because it causes any previously-matched characters to be omitted from the final matched string. For example, foo\Kbar matches "foobar" but reports that it has matched "bar".
[20:31:01] heal
Like if someone writes heal the program checks id example : (67) and heals that id
i don't know how to write that in ahk language
maybe its easier for you?:D like i know you are doing all the work, i appreciate that
Re: Help with samp heal
Code: Select all
secondToLast := "[20:31:01] [SMS] [Mantuxx_Downhiller {00FF00}[P] {E3B924}(67) >> Rusteze_Dinoco]:"
last := "[20:31:01] heal"
if (InStr(last, "heal") && RegExMatch(secondToLast, "(?<= \[SMS\] \[).*\((\d+)\) >>", M))
{
playerID := M1
MsgBox % "t/heal " playerID "{Enter}"
}
else
msgbox something went wrong
maybe the chatlog.txt isnt being opened, did u point the script to the correct file?
maybe ur chatlog.txt messages get prepended, instead of being appended to it. the script extracts and checks the last 2 lines from it
maybe the chatlog file is locked
Re: Help with samp heal
chatlog is open + i only need ID to get if in that sms he writes "heal".This line changing every time i get different sms "[20:31:01] [SMS] [Mantuxx_Downhiller {00FF00}[P] {E3B924}(67) >> Rusteze_Dinoco]:"swagfag wrote:the core logic works, so the regex should be the problem.Code: Select all
secondToLast := "[20:31:01] [SMS] [Mantuxx_Downhiller {00FF00}[P] {E3B924}(67) >> Rusteze_Dinoco]:" last := "[20:31:01] heal" if (InStr(last, "heal") && RegExMatch(secondToLast, "(?<= \[SMS\] \[).*\((\d+)\) >>", M)) { playerID := M1 MsgBox % "t/heal " playerID "{Enter}" } else msgbox something went wrong
maybe the chatlog.txt isnt being opened, did u point the script to the correct file?
maybe ur chatlog.txt messages get prepended, instead of being appended to it. the script extracts and checks the last 2 lines from it
maybe the chatlog file is locked
Who is online
Users browsing this forum: No registered users and 79 guests