Help - Search - Members - Calendar
Full Version: Nexus-need Script To Make Infinite Variables
Achaea's Forums > Off-Topic > Tech Support
Hush
Hi, if someone can figure this out..like it might not be possible..but it would be a major breakthrough for anything i've done

If someone can make a script that will make a variable. Then if you run the script again or anything like that, it will make another variable, and so on.

Possibly, the 1st variable made would be variable1

The 2nd variable2.

The 3rd variable3.

And make it so it could theoretically reach {...variable151, variable152, variable153....}


Using any method to get this, even if it takes a trigger, I'd like to know if its posssible.
Soludra
Not from what I can see, no. An array-based solution is possible in the Flash client, but I've pored over the Nexus documentation for the past fifteen minutes and I can't see anything.
Jaybles
It's pretty simple realy. In Nexus you can embed variables within variables, which is useful in your case.

An Example if you solely just want to declare the variables.

Create an Alias, say 'infinite'.

Create these variables:-
counter (set to 0)

Under the editor:
#math counter $counter + 1
#set variable$counter 0
#set var_echo variable$counter (demonstrate use of variable within a variable)
#echo $var_echo declared!

edit: forgot a $.
Soludra
Sorry Jaybles, that was a good effort, but it's not working for me. The script outputs as you'd expect, but the only created variable I see in the list is 'variable', with a value of "11 0". It's not recognizing the count as a concatenation to the name, it's treating it as data for the variable.
Hush
QUOTE (Jaybles @ Sep 18 2009, 08:04 AM) *
It's pretty simple realy. In Nexus you can embed variables within variables, which is useful in your case.

An Example if you solely just want to declare the variables.

Create an Alias, say 'infinite'.

Create these variables:-
counter (set to 0)

Under the editor:
#math counter $counter + 1
#set variable$counter 0
#set var_echo variable$counter (demonstrate use of variable within a variable)
#echo $var_echo declared!

edit: forgot a $.



Sorry, already tried this anyways.

#set variable$counter
is equal to
#set variable $counter
Hush
and now i have a feeling its impossible since you can't #set the value of a variable as a name of a variable

other words, you can NOT do this:
#set $variable (to create the variable with the name=the value of 'variable')
or
#set $variable 5 (to create the variable with the name=the value of 'variable' and set its value to 5)

is it possible to make an echo with nexus scripting in it,
then use a trigger to match that echo and execute all those commands in the echo?


And no...this didn't work
I tried an echo..

#ECHO TEST #set value 1812

Then made a trigger:
TEST {w} {w} {d}
Script:
#echo $1 $2 $3 //to confirm that it received the variables correctly
$1 $2 $3 //my attempt to exectute those variables as a command in nexus code....


The result was it could read the variables so the echo worked, but the 2nd part where the variables are supposed to be executed did not work at all.
Irion
I don't believe that you can trigger of echos in nexus.
Hush
QUOTE (Irion @ Sep 18 2009, 11:00 PM) *
I don't believe that you can trigger of echos in nexus.



You can. To test this, make an alias....
Alias:
Test
Script:
#echo This echo will be matched in a stupid trigger.

Then make a trigger.
Trigger:
This echo will be matched in a {w:variable} trigger.
Script:
#wait 1000
#echo Wait, in what kind of trigger?
#wait 4000
#echo A $variable trigger you idiot!!!



Then simply enter the alias Test into your client and presto, you get a nifty show.
Hush
latency on my internet connection makes me double post
Irion
wow. I though of that once. And just assumed it didn't work. Wow, I feel stupid now.
Soludra
If it makes you feel any better, I didn't think it would work either. mellow.gif
Jaybles
Gah. I didn't realise it didn't work for #set. My apologies.
I guess Nexus works this way:

For #SET, it does this:

#SET varname$hello 1
It looks for #SET as the first argument, meaning to create a variable.
then, it looks for the variable name. Perhaps up to a space or to a $ character.
(I've tried "varname$hello" 1 and varname$hello = 1. Gave me varname$hello with value 1 and varname with value '1 = 1')

Lastly, a spacing or =(if the above did not happen) to determine the value of the variable.

Whereas for #ECHO, it does this:

#SET secondvarname = 1
#ECHO varname$secondvarname declared!

It just takes everything after the argument #ECHO and expands whatever variable it finds in whatever position.

So yeah, Soludra was right. There is no way to create Variable Variables. Poop.

ps: I tried using the triggers too. Heh.
Jonathin
I have the fix-all solution to this problem.


Use a different client.
Trici
QUOTE (Jonathin @ Sep 19 2009, 02:53 PM) *
I have the fix-all solution to this problem.


Fix flash.
Jonathin

QUOTE (Trici @ Sep 19 2009, 03:55 PM) *
QUOTE (Jonathin @ Sep 19 2009, 02:53 PM) *
I have the fix-all solution to this problem.


Fix flash.



Even if they fixed it, it'd still be slow useless.

Get a better client aside form flash/java(If they even still have the old javaclient)/nexus.
Trici
QUOTE (Jonathin @ Sep 19 2009, 03:01 PM) *
Even if they fixed it, it'd still be slow useless.

Get a better client aside form flash/java(If they even still have the old javaclient)/nexus.
I think the Flash looks awesome, the map thing appears convenient, and it can do a lot for people who don't need to have super-complex codes. It would be awesome for beginners (in my opinion), if it was fixed just slightly.
Jonathin
It's still good for beginners.
I hate the map thing because it takes up space.
Nexus is better for beginners, with a much simpler coding system.
They can just type MAP, to see a map.

The only thing good about flash is that it's on Kongregate.
That's it.

But still, in order of ease of coding, more bells and whistles with the coding, and speed it would go:

Nexus
Cmud or Zmud
MUSHclient
Mudlet
Trevize
Until Mudlet works with more than just Lua, I'd recommend MUSHclient.
Hush
I'm actualluy thinking of making a switch. Is there anyway to import a nexus code to one of these more professional ones?

And I should go with mushclient? I've looked at the sites for zmud and mush, but still not sure.
Soludra
I think MUSHclient is fantastic, although perhaps just rough around the edges to give a newcomer some pause. It's a small price to pay for the sheer power though, like some of the plugins some of us are working on. If you go the MUSHclient route, I suggest joining the MUSHclient Users clan, so you have a bit of a support group.

Nexus code is incredibly simple, and it should be very easy to move it over to MUSH by hand. Depending on how much Nexus data is involved, I could help out and convert some stuff over.
Hush
is that clan an IC clan?

forum thing?

how do I find out about it?
Irion
Guess what, I decided to switch to mush too. Now I just have to figure out lua...
It's pretty much like C, right? or is that completely wrong?
.....
How do you join the clan?
Soludra
Hush: It's an IC clan, CLHELP MUSH. Poke me in-game right now if you want in, I'm around. Or Trevize, when he's around.

Irion: See above. As for Lua, it's... written in C, but its syntax is cleaner. I suggest reading this, which should get you going pretty easily.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.