Kurby Posted July 15, 2012 Group: Members Topic Count: 37 Topics Per Day: 0.01 Content Count: 113 Reputation: 1 Joined: 07/15/12 Last Seen: January 5, 2013 Share Posted July 15, 2012 (edited) How I make it so Whenever someone clicks on selection it goes to somewhere? Ex. mes .@n$; mes "Which Item would you like?"; next; if(select("Cygnus Helmet!:Diamond Dust!:Bye!")) if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==3) goto M_Leave; if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==2) goto M_Once; if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==1) goto M_Twos; If clicked on "Bye!" go to M_Leave = Exit NPC If clicked on "Diamond Dust!" go to M_Once = Buying Custom Item If clicked on "Cygnus Helmet!" go to M_Twos = Buying Another Custom Item If I use that I have to click many times, unless ()==1), but can't use all for that? Possible? mes .@n$; mes "Which Item would you like?"; next; if(select("Cygnus Helmet!:Diamond Dust!:Bye!")) if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==1) goto M_Leave; if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==1) goto M_Once; if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==1) goto M_Twos; Edited July 15, 2012 by Kurby Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 u mean like this? menu "Cygnus Helm",chelm,"Diamond Dust",ddust,"Bye!",bye; chelm: blabla ddust: script here bye: mes "Bye"; close; Quote Link to comment Share on other sites More sharing options...
Kurby Posted July 15, 2012 Group: Members Topic Count: 37 Topics Per Day: 0.01 Content Count: 113 Reputation: 1 Joined: 07/15/12 Last Seen: January 5, 2013 Author Share Posted July 15, 2012 u mean like this? menu "Cygnus Helm",chelm,"Diamond Dust",ddust,"Bye!",bye; chelm: blabla ddust: script here bye: mes "Bye"; close; Would that make the selections 1 click enable? Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 i dont get what ur trying to say about the 1 click enable ._. this will show a menu with 3 options. then choose one. and it will redirect u to that option. same as case in if select. but this one is more of a looping menu or skipping-kind of menu. Quote Link to comment Share on other sites More sharing options...
Kurby Posted July 15, 2012 Group: Members Topic Count: 37 Topics Per Day: 0.01 Content Count: 113 Reputation: 1 Joined: 07/15/12 Last Seen: January 5, 2013 Author Share Posted July 15, 2012 i dont get what ur trying to say about the 1 click enable ._. this will show a menu with 3 options. then choose one. and it will redirect u to that option. same as case in if select. but this one is more of a looping menu or skipping-kind of menu. I mean if you use "if(select("Cygnus Helmet!:Diamond Dust!:Bye!")==3) goto M_Leave;" You'll have to click "Bye!" option 3 times before it closes the NPC. How would your format look like? This? mes .@n$;mes "Which Item would you like?";next; menu "Cygnus Helm",chelm,"Diamond Dust",ddust,"Bye!",bye; chelm: goto M_Twos; ddust: goto M_Once; bye: goto M_Leave; close; Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 (edited) menu "Cygnus Helm",M_Twos,"Diamond Dust",M_Once,"Bye",M_Leave; just this will work Edited July 15, 2012 by Mavis Quote Link to comment Share on other sites More sharing options...
Kisuka Posted July 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted July 15, 2012 Please use the Switch Select method... it's much cleaner and easier to read. mes .@n$; mes "Which Item would you like?"; next; switch(select("Cygnus Helmet!:Diamond Dust!:Bye!")) { case 1: // Your script for buying Cygnus Helmet. break; case 2: // Your script for buying Diamond Dust. break; case 3: close; } Also... next time please don't post the same topic, regarding the same issue, twice (double post). Lilith gave you the correct answer regarding your question yet you still posted the same issue again ^^; Please avoid double posting. Quote Link to comment Share on other sites More sharing options...
Kurby Posted July 15, 2012 Group: Members Topic Count: 37 Topics Per Day: 0.01 Content Count: 113 Reputation: 1 Joined: 07/15/12 Last Seen: January 5, 2013 Author Share Posted July 15, 2012 (edited) menu "Cygnus Helm",M_Twos,"Diamond Dust",M_Once,"Bye",M_Leave; just this will work Thank you, I will test whenever my server gets back up Edited July 15, 2012 by Kurby Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 mes .@n$; mes "Which Item would you like?"; next; switch(select("Cygnus Helmet!:Diamond Dust!:Bye!")) { case 1: // Your script for buying Cygnus Helmet. goto M_Twos; break; case 2: // Your script for buying Diamond Dust. goto M_Once; break; case 3: goto M_Leave; break; } Quote Link to comment Share on other sites More sharing options...
Kisuka Posted July 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted July 15, 2012 mes .@n$; mes "Which Item would you like?"; next; switch(select("Cygnus Helmet!:Diamond Dust!:Bye!")) { case 1: // Your script for buying Cygnus Helmet. goto M_Twos; break; case 2: // Your script for buying Diamond Dust. goto M_Once; break; case 3: goto M_Leave; break; } You don't need the labels... if he's just processing what item they want all he needs to do is place the code he'd put under those labels after the correct 'Case'. Labels cause unnecessary clutter in scripts, and make finding code harder. Using Switch statements is highly recommended as you don't need to then hunt down where the Label is to find the code for that selected item in a menu. Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 mes .@n$; mes "Which Item would you like?"; next; switch(select("Cygnus Helmet!:Diamond Dust!:Bye!")) { case 1: // Your script for buying Cygnus Helmet. goto M_Twos; break; case 2: // Your script for buying Diamond Dust. goto M_Once; break; case 3: goto M_Leave; break; } You don't need the labels... if he's just processing what item they want all he needs to do is place the code he'd put under those labels after the correct 'Case'. i know. i think he might want to use a looping kind of style thats why he decided to use goto; ._. Quote Link to comment Share on other sites More sharing options...
Kisuka Posted July 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted July 15, 2012 i know. i think he might want to use a looping kind of style thats why he decided to use goto; ._. You can do looping without using labels / goto. Use the While loop. while(1) { mes .@n$; mes "Which Item would you like?"; next; switch(select("Cygnus Helmet!:Diamond Dust!:Bye!")) { case 1: // Your script for buying Cygnus Helmet. break; case 2: // Your script for buying Diamond Dust. break; case 3: close; } } Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 ok relax it works the same ._. and not really much of a difference, i guess? Quote Link to comment Share on other sites More sharing options...
Kisuka Posted July 15, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 56 Reputation: 30 Joined: 02/22/12 Last Seen: August 8, 2020 Share Posted July 15, 2012 ok relax it works the same ._. and not really much of a difference, i guess? Relax? o.O I'm not arguing... This is a Scripting Support forum. I've giving support... The point of a support forum is to allow people to give the best possible solutions to the person asking for help. If outdated methods are being given then an experienced scripter coming in and giving feedback shouldn't be met with hostility... Development is about sharing methods of how we create things. Again, was giving feedback / support. Wasn't trying to argue or say your method is bad... it's just not a very clean way of scripting... there's a reason we spent a good time at eAthena converting all the goto / label menus with switch select menus. It's cleaner and easier to read; allows for better debugging. 1 Quote Link to comment Share on other sites More sharing options...
Wise Posted July 15, 2012 Group: Members Topic Count: 46 Topics Per Day: 0.01 Content Count: 147 Reputation: 26 Joined: 11/19/11 Last Seen: October 28, 2021 Share Posted July 15, 2012 im sorry. i think yours is easier Quote Link to comment Share on other sites More sharing options...
Question
Kurby
How I make it so Whenever someone clicks on selection it goes to somewhere?
Ex.
If clicked on "Bye!" go to M_Leave = Exit NPC
If clicked on "Diamond Dust!" go to M_Once = Buying Custom Item
If clicked on "Cygnus Helmet!" go to M_Twos = Buying Another Custom Item
If I use that I have to click many times, unless ()==1), but can't use all for that?
Possible?
Edited by KurbyLink to comment
Share on other sites
14 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.