I'm using lusternia's client, how do I begin coding basic triggers for it?

I've got no coding skills whatsoever, but I'm willing to learn. Any suggestions?
is dead like the dodo

Comments

  • Which client? Java-client, Flash-client, HTML5-client?
    image
  • The IRE game client. The one that comes packaged with the game.
    is dead like the dodo
  • Hmm. Do you go to www.lusternia.com and just click "Play now"?
    image
  • yes, that's what I do. 
    is dead like the dodo
  • Then it's the HTML5 client. Which is good news! At the bottom right, you've got a "help" icon. Click it, and you have a scripting guide and some examples to the left.
    image
  • thanks!
    is dead like the dodo
  • err...I've read the guide....is there a cliffnotes version for scripting with regular expression?

    Where do I start? How do I start? 
    is dead like the dodo
  • Regular expressions are used when matching stuff. There are a couple of things to note about them:

    Anything you want to save for use in the script should be placed in parentheses. Otherwise it will only be used to match.

    You can match variable strings by using wildcards. A period matches any character. Brackets can be used to specify which characters should be matched.

    Along with wildcards, you can also use modifiers to decide how much you want to match. By default, they match one character. If you place + after the wildcard, you match one or more. An asterisk behind it means none or more.

    Example: My prompt might look like "100h, 100m, 10000e, 10p, 10000w ex-". I want to get the health out of that (ignoring that there are easier ways). I thus create a trigger that looks like this:

    "([0-9]+)h, ([0-9]+)m, ([0-9]+)e, ([0-9]+)p, ([0-9]+)w"

    I use brackets to specify that I'm looking for characters between 0 and 9 (i.e. any digit). Behind I put a + to say I want one or more digit. Further, I place them in parentheses because I actually want to use the values.

    I couldn't think of anything fancy to do though, so all that trigger does is this:

    print("Health: "+args[1]);

    Which just prints out the first matched captured value (i.e. my health). If I wanted to use my mana, I'd use args[2] etc.

    Note that this is a _very_ boiled down version of what you can do with regex. If you want to see it all (and then some), have a look at http://en.wikipedia.org/wiki/Regular_expression
    image
  • Yup, it's given me a clear understanding of what RegEx is. thanks!
    is dead like the dodo
Sign In or Register to comment.