Scripting
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Scripting

Started by Progressive_Rocker_1960, 04 December, 2003, 10:14:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Progressive_Rocker_1960

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.


pHaTTy

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
Resistance is futile!

klownietklowniet

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....
[ > DC - UniteD < ]

Progressive_Rocker_1960

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.

IceCoder

is it faster to have a text in the code instead to read a text fil?

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

IceCoder


SaintSinner

QuoteOriginally posted by IceCoder
ok....


ok....?
   


SMF spam blocked by CleanTalk