Estecka's Recent Forum Activity

  • Into the "system" conditions, you have the loop "For each (ordered)"

    It will repeats an action once for every instance of an object, and can order them according to any of their variable.

  • I don't understand what you're trying to achieve, but you might want to take a look to the "pick" condition.

    For every object, there is a "Pick with Unique ID" condition, under the system condition, there are additional "Pick", that let you pick an object depending various other condition.

    Let know that if there is no condition affecting an object, the action will affect all of its instances.

    Beside the "Pick" condition, if you know any condition that affect the specific instance you want to pick, add it to you action and it should do the trick.

    • Send the bullet flying forth at (fixed speed)
    • Wait (random time)
    • Sends the bullet flying back at (fixed speed)
    • Wait (twice the previous time)
    • Start over
  • I made a code that analyze a provided HTML chunk to find all the occurences of a certain balise, and retrieve the unique data within each and every of these balises.

    It's a matter of about 200 (maybe 1.000) occurences per strings, from a file of 3 millions of caracters, with several of these files.

    So far with a shorter file of 32 occurences, it takes already 10 seconds to find them all, but with the bigger files, it take 44s to find only 32 of the occurence, so I expect 5mn to process the whole file.

    There are oblivious flaws in my code, it's kind of dirty, but I know no other way of going around.

    Most notably, I don't know how to retrieve more than one variable per regex test, and I don't know how to retrieve the Nth match of a regex variable if the variable has multiple match.

    As a result, my code looks like this:

    • Every tick, if the string match the regex (First test)
    • - Set a dictionnary entry to a RegexMatchAt() (Second test)
    • - Set the original string to a RegexReplace() (third test) to remove the previously gathered match, so it's not matched again.

    starts over at the next tick until done.

    38 millions caracters processed a three thousands times does sound like a lot of processing.

    The back of my mind is telling me I could gather all datas in a single test, but I just have no idea how.

  • I would remove the second wait and instead put its content into another event. I think the flash behavior has something like "on flash ending".

    I'm not sure whether destroying a flashing object triggers the event or not tho.

  • trueicecold Argh my bad. >_<

    I didn't spell the "no" in "no match". I'm so dumb.

    Yet I fail to understand, why do we need to escape the double-quote in the event, but not in the variable ?

  • trueicecold

    What's wrong in your example is that you didn't use echapped doublequotes. ( "" )

    I put href= alone in your textbox and got a match although it shouldn't work.

    In your case construct is actually testing for the regex href= , not the regex href=".+" which you should have written href="".+""

    However, it would work fine with href='.+'

  • I don't think so, a single double double-quote is enough to make the regex not match the string, so beside with far-fetched combinations of variables, which would break the whole point of using variables, I don't see how I could stealthily include a double-quote in there.

    Any moderator, I'm starting to wonder if it wouldn't be worth moving this into the bug section ?

  • 99Instances2Go

    Yes, I know that, that's what I've been doing up there: typing class=""x"" so it understands class="x", but yet it still only works half the times.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think I located the problem, but that doesn't come with a solution yet.

    It has to do with the fact I'm using " within the regex.

    Usually you can include a " within a string by typing it "", that's what I did with the event and it works there. Then I just copy-pasted the regex into the variable. The variable does work if I shorten my regex to a bit without "", but as soon as I bring it back it stops working.

  • So this is pretty simple:

    I have an event that test if a text matches a regex, so far it does nothing but telling me whether it does and it works prefectly, the text matches as intended.

    Then, because I plan to reuse the same Regex several times in the code, I decide instead to put it into a variable and call the variable.

    And as simple as this, it doesn't work anymore ?!

    The code is quasi-literally limited to this event, so I beside double-checking the spelling, I really have no idea where to look for a mistake. :/

    Update:

    It has to do with the fact I'm using " within the regex.

    Usually you can include a " within a string by typing it "", that's what I did with the event and it works there. Then I just copy-pasted the regex into the variable. The variable does work if I shorten my regex to a bit without "", but as soon as I bring it back it stops working.

  • Great! I ever wanted to insert projects into other projects in order to create a modular portfolio, thanks !

    This project aside, I seem to be unable to retrieve the innerHTML of a cross-domain origin iFrame... any way I can go around this ?

Estecka's avatar

Estecka

Member since 21 Dec, 2015

None one is following Estecka yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies