Jump to content
  • 0

How to merge multiple arrays into a single array?


mawjustin

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  121
  • Reputation:   6
  • Joined:  09/26/14
  • Last Seen:  

Hi Team,

How do we merge arrays and use them as a single array?

Example:

        setarray .attr1[0],4700,4701,4702,4703,4704,4705,4706,4707,4708,4709;
        setarray .attr2[0],4730,4731,4732,4733,4734,4735,4736,4737,4738,4739;
        setarray .attr3[0],4740,4741,4742,4743,4744,4745,4746,4747,4748,4749;
        setarray .attr4[0],4710,4711,4712,4713,4714,4715,4716,4717,4718,4719;
        setarray .attr5[0],4720,4721,4722,4723,4724,4725,4726,4727,4728,4729;
        setarray .attr6[0],4750,4751,4752,4753,4754,4755,4756,4757,4758,4759;

I want to use them as 

       setarray .combinedArray[0], attr1, attr2, attr3, attr4, attr5, attr6;

This way I can only modify a specific attribute if necessary without affecting the entire list of array, as the other .attr arrays are used in other functions.

 

Thank you.

Edited by mawjustin
Removed spacing.
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 2

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2346
  • Joined:  10/28/11
  • Last Seen:  

setarray .combinedArray[getarraysize(.combinedArray)], .attr1, getarraysize(.attr1);
setarray .combinedArray[getarraysize(.combinedArray)], .attr2, getarraysize(.attr2);
setarray .combinedArray[getarraysize(.combinedArray)], .attr3, getarraysize(.attr3);
setarray .combinedArray[getarraysize(.combinedArray)], .attr4, getarraysize(.attr4);
setarray .combinedArray[getarraysize(.combinedArray)], .attr5, getarraysize(.attr5);
setarray .combinedArray[getarraysize(.combinedArray)], .attr6, getarraysize(.attr6);

 

Link to comment
Share on other sites

  • 1

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  862
  • Reputation:   115
  • Joined:  05/23/12
  • Last Seen:  

U can use copyarray*

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  121
  • Reputation:   6
  • Joined:  09/26/14
  • Last Seen:  

How do we implement this? I'm confused as to how to use this based on the instructions given on script commands.
https://raw.githubusercontent.com/rathena/rathena/master/doc/script_commands.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  121
  • Reputation:   6
  • Joined:  09/26/14
  • Last Seen:  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...