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

HTML5 Client Questions and Such

CrommCromm Posts: 41Member ✭✭ - Stalwart
edited August 2012 in Client Help
Hello, all! I'm the guy responsible for the new HTML5 Client, and I thought it high-time I made myself available to anyone using the client for any questions, concerns, ideas, etc. you might have.

So lay it on me. Can't get a trigger to work like you want it to?  Something breaking?  Random javascript question?  Idea for the fancy-logger?  I'll do my best to help wherever I can. 

The client is very much a work in progress, so I look forward to your ideas and to helping figure stuff out that needs figuring out.  Thanks a million!

- Cromm


  • EiredhelEiredhel CaliforniaPosts: 602Member
    I was always a little confused as to how to set up delays on it... But I'm not very savvy with this stuff at all, so that may be why... I read the manual and tried what it suggested and it didn't work. (this was about two months or so ago though)

    Meow, meow, etc. 
    Eiredhel's Family Tree

  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    edited August 2012
    Eiredhel said:
    I was always a little confused as to how to set up delays on it... But I'm not very savvy with this stuff at all, so that may be why... I read the manual and tried what it suggested and it didn't work. (this was about two months or so ago though)
    Assuming you just mean "do something in 2.5 seconds" or something similar, you can do something as simple as this (in a function or trigger's script block):

    setTimeout(function () {
         // Do something useful here //
         send_direct("em drops it to the flo'."); // Send a command to the game //     
         print("You just dropped it to the flo'.", "red"); // Print something locally (in red) //     
         run_function("apply_frost"); // Cause it's getting hot in here //    
    }, 2500); // That's 2500 milliseconds, or 2.5 seconds //

    Likewise, if you want to run something every 2.5 seconds, just do something like this:

    var health_timer = setInterval(function () {
         // Check your current health, send a sip command if necessary, etc. //          
    }, 2500);

    Then, if you want to stop that function from running every 2.5 seconds, run:


    Let me know if that helps clear it up (and I'll be updating the manual pretty extensively soon -- I'll try to make sure this is covered there).

    - Cromm

  • NessyNessy Posts: 4Member
    I use nexus client and I know nobody really likes nexus anymore but I do and I don't want to switch however I'm having issues with it every time I try to go to the page it gets to 15 percent and I get this:

    --[ Task ]--

    Client initialization

    --[ Environment ]--







    os.name=Windows XP


    java.vendor=Oracle Corporation




    --[ Exception ]--

    java.lang.RuntimeException: Invalid skin file: media/skin.jar

                    at nexus.Main.run(Main.java:230)

                    at java.lang.Thread.run(Unknown Source)

    I tried reinstalling java and that seemed to help briefly then it started doing it again. I'd think it was a java update but I have java set up to ask me before it installs updates

  • TaalTaal Posts: 4Member
    I'm having trouble logging in, I sign in and get to the client page, but the window doesn't pop-up, I'm also using mudlet, and the same thing happens, the screen goes blank, then repeatedly attempts to load the file, I've tried this on several computers and it seems the same on each of them...
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    @Nessy - Sorry I can't help with that one!  This thread is for the client at http://client.achaea.com, specifically.  Maybe someone else can answer (though I'd suggest opening a separate thread).

    @Taal - Are you saying that both the HTML5 client (at the address mentioned above) and Mudlet are failing to allow you to sign in?  If that's the case, I have no idea what to tell you other than to check with the admin.  If it's just Mudlet that's failing, it may be your profile in Mudlet. Please clarify just a bit so we can get you pointed in the right direction.

  • XandiaXandia Posts: 2Member
    I'm having major problems with figuring out a simple hunting script. Inside the client, I can do st tar rat and get a target of rat. But when I try setalias 2 tunesmith rapier accentato| jab &tar I only get the first part and no actual jabbing done. In the settings page, I can make an alias for 2 to read tunesmith rapier accentato| jab &tar and both parts work, but it can't read my target and so says nothing by that name (rat) is there. I can't figure out how to set a variable target in the settings page, so am left with making an alias for each and everything I hunt to make sure it recognizes rat, goat, scorpion, etc....which gives me an attack alias for every number on the keyboard. I am not very scripting literate, so I can't figure out the instructions for making variables. Please help?
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    Sorry for the confusion!  You're actually working with two different variable and alias setting systems here.  Let's start with the first example.

    "setalias 2 tunesmith rapier accentato | jab &tar" will cause problems because the command stack separator is a feature of the client, not the game, so here's what's actually happening:

    1) You're setting the alias "2" to execute "tunesmith rapier accentato"


    2) The client sends the command "jab &tar"

    In the second example (setting an alias in the CLIENT settings window), you're using &tar, which is a GAME variable.  It looks like the syntax you're using to set that variable "st tar rat" is correct, so I'm not sure why that wouldn't work -- once the game gets the jab &tar command it should react normally.

    In any event, the client has its own variable system.  To set a variable, you can just type @set tar rat, then in the alias you add in the Settings window, just change &tar to @tar and it should change it to "jab rat" before it sends it to the game.  You can confirm that this is happening correctly by turning on the "Echo my input locally" option on the General tab.

    Hope that clears things up.  I would recommend sticking to one or the other of the targeting and alias systems -- the game's or the client's -- but not both.  Let me know if you need further help.

  • XandiaXandia Posts: 2Member
    That worked! Thank you! And I like the settings page more than using the game page, but I was desperate and ready to try anything. I hope your new manual discusses variables in a way that amateurs get enough information to script their own. I did well with variables in nexus, but I like the html5 client better and would love to be able to understand it. Thanks again!
  • AoklinAoklin Posts: 13Member
    greetings.  I have some questions regarding the bindings.  How can I bind a function?  I can't seem to figure it out....
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    Hello there!

    Currently, the way this works is as follows:

    1) Add a function on the functions tab with the code you want to execute. Let's call it "test" (without the quotes)
    2) On the Aliases and Bindings tab, click the Set New Binding button, then press the key combo for the new binding
    3) When it asks you for the command to send, you can simply enter the name of the function you created (test, in our case) and the client will execute it rather than send it to the game.

    If you need to pass an argument to your function, when you're entering the command to send, just enter the name of the function, a space, and whatever argument you want to pass to the function.

    For example, let's say you want to add a custom movement function using the number key pad:

    1) Add a function called "move" (again, no quotes) with the code:

    // Move in the direction specified //
    var direction = args;

    2) On the Aliases & Bindings tab, click "Set New Binding," then press the "8" key on your number pad, then enter the following in the dialog asking for what to send:

    move north

    And that's it!  When you press 8 on the number pad, you should see the client send "north" to the game (you can verify this when you're disconnected by turning on the "echo my input locally" option on the General tab).

    Sorry for the overly simplistic example, but it illustrated the idea. :)

    Let me know if you need anything else!
  • AoklinAoklin Posts: 13Member
    Perfect thanks! I will try it out, I kept putting someting like this for the binding: functionName(param)

    Now ill try: functionName param

    As u suggested, thanks!
  • CronoCrono Posts: 45Member ✭✭✭ - Distinguished
    Still not clear on the timers thing.  Trying to set up a defup alias for some defenses that have balances and I was going to use timers since I don't know what I'm doing.
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    The examples above should be fairly copy-and-pasteable.  You'd just want to use the send_direct() method within the important block and change what you're sending to something like:

    send_direct("conjure ghost");

    Let me know if you'd like a more specific example (and tell me what you want to send and after what period of time).
  • BarryBarry Posts: 5Member
    hii ,i use html5 , recently my charcater gets stuck when  i cross certain plane and after some time the maps come then it starts again and many times it just hangs , pleaase suggest what should i do ?
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    edited December 2012
    @Barry - Not sure what's going on there.  Can you be a little more specific about the location that starts to screw things up?  Thanks!

    Edit: Disregard -- it's doing it all over the place. Looking into the problem now.
    Post edited by Cromm on
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    Quick update - if anyone had performance problems with the map and changing areas, it's not been resolved. Sorry for the hassle!
  • AoklinAoklin Posts: 13Member

    I am having issues logging into the client.  I have no problem through Mudlet, but using the HTML5 client in Chrome from pc or from my Nexus 7 won't let me login.  It just brings the login screen back up.  Any suggestions?  This just started happening today, has been working so far up to this point.
  • AoklinAoklin Posts: 13Member
    I also want to note that I seem to have issues with running functions in the Firefox on my Nexus 7 versus Chrome.  Not a huge issue, just thought I would mention it.
  • BarryBarry Posts: 5Member
    i have same problem that aoklin has i cannot login in the game from today , the system gives Uncaught ReferenceError: $ is not defined
    i got to enter after 4 hours and i got booted in 15 mins and i got stuck and could not log in again
    p.s i have unistalled and installed my broweser, still same eror
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    Sorry for the long delay, folks.

    I can't replicate the login issues in either Chrome or Firefox - can you confirm browser, browser version, and operating system for me (Barry, in particular)? You might also try clearing your browser's cache, then reloading the client and trying.

    As to the function problems in Firefox, can you be a bit more specific (give me an example function that isn't working)? You can e-mail me at [email protected] if you'd prefer.

  • BarryBarry Posts: 5Member
    Sorry for the long delay, folks.

    I can't replicate the login issues in either Chrome or Firefox - can you confirm browser, browser version, and operating system for me (Barry, in particular)? You might also try clearing your browser's cache, then reloading the client and trying.

    As to the function problems in Firefox, can you be a bit more specific (give me an example function that isn't working)? You can e-mail me at [email protected] if you'd prefer.

  • BarryBarry Posts: 5Member
    my client started again just now,i dont know how, but it works again 
    thanks for responding so soon 
    i have a different doubt too 
     it is about regex - how can i regex a specific word can you help please 
    means can we do it ?
    since i make regex of full sentences 

  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    Not sure what you mean, so let's take an example....

    Say you want to trigger on the word hammer in the sentence "Bob likes to hit things with his hammer."

    You should be able to simply enter the word hammer as the trigger criteria, then specify whatever actions you want to for the trigger. 

    If you're not sure what Bob likes to hit things with (you need to capture the word after "with his..."), try something like this for the criteria:
    likes to hit things with (?:his|her) (.+)\.

    The most important part of that is the (.+) that will capture a word or phrase that you can then access using args[1] in the trigger script.

    Does that help?

  • BarryBarry Posts: 5Member
    awesome thanks i will try
  • AoklinAoklin Posts: 13Member
    Sorry about not responding, usually pretty good about it... anyway, my html5 client is working fine now, maybe just a fluke before.  Anyway, seperate question!

    It seems simple...but I can't seem to "return" anything from a function.  For example:

    I have a "Settings" function, called fxSettings(param);

    So, I do something like:
    var _val = run_function('fxSettings',"value");

    my fxSettings function:
    var _output = null;
    case "value":
    _output = "something";
    return _output;

    But I keep getting an error:
    "Error in Function[fxSettings]"
    "SyntaxError: Illegal return statement"

    if I run a "print(_output)" in the function, it will print out "something".  So the function is working, just not able to return it seems...I feel like I am missing something simple here...

  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    It's simple and it's not....

    "User Functions" -- those scripts listed on the functions tab -- are not TRUE javascript functions. Rather, they are just blocks of arbitrary code that are executed (safely) in the global scope, so there's nothing to return from.

    What I would do to mitigate the circumstance is to create a standard Javascript function called fxSettings inside your onLoad "User Function" (some craftier naming may have been better here...).

    So in onLoad:, do something like this:

    var fxSettings = function (args) {
    var _output = null;
    switch(args) { 
    case "value": 
    _output = "something";
    return _output;

    Then, wherever you need to call it in your scripts, do this:
    var _val = fxSettings("value");

    Instead of using the run_function method.

    Let me know if that doesn't make sense!
  • AoklinAoklin Posts: 13Member
    Ahh, I see, I didn't realize that.  That makes sense and explains some other things...  I will give this a shot.  I am determined to make a system I can use on my nexus 7!  Thanks!
  • AsyruAsyru Posts: 10Member
    edited February 2013
    I know that there is a way to get information from the game (like health and mana in the auto-sipping reflex). Would you explain what other information is available and how i would access it? Also, how would i go about making a local chat window or a chat window that has all chats in it?

    Post edited by Asyru on
  • AoklinAoklin Posts: 13Member
    Asyru, as far as I know you can use the gmcp event information to get that.  You can look up gmcp for mudlet and it will explain what info you can get back, then you can use the same process as the auto sippers to get that info in the HTML5 client.

    Check out this link for info: http://www.ironrealms.com/mudlet

    As for the chat window, I am doing that exact process... and it is a bit complicated, but not impossible.  You need to create a dialog window that is attached to the client.  You can use jquery for this.  Then you need to use a trigger on the various chat channels to capture the line and 1) remove it from the main window and 2) append it to a <div> or <table> element in your created dialog.

    I was going to show you an example but i can't seem to login right now...Go here: http://api.jquery.com/  and look up .dialog() and .append() and it should help illustrate the concept.  When I can connect I will try and post some sample code if I can.
  • CrommCromm Posts: 41Member ✭✭ - Stalwart
    Good overview, @Aoklin.

    I'll only add that if you want a quick way to see most of the GMCP data you're receiving from the game, take a look at the onGMCP function on the functions tab, then uncomment the line that says:
    print(args.gmcp_method + '<br/>' + JSON.stringify(args.gmcp_args));

    That will print all of the GMCP calls that are being sent to the main output window (it'll be spammy though -- make sure to add the // back to the beginning of the line when you're done, and do it somewhere safe!). You might want to turn logging on before you do it so you can review it later.

    Good luck!
Sign In to Comment.