Jump to content
  • 0

var2string(); & string2var();


gekigengar

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

I need a function that returns variable name as string, and a function that takes string and returns variable.

I felt that this would be really useful for me.

 

For example, I have

$@Test[1] = 100;
var2string($@Test[1]);

dispbottom var2string($@Test[1]);

//would result displaying $@Test[1] on the bottom.

While the other way round is also possible.

 

for example.

$@Test[1] = 100;
.varstring$ = "Test";

.result = 200 + string2var("$@" + .varstring$ + "[1]");
dispbottom .result;

//would results to displaying 300 on the bottom.

Is this possible?

 

Imagine the tons of possibilities with the availability of this function.

 

I could make a lot of scripts that are once impossible into reality!.

Edited by gekigengar
Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  149
  • Reputation:   33
  • Joined:  12/24/11
  • Last Seen:  

Var to String should be tought. Other way around, check for SetD and GetD

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

Var to String should be tought. Other way around, check for SetD and GetD

You are right, I never knew such function exist.

 

There is nothing on rAthena wiki regarding setD getD.

 

I found it on Hercules Wiki.

 

http://hercules.ws/wiki/Setd

http://hercules.ws/wiki/Getd

 

I think thats all I need, Thank you!

Edited by gekigengar
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  149
  • Reputation:   33
  • Joined:  12/24/11
  • Last Seen:  

Look through doc/script_commands.txt or whats it called

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

There is nothing on rAthena wiki regarding setD getD.

Setd

Getd

Those pages have existed since January 2009. o.o;

As Jonne said, run a search through doc/script_commands.txt to see if a command exists.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  174
  • Reputation:   2
  • Joined:  08/30/13
  • Last Seen:  

 

There is nothing on rAthena wiki regarding setD getD.

Setd

Getd

Those pages have existed since January 2009. o.o;

As Jonne said, run a search through doc/script_commands.txt to see if a command exists.

 

But but, Uncle Google didn't even link them to those page! ;_;

 

try typing

rathena setd getd

will get you to hercules stuff!

Edited by gekigengar
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...