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

[eventMacro.pl] Added &strip() #1124

Merged
merged 5 commits into from
Aug 1, 2018
Merged

[eventMacro.pl] Added &strip() #1124

merged 5 commits into from
Aug 1, 2018

Conversation

Mortimal
Copy link
Contributor

Added &strip() as temporary fix for #1123.

@lututui
Copy link
Member

lututui commented Sep 13, 2017

This takes away the () from the match?

@Mortimal
Copy link
Contributor Author

Mortimal commented Sep 13, 2017

this ads &strip() function which can be used to remove ( ) from $. vars like

automacro monster {
 SimpleHookEvent target_died
 call monster2 
 } 
macro monster2 {
	if (&strip($.SimpleHookEventLastMonster) =~ /Poring/) {
	 log yes
	 stop
	}
	log not
	stop 
}

Because normal fix is just impossible... now The problem is a logic of parsing conditions which not separating any of condition parts til the end...

@lututui
Copy link
Member

lututui commented Sep 16, 2017

Doesn't this have the same behavior
if (&strip($.SimpleHookEventLastMonster) =~ /Poring/) {
as this
if ($.SimpleHookEventLastMonster =~ /Poring/) {
?

@lututui lututui added the plugin label Sep 16, 2017
@Mortimal
Copy link
Contributor Author

Mortimal commented Sep 16, 2017

if ($.SimpleHookEventLastMonster =~ /Poring/) {

this will be error because of #1123

$.SimpleHookEventLastMonster contains Poring (\d) and if \d not 0 or 1 condition parser gives error... I'll fix that error when totally rewrite condition parser.

@Nipodemos
Copy link
Contributor

@Mortimal do you have irc or discord? i would like to discuss some improvements on eventMacro, and two heads think better than one 😄

Copy link
Contributor

@Nipodemos Nipodemos left a comment

Choose a reason for hiding this comment

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

it is valid, i had the same issue once, it is an workaroud, since normally is impossible as he said

@Nipodemos
Copy link
Contributor

just tested and is working fine

@Nipodemos Nipodemos merged commit d2ff04e into OpenKore:master Aug 1, 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