Eidolon Posted February 7, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 10 Reputation: 2 Joined: 02/07/13 Last Seen: August 19, 2013 Share Posted February 7, 2013 (edited) http://pastebin.com/WtGQru87 Let's see, this script is just a NPC giving free items, Could you guys help me by checking it and pointing out things on the script that I can optimize to make the script neater? I mean neater but the options given by the npc are not changed. Thank you. It will be a really great help if you can. Edited February 7, 2013 by Eidolon Quote Link to comment Share on other sites More sharing options...
Brian Posted February 11, 2013 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted February 11, 2013 Line 12 and 16: what if you had a custom item in your database that was actually named "null" Instead, you should check if getiteminfo returns -1, meaning the item does not exist. Line 22: instead of manually doing the math with MaxWeight, try the checkweight function Line 40: (personal preference) use if or switch instead of menu which creates "goto" labels. other suggestions: - line up your indents so the opening and closing braces { } are lined up - only indent 1 tab for each level of indentation (ex: line 10 has 2 tabs) This will save horizontal space when your script has deeper levels of indentation Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted February 11, 2013 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted February 11, 2013 But I prefer to use a menu rather than a switch. 1 Quote Link to comment Share on other sites More sharing options...
Question
Eidolon
http://pastebin.com/WtGQru87
Let's see, this script is just a NPC giving free items,
Could you guys help me by checking it and pointing out things on the script that I can optimize to make the script neater?
I mean neater but the options given by the npc are not changed.
Thank you. It will be a really great help if you can.
Edited by EidolonLink to comment
Share on other sites
2 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.