Openkore.com

OpenKore Forums
It is currently 21 Oct 2017, 11:41

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Doubt with regexp
PostPosted: 15 Sep 2017, 17:57 
Offline
Noob
Noob

Joined: 04 Apr 2008, 14:21
Posts: 16
I have the following automacro

Code:
automacro AspersioOthers {
   console /\[dist=(.*)\] (.*) \((\d+)\): \*asp|aspersio|holy|asper|aspe\*$/
   status Blessing
   status Increase AGI
   sp > 30%
   run-once 1
   timeout 30
   exclusive 1
   overrideAI 1
   call {
      do ai manual
      $dist = $.lastMatch1
      if ($dist > 6) stop

      $name = $.lastMatch2
      $PlayerID = $.lastMatch3
      pause 1
      do sp 68 $PlayerID 5
      log  Finish macro: AspersioOthers at $.datetime
      pause 1
      do ai on
      release AspersioOthers
   }
}


The macro works fine except if the entered text is "asp" or "aspe" (forgot to try with "holy"). The same happens with an automacro that buffs, it works with many variations except, for example, "agi". Is there any way to make it work with "asp", etc?


Thanks.


Top
 Profile  
 
 Post subject: Re: Doubt with regexp
PostPosted: 16 Sep 2017, 15:44 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 325
Code:
/\[dist=(.*)\] (.*) \((\d+)\): \*asp|aspersio|holy|asper|aspe\*$/


this is incorrect....
1.| splits parts only inside () else it splits all message...
2. use \s* as replacement for possible spaces
3. do u really need \* there? cause it will trigger only like *holy* message
4. $ is not really needed there...

Code:
/\[dist=(.*)\] (.*) \((\d+)\):\s*\*(asp|aspersio|holy|asper|aspe)\*/

_________________
Please use pin function for uploading your file contents!


Top
 Profile  
 
 Post subject: Re: Doubt with regexp
PostPosted: 16 Sep 2017, 21:58 
Offline
Noob
Noob

Joined: 04 Apr 2008, 14:21
Posts: 16
i tried your modifications and the macro stopped working at all. after several tries, i ended up with

Code:
/\[dist=(.*)\] (.*) \((\d+)\): (asp|aspersio|holy|asper|aspe)/



which is the simplest way to go. that happens when you base your macro on an old macro


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group