Professor Phatty or any of the other LUA Gurus,
I have a question regarding LUA.
I am writing a Trigger Bot, just a simple remark and response. In order to conserve memory & processor is it better to incode the triggers and responses or would it be better to call a text file.
Will probably have end up with 10 triggers & Responses.
Any help with this would be greatly appreciated.
well it is better to be in same fle, as it using processor to read from text file, but there not mich difference for a triggerbot, and it doesnt take much ;)
-phatz
It doesn't take anything if you read the triggers from file at script startup in the main function and put them in an assosiative table. Then it's a simple lookup when the trigger command is typed in main or in pm. No reading from file at that point....
Thank you both very much that gives me a couple ideas. That is about what I had figured, especially with a small script like a trigger bot. I will yell if I run into anything else.
is it faster to have a text in the code instead to read a text fil?
QuoteOriginally posted by IceCoder
is it faster to have a text in the code instead to read a text fil?
depends how you do it.
if you load the txt file on start of the bot it doesn't make a difference.
but if you don't it'll be slower, as you have 2 open the file over and over again.
plop
ok....
QuoteOriginally posted by IceCoder
ok....
ok....?