Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

HTML5 Client Questions and Such

191011121315»

Comments

  • AntoniusAntonius Member Posts: 5,040 @@ - Legendary Achaean
    If that's supposed to be JavaScript, and N is the length of the array you're iterating over, that should be either for(var i = 0; i < N; i++) or for(var i = 0; i <= N-1; i++). If you include N, or even worse N+1, you're going to retrieve elements that don't exist, and unless your code explicitly handles undefined you'll end up with errors thrown.
  • AntoniusAntonius Member Posts: 5,040 @@ - Legendary Achaean
    Kiskan said:
    And from what I see, Lua is not "totally undoable", but it definitely throws me (though not as much as what I saw of JS, which made me nope nope nope out of the gate).  
    If your main argument is that Lua is confusing for a total novice programmer, then I don't really know what to tell you. I think if you struggle with Lua then you'll struggle with literally any other language a MUD client might choose to support; Python isn't really any easier to learn, and I don't remember the documentation being any better.

    My (almost totally uninformed) opinion is that well written - and, perhaps, this is where things start to fall down since the majority of players write the most atrociously formatted code - Lua is among the easiest of any code to read, because the syntax it uses is the closest to actual English.
  • NazihkNazihk Member Posts: 993 @ - Epic Achaean
    Antonius said:
    If that's supposed to be JavaScript, and N is the length of the array you're iterating over, that should be either for(var i = 0; i < N; i++) or for(var i = 0; i <= N-1; i++). If you include N, or even worse N+1, you're going to retrieve elements that don't exist, and unless your code explicitly handles undefined you'll end up with errors thrown.
    Yeah I realized that I messed that one up about 2 minutes too late
  • NazihkNazihk Member Posts: 993 @ - Epic Achaean
    Wait, no, I just meant that  i<=N is better than i < N+1 when he's doing lua for loops where N=5 is 1-5 instead of 0-4.

    I probably should avoid things like this at 3am. Bleh. 
  • AhmetAhmet Wherever I wanna beMember Posts: 3,370 @@ - Legendary Achaean
    @Nazihk
    First: for i=1,n,1 works just fine.

    Second: most iterating over tables uses ipairs(), so, theres that.
    Huh. Neat.
  • TectonTecton The Garden of the GodsAdministrator Posts: 2,507 Admin
    While I'm sure we could debate the merits of the various programming languages and their implementations, let's try to keep this thread for questions/feedback about Nexus please!
    KilianIniar
  • IniarIniar Member Posts: 80 ✭✭✭ - Distinguished
    Nazihk said:
    Wait, no, I just meant that  i<=N is better than i < N+1 when he's doing lua for loops where N=5 is 1-5 instead of 0-4.

    I probably should avoid things like this at 3am. Bleh. 
    Me too.
  • MarmidonMarmidon Member Posts: 16
    New player here, trying to figure out the basics. How would I use the @match variable in this case? I tried "@match" and "match", but both did not work for me.


  • MarmidonMarmidon Member Posts: 16
    So, after outputting "@match", it seems like it is an object. Is there any way to inspect it?
  • MarmidonMarmidon Member Posts: 16
    For anyone wondering the same, this event seems bugged, I could not make it work, even after reading all their help files.

    Similar trigger could be achieved through script - add this to onGMCP function. 

    args.gmcp_args.name == 'prone' - you can put any affliction name here

    // Place any code here you'd like to run when a GMCP message is received
    // - The GMCP message is received as "args.gmcp_method" and "args.gmcp_args"

    if (args.gmcp_method == 'Char.Afflictions.Add' && args.gmcp_args.name == 'prone') { 
        display_notice('I AM PRONE');
    }
  • GoodwillorGoodwillor Member Posts: 1
    Hi, Cromm, whenever i try loading Achaea.com on chrome i get a message --- That page doesn't seem to exist.
Sign In to Comment.