 |
shaun.murray Magician

Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed May 07, 2008 8:04 pm
no space!?!?!? |
When this fires....
Code: |
k %arrget( mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1)) |
This gets sent to the mud (assuming @arrnext = 1 and @key_list = spirit): k1.spirit when from what I think it should be sending is k 1.spirit. I've tried putting quotes around %arrget to the very end of the line, but that still sends everything smooshed together. I've also put quotes around the whole line.... =**[ (I even tried putting another space after the k.....)
Thanks again for all your guy's help! Making cmud SOOO much more appealing! =D And I apologize for my newbish questions.... -.- |
|
|
 |
shaun.murray Magician

Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed May 07, 2008 8:08 pm |
Ok... My bad. That line DOES work, when I enter that in directly. But its part of an alias... Here's the alias:
Code: |
#alias {kill} {#if (@bkill) {#variable bcombat 1;#if (@end_cur > @end_min) {@attack %arrget(mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))} {k %arrget( mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))}}} |
When the alias 'kill' gets sent, its sending k1.spirit.... |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed May 07, 2008 8:40 pm |
Firstly you should really look into using STRING LIST VARIABLES instead of arrays. But that has nothing to do with your current problem.
#send {%concat("k ",%arrget( mob_list, @arrnext)," .",%item( @key_list, %eval( @arrnext + 1)))}
That is unless k is an alias. In that case you may want to do this.
k %concat(%arrget( mob_list, @arrnext)," .",%item( @key_list, %eval( @arrnext + 1)))
CMUD is sometimes picky about implicit concatenation and wants you to explicitly tell it when something should be treated as a string literal.
When you put something into concat, you know the results will be returned, and treated as a string.  |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed May 07, 2008 8:51 pm |
That's not actually the issue here, though. The problem is this:
#if (@end_cur > @end_min) {@attack %arrget(mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))}
See this help file. |
|
|
 |
shaun.murray Magician

Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed May 07, 2008 9:21 pm |
Hmmm... I'l hafta look into this "string list variable"... I'm not what you call a smart man. (LOVE that forest gump! LoL!) But... For the time being, I'd like to get this working, and then I'll make it more efficient. =]
AWESOME!
Code: |
#if (@bkill) {#variable bcombat 1;#if (@end_cur > @end_min) {#exec {@attack %arrget(mob_list, @arrnext)~.%item( @key_list, %eval( @arrnext + 1))}} {k %concat(%arrget( mob_list, @arrnext),".",%item( @key_list, %eval( @arrnext + 1)))}} |
works.... |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed May 07, 2008 10:38 pm |
You might find that #send or #sendraw is better for some applications, though - in this case, I expect that @attack will be the name of an alias, so they won't help.
|
|
|
 |
shaun.murray Magician

Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Wed May 07, 2008 11:40 pm |
well... @attack is the type of attack that is set with a different alias. just used to change up how i initiate battle depending on the area i'm at.
i've actually been looking at how i can remove the array's into the string's... but... i don't know if i'm quite to that level yet. easy to do? some good reading links on zuggsoft? i've tried searching, but i just come up with results on what the different type of variables there are, and not really some good examples on how to implement it. *shrug*
thanks for ya'lls help by the way! =D |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu May 08, 2008 1:51 am |
If you've mastered arrays, stringlists are a complete piece of cake. Based on the level of difference in development between the two features, stringlists are probably 10x easier to use. ZMud let us do some really amazing things with stringlists that even Zugg didn't even consider, but CMud shook that up a bit.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu May 08, 2008 9:14 am |
This is probably a good start.
|
|
|
 |
|
|