= moved plugins and localization
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
-- Example plugin stub. This function is called and passed the input message.
|
||||
-- If nil is returned, the plugin is considered to have not run, but if any
|
||||
-- other value is returned, it's interpreted as a string and sent back to the user.
|
||||
-- 'local' variables inside of this file persiste between plugin calls.
|
||||
function plugin(message)
|
||||
return nil;
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
local time = os.time();
|
||||
|
||||
function plugin(message, user)
|
||||
if(string.match(string.lower(message), "purple"))then
|
||||
local timedif = os.time() - time;
|
||||
time = os.time();
|
||||
days = (timedif / (60*60*24));
|
||||
hours = ((timedif / (60*60)) % 24);
|
||||
mins = ((timedif / (60)) % 60);
|
||||
secs = timedif % 60;
|
||||
return "*GASP!!!* \n" .. user.name .. " said **THE** word! It's been " .. round(days) .. " days, " .. round(hours) .. " hours, " .. round(mins) .. " minutes, and " .. round(secs) .. " seconds since the last time!";
|
||||
end
|
||||
|
||||
return nil;
|
||||
end
|
||||
|
||||
function round(num)
|
||||
return math.floor(num + 0.5)
|
||||
end
|
||||
Reference in New Issue
Block a user