ereinion
Member
Hi! I wrote this little code-snippet to parse what effects I currently have active:
However it doesn't seem to work. It's not really a big deal if I don't get this to work, as I discovered the my_effects() function, but I am curious about where I failed in creating the pattern. It seemed to work when I tested it at http://www.myregextester.com/ (see images), but I suppose I have failed somewhere in the translation to ash 

- edit - So after thinking a bit more on this, I remembered that visit_url() probably captured the unaltered html of charpane.php, while I was using the html that had been altered by mafia. Having had a look at the orginal html, I changed the pattern to "(?<=alt\\=\\\"Click to cast )([\\w\\s]+)(?=\\.)"; //", which seems to work, but now my for-loop only posts the first (last?) entry in each capturing group (why are there two). So how do I print out each of the effects found?
Code:
//script "extend_all"
//author "ereinion"
void main() {
string charpane = visit_url("charpane.php");
string pattern = "(?<=\"Increase rounds of \")([\\w\\s]+)(?=\\\")"; //"
matcher effects = create_matcher(pattern, charpane);
int i;
print(pattern);
if (effects.find()) {
for i from 0 to group_count(effects) {
print(i + " - " + effects.group(i));
}
}
}



- edit - So after thinking a bit more on this, I remembered that visit_url() probably captured the unaltered html of charpane.php, while I was using the html that had been altered by mafia. Having had a look at the orginal html, I changed the pattern to "(?<=alt\\=\\\"Click to cast )([\\w\\s]+)(?=\\.)"; //", which seems to work, but now my for-loop only posts the first (last?) entry in each capturing group (why are there two). So how do I print out each of the effects found?
Last edited: