Openkore.com

OpenKore Forums
It is currently 19 Jun 2019, 03:17

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to use substr in macros.txt?
PostPosted: 25 May 2019, 09:02 
Offline
Noob
Noob

Joined: 20 Jun 2017, 14:26
Posts: 4
hello,
I need get third number from a lot of number

There are 10 random numbers,Every time is different

^5613265165

^2153261952

I found information about perl Function substr can help me get number

but how to use substr in macros.txt?

I tried like this:

automacro pp {
exclusive 1
run-once 1
map geffen
console /: \^(.*)/
call {
log $.lastMatch1
$aa = $.lastMatch1
$bb = @eval(substr($aa),3,1)
release all
stop
}
}

but not work,please help me,thanks before


Top
 Profile  
 
 Post subject: Re: How to use substr in macros.txt?
PostPosted: 26 May 2019, 03:55 
Offline
Been there done that!
Been there done that!

Joined: 24 Mar 2012, 04:13
Posts: 133
understand this pattern
http://jkorpela.fi/perl/regexp.html

console /\d\d(\d)\d\d\d\d\d\d\d/


Top
 Profile  
 
 Post subject: Re: How to use substr in macros.txt?
PostPosted: 26 May 2019, 12:40 
Offline
The Way Of Human
The Way Of Human
User avatar

Joined: 16 Aug 2009, 03:47
Posts: 192
Location: Gonryun
Just plain

Code:
/\d/


would be enough.

_________________
Just like old times.


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 2 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