Nexus Coding Bits

by Selverad

Back to Combat Guide.

Selverad2008-06-20 23:48:38
Current primary character is a bard, because I didn't want to fight much, if at all. Of course, nothing matters but Glomdoring, so I get thrown into the thick of it anyways. I tried a Ninjakari to go for the out-of-combat applications of Stealth after my Serenguard made me realize that I suck at fighting, and the Ninjakari guild setup still fails to keep my attention. So.

Want to work on the whole 'can't fight worth a darn' thing, and to do that I want to learn to code.

I'm going to start with PvE to learn the concepts, and work my way on from there.


PROJECT #1
Alternating Influence

The way I set it up with Selverad was Ctrl+1 was 'influence $target with begging' and Ctrl+2 was 'influence $target with supplication', where $target was a variable set with the command 'El', as was taught to me by some long-forgotten individual back in my Achaean days with a Mhun Runewarden. Anyway, h'okay.

What I want to do is make it so I can set it to a single keybind, for example F1, and have it alternate. Something like.... (if begging, set '1'; when 1, supplication; if supplication, set '0'; when 0, begging)

How can I do that with Nexus?
Rika2008-06-20 23:58:07
May have to turn wrapping off for this to work. Try this:

Alias: whateveryouwant
#set influencetar $1

Trigger: {<}You thrust your hand out to {*} and beg shamelessly.
#set nextcharity supplication

Trigger:{<}Explaining your abject poverty, you humbly request a little help from {*}
#set nextcharity wheedling

Trigger: {<}Keeping up a non-stop patter, you keep wheedling {*} to give up {*} worldly goods to you in a dizzying display of circuitous logic.
#set nextcharity begging

Keybinding: F1
influence $influencetar with $nextcharity
Selverad2008-06-21 00:14:18
And if I don't have Wheedling, I just alter the triggers accordingly?
Rika2008-06-21 00:15:16
Right. Get rid of the third trigger, change the second trigger to #set nextcharity begging.
Bashara2008-06-21 19:15:22
QUOTE(rika @ Jun 20 2008, 11:58 PM) 523769
Keybinding: F1
influence $influencetar with $nextcharity



$, not @.
Rika2008-06-21 20:25:54
I don't see anything wrong with my script. tongue.gif

I blame being away from Nexus for too long.
Selverad2008-06-22 04:03:04
For some reason, it will switch to begging, but not to supplication. I can change it to supplication manually, but after the first shot, it goes to begging and stays there. What could be causing that?
Rika2008-06-22 04:30:18
QUOTE(Selverad @ Jun 22 2008, 04:03 PM) 524211
For some reason, it will switch to begging, but not to supplication. I can change it to supplication manually, but after the first shot, it goes to begging and stays there. What could be causing that?


The trigger might be wrong or something (though it matches with the one I have, which works). Are you sure you did everything right?
Selverad2008-06-23 05:25:39
(Var) influencetar

(Var) nextcharity

(Alias) Ei
#set influencetar $1

(Trig) {<}Explaining your abject poverty, you humbly request a little help from {*}.
#set nextcharity begging

(Trig) {<}You thrust your hand out to {*} and beg shamelessly.
#set nextcharity supplication

(Key) Ctrl+1
influence $influencetar with $nextcharity



Direct copypasta of my own personal pile of fail, and since it seems to work elsewhere, I don't know what I have wrong. So I'll wait until I come up with another project, see if that one will work.
Bashara2008-06-25 17:15:05
QUOTE(rika @ Jun 21 2008, 08:25 PM) 524044
I don't see anything wrong with my script. tongue.gif

I blame being away from Nexus for too long.


Your script technically isn't wrong, but @ does nothing for Nexus. $ is the only thing that Nexus will recognize as a piece of script being marked as a variable.

QUOTE(Selverad @ Jun 23 2008, 05:25 AM) 524736
(Var) influencetar

(Var) nextcharity

(Alias) Ei
#set influencetar $1

(Trig) {<}Explaining your abject poverty, you humbly request a little help from {*}.
#set nextcharity begging

(Trig) {<}You thrust your hand out to {*} and beg shamelessly.
#set nextcharity supplication

(Key) Ctrl+1
influence $influencetar with $nextcharity

Direct copypasta of my own personal pile of fail, and since it seems to work elsewhere, I don't know what I have wrong. So I'll wait until I come up with another project, see if that one will work.



The problem is with your begging trigger. {*} will only work if the target has a single word 'name.'

CODE
Inside the Black Tower.
A painting of Angkrag General Store is proudly exhibited on a nearby wall. There
are 7 dark nighthags here.
You see exits leading northeast, up, and out (open door).
A dark nighthag nods her head at you.
4212h, 3855m, 3618e, 10p, 18570en, 17385w elrx-influence nighthag with begging
You thrust your hand out to a dark nighthag and beg shamelessly.
A dark nighthag looks up into the sky, pretending you don't exist.


Note how the target is 'nighthag', but the descriptor the system sends back is 'dark nighthag'. Your trigger is set to recognize an 'anyword', but only one anyword, not multiples. In order for your system to work correctly, I suggest shortening your triggers like so:

CODE
(Trig) {<}Explaining your abject poverty, you humbly request a little help
#set nextcharity begging

(Trig) {<}You thrust your hand out to
#set nextcharity supplication


This way, your triggers are almost guaranteed to work. I tested them out myself a little while ago, they do switch normally.
Bashara2008-06-25 17:28:48
'Combat system' for influencing.

QUOTE(Selverad @ Jun 23 2008, 05:25 AM) 524736
(Var) equilibrium

(Var) influencetar

(Var) nextcharity

(Alias) Ei
#set influencetar $1

(Trig) {<}Explaining your abject poverty, you humbly request a little help from {*}.
#set nextcharity begging
#set equilibrium no

(Trig) {<}You thrust your hand out to {*} and beg shamelessly.
#set nextcharity supplication
#set equilibrium no

(Trig) {<}You have recovered equilibrium.
#set equilibrium yes

(Key) Ctrl+1
#if $equilibrium = yes {influence $influencetar with $nextcharity}



What this does is prevents you from spamming your log with the return message 'You must have equilibrium' or blah blah blah. The only time your influence 'attack' will go through is if the #if (pardon the pun) statement's requirements are met, which will only happen when the system tells you that you're back on equilibrium.