quote:
Originally posted by xsouldeath
bad programming im sure the script contains that, but it works
you didn't really mention about the bad programming.... lol the script works and some say its better than smarterchild .. so yay
It's not about if it works, it's about if it works
good. When you release a script which contains crappy, unneeded stuff like:
code:
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
or:
code:
var anExpression = Message;
others will be confused about it and think that they have to use the same in their scripts. Then, when it doesn't work, they come here and ask why. And we don't want thar, huh?
A good example of bad programming is:
code:
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
This rule contains so much unneeded stuff that it could even match a string like:
quote:
Hey I thought he *adds* something like bananas
If you would study the regular expression and know how to write proper regexp, you'll know why. Also, this code will make your script fail or even crash since it'll try to send:
quote:
I thought he *adds* something like bananas
to the eval function.
So: go to some tutorial site like
this one and learn proper regular expressions.