PtokaX forum

Archive => DiXBoT => AllInOne Scripts => Archived 5.1 boards => DiXBoT - Feature Requests => Topic started by: Herodes on 12 September, 2006, 07:56:01

Title: Modular system
Post by: Herodes on 12 September, 2006, 07:56:01
Snooze,...
Nice bot, but compiled,.. please give out some of the code or please explain how you do the modular thingie, as I've been breaking my head to make it happen,.. but no success, are you using the module system for lua, package.seeall and such?
Title: Re: Modular system
Post by: bastya_elvtars on 12 September, 2006, 10:16:57
I'd simply do a module("randonmod", package.seeall) in the module then just save it as randomfilename.lua, write the definitive PX script, and set package.path="plugins/?.lua" in it and require "randomfilename"
Title: Re: Modular system
Post by: Snooze on 13 September, 2006, 19:50:25
Actualy I made it really simple.. I write all modules in a table and just load that table into the system including individual timers, commands, helps and rightclicks..

Like:


Modulename = {
["NewUserConnected"] = {
-insert code
},

["OpConnected"] = {
-insert code
},


["Func"] = {
-insert code
},
["Asserts"] = {
-insert asserts
},
["Timers"] = {
-insert timers
},

["CMD"] = {
-insert commands
},
["Rightclick"] = {
-insert rightclicks
},
}