Eidolon Posted February 7, 2013 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
Brian Posted February 11, 2013 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
nanakiwurtz Posted February 11, 2013 Posted February 11, 2013 But I prefer to use a menu rather than a switch. 1 Quote
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 Eidolon2 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.