Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved regex on eventMacro plugin (Runner.pm) #1205

Closed
wants to merge 3 commits into from
Closed

Improved regex on eventMacro plugin (Runner.pm) #1205

wants to merge 3 commits into from

Conversation

Nipodemos
Copy link
Contributor

hello again

this pull request now add the possibility to save values you get from regex!!
for example:

$phrase = Name: Nipodemos, Age: 21
if ($phrase =~/Name: (w+)\, Age: (\d+)/ ) {
    log name is: $.lastMatch1
    log age is: $.lastMatch2
}

output:

[eventMacro log] Name is: Nipodemos
[eventMacro log] Age is: 21

this can be VERY helpful in macros, for example when you want to get an specific part of a BusMsg (like coordinates you send)
or when you in your merchant and receives the privMsg asking for an item, you can get the name of item e trigger acoordingly

Also, i've added more comments and changed the name of a few variables, because it was SO HARD trying to find out the logic behind the hole statement process, i hope this helps other people when it goes to change this file 😃

Copy link
Member

@sctnightcore sctnightcore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i want it !!

@Nipodemos
Copy link
Contributor Author

i am closing my PR temporaly until henryBk have free time to evaluate them ( dont know when )

@Nipodemos Nipodemos closed this May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants