Hell Posted December 6, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 25 Reputation: 0 Joined: 10/21/12 Last Seen: January 30, 2013 Share Posted December 6, 2012 Is it possible to make a label that change. For example Prontera,59,50,4 script npcnamewqe 100,{ If(something)goto main menu; else goto .@varlable$ main menu: Mes ""; Input .@varlable$ Close; Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted December 6, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted December 6, 2012 No you can't store a label into a variable, you will save its value (numerical) but not it's type. But as far I know you can send a label as an argument to a function or return a label from a function. Well, I think you should re-organize your code to avoid using this structure 2 Quote Link to comment Share on other sites More sharing options...
Euphy Posted December 6, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted December 6, 2012 Would this not work the same way? input .@str$; if (.@str$ == "menu1") {} else if (.@str$ == "menu2") {} else {} Quote Link to comment Share on other sites More sharing options...
Ryokem Posted December 6, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted December 6, 2012 Would this not work the same way? input .@str$; if (.@str$ == "menu1") {} else if (.@str$ == "menu2") {} else {} I think he want to jump in different labels depending on the input. Ex: you input "hello", and you jump to hello: label. There's a nice way to do this, just use functions instead of labels, getd() and callfunc to recall that particular label. Honestly, I did similar things long ago in eAthena and it worked fine, so I believe this can work on rAthena as well. Quote Link to comment Share on other sites More sharing options...
Euphy Posted December 6, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted December 6, 2012 There's a nice way to do this, just use functions instead of labels, getd() and callfunc to recall that particular label. Functions aren't labels either, and I can't see why conditionals wouldn't be a better solution. Quote Link to comment Share on other sites More sharing options...
Ryokem Posted December 6, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted December 6, 2012 Functions aren't labels either, and I can't see why conditionals wouldn't be a better solution. He wanted to make it dynamically, that's why if() statements wouldn't be enough I think. Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted December 7, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted December 7, 2012 Or you can use: input .@label$; doevent strnpcinfo(3) + "::" + .@label$; end; But I still think there is no need to jump to a dynamic label if your code is structured. 1 Quote Link to comment Share on other sites More sharing options...
Ryokem Posted December 7, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted December 7, 2012 Or you can use: input .@label$; doevent strnpcinfo(3) + "::" + .@label$; end; But I still think there is no need to jump to a dynamic label if your code is structured. Agree. Quote Link to comment Share on other sites More sharing options...
Question
Hell
Is it possible to make a label that change.
For example
Prontera,59,50,4 script npcnamewqe 100,{
If(something)goto main menu;
else goto .@varlable$
main menu:
Mes "";
Input .@varlable$
Close;
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.