Nexus for noobs
i just wanted to kick off a discussion for those of us who are “JavaScript Challanged” and rely on simplified scripting in Nexus.
Questions. Answers. Tips and tricks... everything goes.
I’ll start with a question. How do you add a line break in Nexus “show text”? When I kill a mob, I’d like a reinforced message that breaks into several lines, but I can’t figure out how to break in in the input box. Thus far, I’ve tried /n and <br>, neither worked. Thoughts?
Questions. Answers. Tips and tricks... everything goes.
I’ll start with a question. How do you add a line break in Nexus “show text”? When I kill a mob, I’d like a reinforced message that breaks into several lines, but I can’t figure out how to break in in the input box. Thus far, I’ve tried /n and <br>, neither worked. Thoughts?
1
Comments
Edit- Also, if you really want the text to stand out, reverse the colors. You can totally have black text on a red background.
System is old (that's why I play MUDs and not graphical) and I'm using chrome.
I keep getting random health changes during spars (probably bleeding) without a message to go with them. I'd really like knowing how much each attack is whacking me for.
There is also the onBlock function. From the docs, "called upon receiving each text block, allowing you to perform manipulations on it, or kickstart functionality that you want to execute on every prompt". It's still a function, though, not simple scripting.
https://nexus.ironrealms.com/Functions#Default_functions
@Squeakums you could also use the onBlock function to keep track of health change.
It's set as Regular Expression matching type, and the Trigger text is: ^(.*)$
Under Actions you want it to Execute Script:
This should work for anybody, but you need to make sure when you target someone that it's setting the @tar variable in Nexus (@set @tar @1 if you're using a custom targeting alias). The only downside is that I can't figure out a better way of finding matches other than ^(.*)$ which can be VERY taxing computationally. If anybody knows of a better way of capturing the name of your current target in text, I am all ears. In mudlet I've seen it done using temporary triggers that match based on substring which I think could be faster but Nexus doesn't have a way of making temporary triggers.
—Execute a script
send_command(“Starchart “ +args[1]+)
Not sure how to incorporate the :? portion
So, say I want to travel to Iota. I want to use my set destination alias 'dest Iota' to set @destination as Iota. That way, when I send my 'ch' alias, it sends 'starchart Iota.' If I haven't set @destination, I'd like 'ch' to just send 'starchart'
The example I was given is returning the 'This is an invalid command' error because it isn't sending the alias at all, just 'ch.'
Update: Changing it to:
send_command("starchart " + [args[1]]);
makes it fire, though ideally I'd like for 'ch' to send 'starchart' without any arguments if I don't provide any and to have it pull that @destination variable if it exists. I figure this will be based on an if/else type deal like "if @destination = null then send starchart or send starchart with arguments else send starchart @destination" but I just can't figure out how to actually write that.