Macro Mods

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Macro Mods

#1 Post by sli »

So I have a fully modded macro plugin. What I want to discuss are the reasons why the macro plugin isn't being maintained despite having a huge appeal. ("Because it's arachno's plugin" is not a reason.) I'm debating just committing this modded macro plugin myself.
cs : ee : realist
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: Macro Mods

#2 Post by h4rry84 »

as long it's stable, why must denying improvements ?
sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: Macro Mods

#3 Post by sli »

Because the improvements are nice. I like the localtime mod and I don't see any reason why it shouldn't be added, along with just about all of the other ones.
cs : ee : realist
Click
Human
Human
Posts: 39
Joined: 15 Apr 2008, 06:08
Noob?: Yes
Location: Russia, Velikiy Novgorod

Re: Macro Mods

#4 Post by Click »

need change macro plugin for work
@eval(43+@rand(10,30))
and
@rand(10,30)+@rand(10,30)
Click
Human
Human
Posts: 39
Joined: 15 Apr 2008, 06:08
Noob?: Yes
Location: Russia, Velikiy Novgorod

Re: Macro Mods

#5 Post by Click »

pls test it
plugins/macro/Parser.pm:

Code: Select all

+use Text::Balanced qw/extract_bracketed/;

sub parseKw {
-   my @pair = $_[0] =~ /@($macroKeywords)s*(s*(.*?)s*)/i;

+   my @full = $_[0] =~ /@($macroKeywords)s*((s*(.*?)s*).*)$/i;
+   my @pair = ($full[0]);
+   my ($bracketed) = extract_bracketed ($full[1], '()');
+   return unless $bracketed;
+   push @pair, substr ($bracketed, 1, -1);
   
   return unless @pair;
   if ($pair[0] eq 'arg') {
      return $_[0] =~ /@(arg)s*(s*(".*?",s*d+)s*)/
   } elsif ($pair[0] eq 'random') {
      return $_[0] =~ /@(random)s*(s*(".*?")s*)/
   }
   while ($pair[1] =~ /@($macroKeywords)s*(/) {
-      @pair = $pair[1] =~ /@($macroKeywords)s*((.*)/

+      @pair = parseKw ($pair[1])
   }
   return @pair
}

Code: Select all

macro test {
   log @eval (@eval (1 + 2) * 3) @eval (4)
}

Code: Select all

macro test
eval; @eval (1 + 2) * 3;
eval; 1 + 2;
eval; 3 * 3;
eval; 4;
[macro][log] 9 4
You do not have the required permissions to view the files attached to this post.