--/----------------------------------------------------------------------------
-- Entry Bot v1.0a by jiten - "... sort of a better Release Bot ..." (6/3/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Changelog:
-- Fixed endpipe problem (thx to madman)
--/ Some Features:
-- Supports different categories;
-- Entries older than x Days are automatically deleted (optional)
-- Includes an optimized RighClick;
-- Commands to add, delete, show, find entries and much more;
-- Ability to send pre-defined category's content to main when desired
--/----------------------------------------------------------------------------
Grab it here (http://mznetwork.mozdesigners.com/i/forum_files/Entry.v1.0a.rar).
Cheers
QuoteOriginally posted by jiten
--/----------------------------------------------------------------------------
-- Entry Bot v1.0 by jiten - "... sort of a better Release Bot ..." (6/3/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
--/ Some Features:
-- Supports different categories;
-- Entries older than x Days are automatically deleted (optional)
-- Includes an optimized RighClick;
-- Commands to add, delete, show, find entries and much more;
-- Ability to send pre-defined category's content to main when desired
--/----------------------------------------------------------------------------
Grab it HERE (http://mznetwork.mozdesigners.com/i/forum_files/Entry.v1.0.rar).
Cheers
Id like it...Cool script!!!
Nice script.. one thing... you might wanna change the endpips on the rightclicks..
from||
to|
beacuse the first one make some bcdc version flood the hub...
QuoteOriginally posted by madman
Nice script.. one thing... you might wanna change the endpips on the rightclicks..
beacuse the first one make some bcdc version flood the hub...
Thanks for the tip m8 ;)
First post updated with that fix.
Cheers
np =)
Jiten:
Is it possible to have "iMax" shown upon user entering the hub?
If I want to show a category every hour do I have to enter that category x 24, if every 1/2 hour x 48 and so on...?
If I want to tanslate the help file to portuguese can I just change the last line of each "settings.cmd"?
Thanks
QuoteOriginally posted by yoonohoo
Is it possible to have "iMax" shown upon user entering the hub?
Yes, it is. Going to check it.
If I want to show a category every hour do I have to enter that category x 24, if every 1/2 hour x 48 and so on...?
For now, yes :D
Got to think about a simpler way to do this.
If I want to tanslate the help file to portuguese can I just change the last line of each "settings.cmd"?
Yes and plus the "sHelpOutput" message, where you can change "Available Commands:" to "Comandos dispon?veis:"
Best regards,
jiten
--/----------------------------------------------------------------------------
-- Entry Bot v1.1 (6/6/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: RightClick typos (thx TT)
-- Fixed: Some tabbing and small things
-- Added: Entries sending on Connect Option (requested by yoonohoo)
-- Added: Vote, Top Votes and Clear Votes command
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.mozdesigners.com/i/forum_files/Entry.v1.1.rar).
[/list]
Good stuff!
gonna try it now...
Nice one jiten. I will try it out when i have more time! :)
Jiten, can the entries sent on connect go to PM?
Thanks
<-------------------------------------------->
Sorry it was my clients config sending it to MC instead of PM
All sorted m8
Thanks for your kind words :D
Btw, going to release a bug-fix version of Entry Bot today to sort some stuff.
Best regards
--/----------------------------------------------------------------------------
-- Entry Bot v1.1a (6/7/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: sBot registering
-- Fixed: More typos
-- Removed: Extra code and some repetitions
-- Added: Rightclick menu option
-- Added: Vote IP Check (anti-fake)
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.mozdesigners.com/i/forum_files/Entry.v1.1a.rar).
[/list]
Jiten:
Can you make the votes appear on the last xx entries?
So you would have: Nr - Date - Poster - Category - Entry - Votes
Thanks
QuoteOriginally posted by yoonohoo
Jiten:
Can you make the votes appear on the last xx entries?
So you would have: Nr - Date - Poster - Category - Entry - Votes
Thanks
Yes, it's possible. Going to think about adding it to the next version ;)
Best regards
--/----------------------------------------------------------------------------
-- Entry Bot v1.1b (6/13/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: Timer problem
-- Fixed: Cleaner entry removal handling
-- Added: Votes showing on every +show (requested by yoonohoo)
-- Added: Specific cleaning date for each category
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.co.mz/i/forum_files/Entry.v1.1b.rar).
[/list]
nice one mate, new features, should be interesting, lets hope there arent any bugs :)
So far so good :D
Good stuff
Hmmm...
If Entry Bot is above Robocop Syntax ...bs\hub_privado\scripts\Entry.v1.1b.lua:313: attempt to compare nil with number
Now this error happens when using Robocop cmd
<----------------------------------------------->
Just went back to v1.1a and no errors.
--/----------------------------------------------------------------------------
-- Entry Bot v1.1c - BugFix version (6/13/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: RightClick entry (thx TT)
-- Fixed: Votes clearing (thx TT)
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.co.mz/i/forum_files/Entry.v1.1c.rar).
[/list]
With this and 1.1b version, you must remove all existing categories and add them again with the time (in days that each entry should remain on them).
yoonohoo, that's why you got that error ;)
Best regards
Thanks ;) jiten
hi
can you explain these settings
TimedCat = 0, -- 1 = Send specific category content to main in an interval; 0: not
TimedMsg = "your message", -- Message shown below each Timed Category in Main
Times = { -- ["time in 24h format"] = "Category" (not case sensitive)
["12:30"] = "cat1",
["13:00"] = "cat2",
i want to send a timed message in main chat every 30 mins what do i need to do thnks
QuoteTimedCat = 0, -- 1 = Send specific category content to main in an interval; 0: not
Sends the entries in a category to main chat every x time
QuoteTimedMsg = "your message", -- Message shown below each Timed Category in Main
message will appear under your entries sent to main chat
Quote["12:30"] = "cat1"
enter the times and categories you want to send to main chat
Quotei want to send a timed message in main chat every 30 mins what do i need to do thnks
If is just a message use message rotating instead and ajust the time to 30 min
good luck m8
--/----------------------------------------------------------------------------
-- Entry Bot v1.1d - Another bugfix version (6/14/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: Single ID delete loop
-- Fixed: Category content deleting
-- Fixed: Single Entry deleting bug
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.co.mz/i/forum_files/Entry.v1.1d.rar).
[/list]
Just keep it coming... :D
-=-=-=-=-= Edit =-=-=-=-=-
Can I just replace the script?
QuoteOriginally posted by yoonohoo
Just keep it coming... :D
-=-=-=-=-= Edit =-=-=-=-=-
Can I just replace the script?
yep
QuoteOriginally posted by yoonohoo
Just keep it coming... :D
-=-=-=-=-= Edit =-=-=-=-=-
Can I just replace the script?
Yes, you can, just like Dessamator said.
Cheers
--/----------------------------------------------------------------------------
-- Entry Bot v1.1e (6/15/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Removed: Entries checking on every message
-- Added: Multitimer function for Timed Categories and Cleaner
-- Optimized: Cleaner so that it doesn't lag the hub
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.co.mz/i/forum_files/Entry.v1.1e.rar).
[/list]
Hi jiten i am using entry bot 1.1e and i made simple modifications. When im Operator in the hub i can add new cats. but when im master i can
Can u change this so both could add?
--/----------------------------------------------------------------------------
-- Entry Bot v1.1e (6/15/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Thanks to Dessamator for the Timed Message efforts
--/ Some Features:
-- Supports pre-defined categories;
-- Commands to add, delete, show, find entries and much more;
-- Entries older than x Days are automatically deleted (optional)
-- Ability to send pre-defined category's content to main when desired
-- Includes an optimized RighClick;
--/----------------------------------------------------------------------------
Settings = {
sBot = frmHub:GetHubBotName(), -- Default Bot Name or -- sBot = "custombot"
sMenu = "Sistema de entradas", -- RightClick Menu Name
cFile = "Categoria.tbl", -- File where the Categories are stored
rFile = "Entradas.tbl", -- File where the Entries are stored
vFile = "Votos.tbl", -- File where the Voters are stored
eFolder = "Entradas", -- Folder where the .tbl files are stored
iVer = "1.1e", -- Script Version
iMax = 30, -- Maximum entries to be shown
vMax = 20, -- Maximum votes to be shown
SendOnConnect = 0, -- 1 = Send iMax Entries to every user on connect; 0 = Don't send
CatSize = 20, -- Category's size
EntrySize = 150, -- Entry's size (recommended: 75-80)
Sensitive = 0, -- 1 = Searches case-sensitive; 0 = not case-sensitive
TimedCat = 1, -- 1 = Send specific category content to main in an interval; 0: not
TimedMsg = "Quem quiser publicitar neste espa?o, contacte os Operadores", -- Message shown below each Timed Category in Main
Times = { -- ["time in 24h format"] = "Category" (not case sensitive)
["00:00"] = "cinemas",
["00:15"] = "fotologs",
["00:30"] = "Trading-Vendas",
["00:45"] = "Eventos",
["01:00"] = "cinemas",
["01:30"] = "Trading-Vendas",
["01:45"] = "Eventos",
["02:00"] = "cinemas",
["02:30"] = "Trading-Vendas",
["02:45"] = "Eventos",
["03:00"] = "cinemas",
["03:30"] = "Trading-Vendas",
["03:45"] = "Eventos",
["04:00"] = "cinemas",
["04:30"] = "Trading-Vendas",
["04:45"] = "Eventos",
["05:00"] = "cinemas",
["05:30"] = "Trading-Vendas",
["05:45"] = "Eventos",
["06:00"] = "cinemas",
["06:30"] = "Trading-Vendas",
["06:45"] = "Eventos",
["07:00"] = "cinemas",
["07:30"] = "Trading-Vendas",
["07:45"] = "Eventos",
["08:00"] = "cinemas",
["08:30"] = "Trading-Vendas",
["08:45"] = "Eventos",
["09:00"] = "cinemas",
["09:30"] = "Trading-Vendas",
["09:45"] = "Eventos",
["10:00"] = "cinemas",
["11:30"] = "Trading-Vendas",
["11:45"] = "Eventos",
["12:00"] = "cinemas",
["12:30"] = "Trading-Vendas",
["12:45"] = "Eventos",
["13:00"] = "cinemas",
["13:30"] = "Trading-Vendas",
["13:45"] = "Eventos",
["14:00"] = "cinemas",
["14:30"] = "Trading-Vendas",
["14:45"] = "Eventos",
["15:00"] = "cinemas",
["15:30"] = "Trading-Vendas",
["15:45"] = "Eventos",
["16:00"] = "cinemas",
["16:30"] = "Trading-Vendas",
["16:45"] = "Eventos",
["17:00"] = "cinemas",
["17:30"] = "Trading-Vendas",
["17:45"] = "Eventos",
["18:00"] = "cinemas",
["18:30"] = "Trading-Vendas",
["18:45"] = "Eventos",
["19:00"] = "cinemas",
["19:30"] = "Trading-Vendas",
["19:45"] = "Eventos",
["20:00"] = "cinemas",
["20:30"] = "Trading-Vendas",
["20:45"] = "Eventos",
["21:00"] = "cinemas",
["21:30"] = "Trading-Vendas",
["21:45"] = "Eventos",
["22:00"] = "cinemas",
["22:30"] = "Trading-Vendas",
["22:45"] = "Eventos",
["23:00"] = "cinemas",
["23:30"] = "Trading-Vendas",
["23:45"] = "Eventos"
},
pCleaner = 1, -- 1 = Sends cleaner actions to all; 0 = doesn't
Cleaner = 1, -- 1 = Set Automatic Cleaner On; 0 = Automatic Cleaner Off
SendRC = 1, -- 1 = Send RighClick; 0 = Don't
SendTo = { -- Send RightClick to Profile [x] = (1 = on, 0 = off)
[0] = 1, -- Master
[1] = 1, -- Operator
[2] = 1, -- VIP
[3] = 1, -- REG
[4] = 1, -- Custom Profile
[5] = 1, -- Custom Profile
[-1] = 1, -- Unreg
},
-- Commands --
addCatCmd = "addcat", delCatCmd = "delcat", showCatCmd = "showcat", addCmd = "add", TimedCmd = "rotator",
showCmd = "show", delCmd = "del", delAllCmd = "delall", findCmd = "find", helpCmd = "entryhelp",
voteCmd = "vote", TopVotesCmd = "topvote", clrVotesCmd = "clrvote",
--------------
sChar = { "-", " ", "i", "l", "r", "t", "I", "y", "o", }, -- Don't change this
}
-- If you're using Robocop profiles don't change this. If not, remove Profile 4 and 5 and follow this syntax:
-- [Profile number] = value (higher value means more rights)
Levels = { [-1] = 1, [3] = 2, [2] = 3, [1] = 4, [4] = 5, [0] = 6, [5] = 7, }
Category = {} Entry = {} tPrefixes = {} Votes = {} tabTimers = {n=0} TmrFreq = 60*1000
Main = function()
if Settings.sBot ~= frmHub:GetHubBotName() then frmHub:RegBot(Settings.sBot) end
if loadfile(Settings.eFolder.."/"..Settings.cFile) then dofile(Settings.eFolder.."/"..Settings.cFile) else os.execute("mkdir "..Settings.eFolder) end
if loadfile(Settings.eFolder.."/"..Settings.rFile) then dofile(Settings.eFolder.."/"..Settings.rFile) else io.output(Settings.eFolder.."/"..Settings.rFile) end
if loadfile(Settings.eFolder.."/"..Settings.vFile) then dofile(Settings.eFolder.."/"..Settings.vFile) end
for a,b in pairs(frmHub:GetPrefixes()) do tPrefixes[b] = 1 end
RegTimer(Cleaner, 12*60*60*1000) RegTimer(TimedCat, 60*1000) SetTimer(TmrFreq) StartTimer()
end
ChatArrival = function(sUser,sData)
local sData = string.sub(sData,1,-2)
local s,e,sPrefix,cmd = string.find(sData,"%b<>%s*(%S)(%S+)")
if sPrefix and tPrefixes[sPrefix] then
local tmp = "\r\n\t"..string.rep("-", 220)
local sHelpOutput = tmp.."\r\n"..string.rep("\t",7).."Entry Bot v."..Settings.iVer.." by jiten\t\t\t\r\n\t"..string.rep("__",220).."\r\n\tComando Disponiveis:".."\r\n\r\n"
local tCmds = {
-- Commands Structure:
-- [Command] = { function, Lowest Profile that can use this command (check Levels table), Description, Example, },
[Settings.addCatCmd] = {
function(user,data)
local s,e,cat,date = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(%d+)")
if cat and date then
if Category[string.lower(cat)] == nil then
if (string.len(cat) > Settings.CatSize) then
user:SendData(Settings.sBot,"*** Error: The Category can't have more than "..Settings.CatSize.." characters.")
else
Category[string.lower(cat)] = date
SaveToFile(Settings.eFolder.."/"..Settings.cFile,Category,"Category")
end
else
user:SendData(Settings.sBot,"*** Error: There is already a Category: "..cat)
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.addCatCmd.." ")
end
end, 6, "Add category and delete Time", sPrefix..Settings.addCatCmd.." Movies 15", },
[Settings.delCatCmd] = {
function(user,data)
local s,e,cat = string.find(data,"%b<>%s+%S+%s+(%S+)")
if cat then
if Category[string.lower(cat)] then
Category[string.lower(cat)] = nil ShowEntry(1,table.getn(Entry),1,4,cat,"",Entry)
SaveToFile(Settings.eFolder.."/"..Settings.cFile,Category,"Category")
user:SendData(Settings.sBot,cat.." was sucessfully deleted from the Categories.")
else
user:SendData(Settings.sBot,"*** Error: There is no Category: "..cat)
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.delCatCmd.." ")
end
end, 6, "Deletes an existing category", sPrefix..Settings.delCatCmd.." Movies", },
[Settings.showCatCmd] = {
function(user)
if next(Category) then
local msg = "\r\n\r\n".."\t"..string.rep("__",20).."\r\n"
msg = msg.."\t\tCategory List:\r\n"
msg = msg.."\t"..string.rep("__",20).."\r\n"
local i,v for i, v in Category do msg = msg.."\t ? "..i.." ("..v.." days)\r\n" end
user:SendData(Settings.sBot,msg)
else
user:SendData(Settings.sBot,"*** Error: There are no categories!");
end
end, 1, "Shows categories", sPrefix..Settings.showCatCmd, },
[Settings.addCmd] = {
function(user,data)
local s,e,cat,rel = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(.*)")
if cat then
if Category[string.lower(cat)] then
if rel ~= "" then
local Exists = nil
for i = 1, table.getn(Entry) do
if string.lower(Entry[i][2]) == string.lower(cat) and string.lower(Entry[i][3]) == string.lower(rel) then
Exists = 1
end
end
if Exists == 1 then
user:SendData(Settings.sBot,"*** Error: There's already an Entry "..rel.." in "..cat..".")
else
if (string.len(rel) > Settings.EntrySize) then
user:SendData(Settings.sBot,"*** Error: The Entry can't have more than "..Settings.EntrySize.." characters.")
else
cat = string.lower(cat)
table.insert( Entry, { user.sName, cat, rel, os.date(), 0, } )
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
SendToAll(Settings.sBot,user.sName.." freshened up "..cat.." with: "..rel..". For more details type: "..sPrefix..Settings.showCmd)
end
end
else
user:SendData(Settings.sBot,"*** Error: Please type an Entry.")
end
else
user:SendData(Settings.sBot,"*** Error: There is no Category: "..cat)
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.addCmd.." ")
end
end, 3, "Adds an entry to a category", sPrefix..Settings.addCmd.." Movies Matrix Revolutions", },
Hi jiten i am using entry bot 1.1e and i made simple modifications
When im Operator in the hub i can add new cats. but when im master i can
Can u change this so both could add?
--/----------------------------------------------------------------------------
-- Entry Bot v1.1e (6/15/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Thanks to Dessamator for the Timed Message efforts
--/ Some Features:
-- Supports pre-defined categories;
-- Commands to add, delete, show, find entries and much more;
-- Entries older than x Days are automatically deleted (optional)
-- Ability to send pre-defined category's content to main when desired
-- Includes an optimized RighClick;
--/----------------------------------------------------------------------------
Settings = {
sBot = frmHub:GetHubBotName(), -- Default Bot Name or -- sBot = "custombot"
sMenu = "Sistema de entradas", -- RightClick Menu Name
cFile = "Categoria.tbl", -- File where the Categories are stored
rFile = "Entradas.tbl", -- File where the Entries are stored
vFile = "Votos.tbl", -- File where the Voters are stored
eFolder = "Entradas", -- Folder where the .tbl files are stored
iVer = "1.1e", -- Script Version
iMax = 30, -- Maximum entries to be shown
vMax = 20, -- Maximum votes to be shown
SendOnConnect = 0, -- 1 = Send iMax Entries to every user on connect; 0 = Don't send
CatSize = 20, -- Category's size
EntrySize = 150, -- Entry's size (recommended: 75-80)
Sensitive = 0, -- 1 = Searches case-sensitive; 0 = not case-sensitive
TimedCat = 1, -- 1 = Send specific category content to main in an interval; 0: not
TimedMsg = "Quem quiser publicitar neste espa?o, contacte os Operadores", -- Message shown below each Timed Category in Main
Times = { -- ["time in 24h format"] = "Category" (not case sensitive)
["00:00"] = "cinemas",
["00:15"] = "fotologs",
["00:30"] = "Trading-Vendas",
["00:45"] = "Eventos",
["01:00"] = "cinemas",
["01:30"] = "Trading-Vendas",
["01:45"] = "Eventos",
["02:00"] = "cinemas",
["02:30"] = "Trading-Vendas",
["02:45"] = "Eventos",
["03:00"] = "cinemas",
["03:30"] = "Trading-Vendas",
["03:45"] = "Eventos",
["04:00"] = "cinemas",
["04:30"] = "Trading-Vendas",
["04:45"] = "Eventos",
["05:00"] = "cinemas",
["05:30"] = "Trading-Vendas",
["05:45"] = "Eventos",
["06:00"] = "cinemas",
["06:30"] = "Trading-Vendas",
["06:45"] = "Eventos",
["07:00"] = "cinemas",
["07:30"] = "Trading-Vendas",
["07:45"] = "Eventos",
["08:00"] = "cinemas",
["08:30"] = "Trading-Vendas",
["08:45"] = "Eventos",
["09:00"] = "cinemas",
["09:30"] = "Trading-Vendas",
["09:45"] = "Eventos",
["10:00"] = "cinemas",
["11:30"] = "Trading-Vendas",
["11:45"] = "Eventos",
["12:00"] = "cinemas",
["12:30"] = "Trading-Vendas",
["12:45"] = "Eventos",
["13:00"] = "cinemas",
["13:30"] = "Trading-Vendas",
["13:45"] = "Eventos",
["14:00"] = "cinemas",
["14:30"] = "Trading-Vendas",
["14:45"] = "Eventos",
["15:00"] = "cinemas",
["15:30"] = "Trading-Vendas",
["15:45"] = "Eventos",
["16:00"] = "cinemas",
["16:30"] = "Trading-Vendas",
["16:45"] = "Eventos",
["17:00"] = "cinemas",
["17:30"] = "Trading-Vendas",
["17:45"] = "Eventos",
["18:00"] = "cinemas",
["18:30"] = "Trading-Vendas",
["18:45"] = "Eventos",
["19:00"] = "cinemas",
["19:30"] = "Trading-Vendas",
["19:45"] = "Eventos",
["20:00"] = "cinemas",
["20:30"] = "Trading-Vendas",
["20:45"] = "Eventos",
["21:00"] = "cinemas",
["21:30"] = "Trading-Vendas",
["21:45"] = "Eventos",
["22:00"] = "cinemas",
["22:30"] = "Trading-Vendas",
["22:45"] = "Eventos",
["23:00"] = "cinemas",
["23:30"] = "Trading-Vendas",
["23:45"] = "Eventos"
},
pCleaner = 1, -- 1 = Sends cleaner actions to all; 0 = doesn't
Cleaner = 1, -- 1 = Set Automatic Cleaner On; 0 = Automatic Cleaner Off
SendRC = 1, -- 1 = Send RighClick; 0 = Don't
SendTo = { -- Send RightClick to Profile [x] = (1 = on, 0 = off)
[0] = 1, -- Master
[1] = 1, -- Operator
[2] = 1, -- VIP
[3] = 1, -- REG
[4] = 1, -- Custom Profile
[5] = 1, -- Custom Profile
[-1] = 1, -- Unreg
},
-- Commands --
addCatCmd = "addcat", delCatCmd = "delcat", showCatCmd = "showcat", addCmd = "add", TimedCmd = "rotator",
showCmd = "show", delCmd = "del", delAllCmd = "delall", findCmd = "find", helpCmd = "entryhelp",
voteCmd = "vote", TopVotesCmd = "topvote", clrVotesCmd = "clrvote",
--------------
sChar = { "-", " ", "i", "l", "r", "t", "I", "y", "o", }, -- Don't change this
}
-- If you're using Robocop profiles don't change this. If not, remove Profile 4 and 5 and follow this syntax:
-- [Profile number] = value (higher value means more rights)
Levels = { [-1] = 1, [3] = 2, [2] = 3, [1] = 4, [4] = 5, [0] = 6, [5] = 7, }
Category = {} Entry = {} tPrefixes = {} Votes = {} tabTimers = {n=0} TmrFreq = 60*1000
Main = function()
if Settings.sBot ~= frmHub:GetHubBotName() then frmHub:RegBot(Settings.sBot) end
if loadfile(Settings.eFolder.."/"..Settings.cFile) then dofile(Settings.eFolder.."/"..Settings.cFile) else os.execute("mkdir "..Settings.eFolder) end
if loadfile(Settings.eFolder.."/"..Settings.rFile) then dofile(Settings.eFolder.."/"..Settings.rFile) else io.output(Settings.eFolder.."/"..Settings.rFile) end
if loadfile(Settings.eFolder.."/"..Settings.vFile) then dofile(Settings.eFolder.."/"..Settings.vFile) end
for a,b in pairs(frmHub:GetPrefixes()) do tPrefixes[b] = 1 end
RegTimer(Cleaner, 12*60*60*1000) RegTimer(TimedCat, 60*1000) SetTimer(TmrFreq) StartTimer()
end
ChatArrival = function(sUser,sData)
local sData = string.sub(sData,1,-2)
local s,e,sPrefix,cmd = string.find(sData,"%b<>%s*(%S)(%S+)")
if sPrefix and tPrefixes[sPrefix] then
local tmp = "\r\n\t"..string.rep("-", 220)
local sHelpOutput = tmp.."\r\n"..string.rep("\t",7).."Entry Bot v."..Settings.iVer.." by jiten\t\t\t\r\n\t"..string.rep("__",220).."\r\n\tComando Disponiveis:".."\r\n\r\n"
local tCmds = {
-- Commands Structure:
-- [Command] = { function, Lowest Profile that can use this command (check Levels table), Description, Example, },
[Settings.addCatCmd] = {
function(user,data)
local s,e,cat,date = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(%d+)")
if cat and date then
if Category[string.lower(cat)] == nil then
if (string.len(cat) > Settings.CatSize) then
user:SendData(Settings.sBot,"*** Error: The Category can't have more than "..Settings.CatSize.." characters.")
else
Category[string.lower(cat)] = date
SaveToFile(Settings.eFolder.."/"..Settings.cFile,Category,"Category")
end
else
user:SendData(Settings.sBot,"*** Error: There is already a Category: "..cat)
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.addCatCmd.." ")
end
end, 6, "Add category and delete Time", sPrefix..Settings.addCatCmd.." Movies 15", },
[Settings.delCatCmd] = {
function(user,data)
local s,e,cat = string.find(data,"%b<>%s+%S+%s+(%S+)")
if cat then
if Category[string.lower(cat)] then
Category[string.lower(cat)] = nil ShowEntry(1,table.getn(Entry),1,4,cat,"",Entry)
SaveToFile(Settings.eFolder.."/"..Settings.cFile,Category,"Category")
user:SendData(Settings.sBot,cat.." was sucessfully deleted from the Categories.")
else
user:SendData(Settings.sBot,"*** Error: There is no Category: "..cat)
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.delCatCmd.." ")
end
end, 6, "Deletes an existing category", sPrefix..Settings.delCatCmd.." Movies", },
[Settings.showCatCmd] = {
function(user)
if next(Category) then
local msg = "\r\n\r\n".."\t"..string.rep("__",20).."\r\n"
msg = msg.."\t\tCategory List:\r\n"
msg = msg.."\t"..string.rep("__",20).."\r\n"
local i,v for i, v in Category do msg = msg.."\t ? "..i.." ("..v.." days)\r\n" end
user:SendData(Settings.sBot,msg)
else
user:SendData(Settings.sBot,"*** Error: There are no categories!");
end
end, 1, "Shows categories", sPrefix..Settings.showCatCmd, },
[Settings.addCmd] = {
function(user,data)
local s,e,cat,rel = string.find(data,"%b<>%s+%S+%s+(%S+)%s+(.*)")
if cat then
if Category[string.lower(cat)] then
if rel ~= "" then
local Exists = nil
for i = 1, table.getn(Entry) do
if string.lower(Entry[i][2]) == string.lower(cat) and string.lower(Entry[i][3]) == string.lower(rel) then
Exists = 1
end
end
if Exists == 1 then
user:SendData(Settings.sBot,"*** Error: There's already an Entry "..rel.." in "..cat..".")
else
if (string.len(rel) > Settings.EntrySize) then
user:SendData(Settings.sBot,"*** Error: The Entry can't have more than "..Settings.EntrySize.." characters.")
else
cat = string.lower(cat)
table.insert( Entry, { user.sName, cat, rel, os.date(), 0, } )
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
SendToAll(Settings.sBot,user.sName.." freshened up "..cat.." with: "..rel..". For more details type: "..sPrefix..Settings.showCmd)
end
end
else
user:SendData(Settings.sBot,"*** Error: Please type an Entry.")
end
else
user:SendData(Settings.sBot,"*** Error: There is no Category: "..cat)
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.addCmd.." ")
end
end, 3, "Adds an entry to a category", sPrefix..Settings.addCmd.." Movies Matrix Revolutions", },
[Settings.showCmd] = {
function(user,data)
local s,e,cat = string.find(data,"%b<>%s+%S+%s+(%S+)")
if cat then
if Category[string.lower(cat)] then
user:SendPM(Settings.sBot,ShowEntry(1, table.getn(Entry), 1, 3, cat, string.rep("\t",9).."Showing all "..cat.." "..string.rep("\t",7).."["..os.date().."]\r\n",Entry))
elseif string.lower(cat) == "all" then
user:SendPM(Settings.sBot,ShowEntry(1, table.getn(Entry), 1, 1, false, string.rep("\t",9).."Showing all entries ["..table.getn(Entry).."]"..string.rep("\t",7).."["..os.date().."]\r\n",Entry))
else
user:SendData(Settings.sBot,"*** Error: There is no Category: "..cat)
end
else
user:SendPM(Settings.sBot,ShowEntry(table.getn(Entry) - Settings.iMax + 1, table.getn(Entry), 1, 1, false, string.rep("\t",9).."Last "..Settings.iMax.." entries "..string.rep("\t",8).."["..os.date().."]\r\n",Entry))
end
end, 1, "Shows "..Settings.iMax.."/all/category entries", sPrefix..Settings.showCmd..", "..sPrefix..Settings.showCmd.." all, "..sPrefix..Settings.showCmd.." Movies", },
[Settings.delCmd] = {
function(user,data)
local s,e,rel = string.find(data,"%b<>%s+%S+%s+(.*)")
if rel then
if tonumber(rel) then
rel = tonumber(rel) local Deleted = nil
for i = 1, table.getn(Entry), 1 do
if Entry[rel] then
table.remove(Entry,rel) Deleted = 1 break
end
end
if Deleted == 1 then
user:SendData(Settings.sBot,"ID "..rel.." was successfully deleted.")
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
else
user:SendData(Settings.sBot,"*** Error: There is no ID: "..rel..".")
end
elseif Category[string.lower(rel)] then
if ShowEntry(1,table.getn(Entry),1,4,rel,"",Entry) == nil then
ShowEntry(1,table.getn(Entry),1,4,rel,"",Entry)
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
user:SendData(Settings.sBot,"Category: "..rel.." was succesfully cleaned up.")
else
user:SendData(Settings.sBot,"*** Error: There is no Category: "..rel)
end
else
if ShowEntry(1,table.getn(Entry),1,6,rel,"",Entry) == nil then
ShowEntry(1,table.getn(Entry),1,6,rel,"",Entry)
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
user:SendData(Settings.sBot,"Entry: "..rel.." was succesfully deleted.")
else
user:SendData(Settings.sBot,"*** Error: There is no Entry: "..rel)
end
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.delCmd.." ")
end
end, 4, "Deletes entry/ID/by category", sPrefix..Settings.delCmd.." Matrix Revolutions; "..sPrefix..Settings.delCmd.." 5; "..sPrefix..Settings.delCmd.." Movies", },
[Settings.delAllCmd] = {
function(user,data)
Entry = nil Entry = {} SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
user:SendData(Settings.sBot,"All entries have been deleted successfully.")
end, 6, "Deletes all entries", sPrefix..Settings.delAllCmd, },
[Settings.findCmd] = {
function(user,data)
local s,e,str = string.find(data,"%b<>%s+%S+%s+(%S+)")
if str then
user:SendPM(Settings.sBot,ShowEntry(1, table.getn(Entry), 1, 2, str, string.rep("\t",9).."Search Results of: "..str..string.rep("\t",7).."["..os.date().."]\r\n",Entry))
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.findCmd.." ")
end
end, 1, "Finds an entry by any string", sPrefix..Settings.findCmd.." Matrix", },
[Settings.helpCmd] = {
function(user)
user:SendData(Settings.sBot, sHelpOutput.."\t"..string.rep("-",220));
end, 1, "Displays this help message", sPrefix..Settings.helpCmd, },
[Settings.TimedCmd] = {
function(user,data)
local s,e,arg = string.find(data,"%b<>%s+%S+%s+(%S+)")
if arg then
if string.lower(arg) == "on" then
StartTimer() user:SendData(Settings.sBot,"Category rotator has been enabled.")
elseif string.lower(arg) == "off" then
StopTimer() user:SendData(Settings.sBot,"Category rotator has been disabled.")
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.TimedCmd.." ")
end
end, 6, "Set Category Rotator status", sPrefix..Settings.TimedCmd.." ", },
[Settings.voteCmd] = {
function(user,data)
local s,e,i = string.find(data,"%b<>%s+%S+%s+(%d+)")
if i then
if Entry[tonumber(i)] then
if Votes[user.sIP] then
user:SendData(Settings.sBot,"*** Error: You have already voted.")
else
Votes[user.sIP] = 1
Entry[tonumber(i)][5] = Entry[tonumber(i)][5] + 1
SaveToFile(Settings.eFolder.."/"..Settings.vFile,Votes,"Votes")
user:SendData(Settings.sBot,"You have successfully voted on "..Entry[tonumber(i)][3].." [Category: "..Entry[tonumber(i)][2].."].")
SendPmToOps(Settings.sBot,user.sName.." voted on "..Entry[tonumber(i)][3].." [Category: "..Entry[tonumber(i)][2].."].")
end
else
user:SendData(Settings.sBot,"*** Error: There is no ID: "..i..".")
end
else
user:SendData(Settings.sBot,"*** Syntax Error: Type "..sPrefix..Settings.voteCmd.." ")
end
end, 1, "Vote for a certain Entry", sPrefix..Settings.voteCmd.." ", },
[Settings.TopVotesCmd] = {
function(user,data)
local Voting = {}
for i = 1, Settings.vMax do
if Entry[i] and Entry[i][5] > 0 then
table.insert(Voting,{ i, Entry[i][1], Entry[i][2], Entry[i][3], Entry[i][4], Entry[i][5] })
end
end
table.sort(Voting,function(a,b) return (a[6] > b[6]) end)
user:SendPM(Settings.sBot,ShowEntry(1,Settings.vMax,1,5,false,string.rep("\t",9).."Top "..Settings.vMax.." Votes "..string.rep("\t",8).."["..os.date().."]\r\n",Voting))
end, 1, "Top Entry Voting", sPrefix..Settings.TopVotesCmd, },
[Settings.clrVotesCmd] = {
function(user,data)
for i = 1, table.getn(Entry) do
if Entry[i] then
Entry[i][5] = 0
end
end
Votes = nil Votes = {}
SaveToFile(Settings.eFolder.."/"..Settings.vFile,Votes,"Votes")
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
user:SendData(Settings.sBot,"All votes have been successfully cleared.")
end, 6, "Clear all Votes", sPrefix..Settings.clrVotesCmd, },
}
for sCmd, tCmd in tCmds do
if(tCmd[2] <= Levels[sUser.iProfile]) then
sHelpOutput = sHelpOutput.."\t"..sPrefix..sCmd..DoTabs(1,CheckSize(sPrefix..sCmd))..tCmd[3]..DoTabs(1,CheckSize(tCmd[3]))..tCmd[4].."\r\n";
end
end
if tCmds[cmd] then
if tCmds[cmd][2] <= Levels[sUser.iProfile] then
return tCmds[cmd][1](sUser,sData), 1
else
return sUser:SendData(Settings.sBot,"*** Error: You are not allowed to use this command."), 1
end
end
end
end
ToArrival = ChatArrival
function OnTimer()
for i in ipairs(tabTimers) do
tabTimers[i].count = tabTimers[i].count + 1
if tabTimers[i].count > tabTimers[i].trig then
tabTimers[i].count=1
tabTimers[i]:func()
end
end
end
function RegTimer(f, Interval)
local tmpTrig = Interval / TmrFreq
assert(Interval >= TmrFreq , "RegTimer(): Please Adjust TmrFreq")
local Timer = {n=0}
Timer.func=f
Timer.trig=tmpTrig
Timer.count=1
table.insert(tabTimers, Timer)
end
Cleaner = function()
if (Settings.Cleaner == 1) then -- RegCleaner based
local juliannow = jdate(tonumber(os.date("%d")), tonumber(os.date("%m")), tonumber(os.date("%Y")))
local chkd, clnd, x = 0, 0, os.clock()
for v,oldest in Category do
for i = 1, table.getn(Entry) do
chkd = chkd + 1 local s, e, month, day, year = string.find(Entry[i][4], "(%d+)%/(%d+)%/(%d+)");
local julian = jdate( tonumber(day), tonumber(month), tonumber("20"..year) )
if ((juliannow - julian) > tonumber(oldest)) and Entry[i][2] == v then
clnd = clnd + 1
table.remove(Entry,i)
SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry")
end;
end
end
if clnd ~= 0 and Settings.pCleaner == 1 then
SendToAll(Settings.sBot,"Entry Cleaner: "..chkd.." entries were processed and "..clnd.." were deleted. ( "..string.format("%0.2f",((clnd*100)/chkd)).."% ) in: "..string.format("%0.4f", os.clock()-x ).." seconds.") end
end
end
NewUserConnected = function(sUser)
if Settings.SendOnConnect == 1 then
sUser:SendPM(Settings.sBot,ShowEntry(table.getn(Entry) - Settings.iMax + 1, table.getn(Entry), 1, 1, false, string.rep("\t",9).."Last "..Settings.iMax.." entries "..string.rep("\t",8).."["..os.date().."]\r\n",Entry))
end
if Settings.SendTo[sUser.iProfile] == 1 and Settings.SendRC == 1 then
if sUser.bUserCommand then
if sUser.bOperator then
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Adicionar\\Categoria$<%[mynick]> !"..Settings.addCatCmd.." %[line:Categoria] %[line:maximum time in days]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Adicionar\\Entrada$<%[mynick]> !"..Settings.addCmd.." %[line:Category] %[line:Entry]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Apagar\\Categoria$<%[mynick]> !"..Settings.delCatCmd.." %[line:Categoria]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Apagar\\ID especifico$<%[mynick]> !"..Settings.delCmd.." %[line:ID]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Apagar\\Entrada especifica$<%[mynick]> !"..Settings.delCmd.." %[line:Nome da entrada]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Apagar\\Conteudo da categoria$<%[mynick]> !"..Settings.delCmd.." %[line:Nome da Categoria]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Apagar\\Todas entradas$<%[mynick]> !"..Settings.delAllCmd.."|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Definir\\Estatus do rotador$<%[mynick]> !"..Settings.TimedCmd.." %[line:on/off]|")
sUser:SendData("$UserCommand 1 3 Comandos Avancados\\"..Settings.sMenu.."\\Votar\\Limpar votos$<%[mynick]> !"..Settings.clrVotesCmd.."|")
end
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Votar\\Entrada$<%[mynick]> !"..Settings.voteCmd.." %[line:ID]|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Votar\\Top dos votos$<%[mynick]> !"..Settings.TopVotesCmd.."|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Ver\\Categorias$<%[mynick]> !"..Settings.showCatCmd.."|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Ver\\Todas entradas$<%[mynick]> !"..Settings.showCmd.." all|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Ver\\Ultimas "..Settings.iMax.." Entradas$<%[mynick]> !"..Settings.showCmd.."|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Ver\\Por categoria$<%[mynick]> !"..Settings.showCmd.." %[line:Categoria]|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Ajuda$<%[mynick]> !"..Settings.helpCmd.."|")
sUser:SendData("$UserCommand 1 3 Comando Para Usu?rios\\Sistema de Entradas\\Procurar$<%[mynick]> !"..Settings.findCmd.." %[line:String]|")
end
end
end
OpConnected = NewUserConnected
TimedCat = function()
if (Settings.TimedCat == 1) then
if Settings.Times[os.date("%H:%M")] then
local TimedMain = function(cat)
local msg = ""
msg = msg.."\r\n\r\n\t".." Categoria: "..cat.."\r\n\t"..string.rep("__",55).."\r\n\r\n\t? "
for i = 1, table.getn(Entry) do
if Entry[i] then
if string.lower(Entry[i][2]) == string.lower(cat) then
stuff = Entry[i][3]
while string.len(stuff) > 140 do
msg = msg..string.sub(stuff,1,140).."\r\n\t"
stuff = string.sub(stuff,141,string.len(stuff))
end
msg = msg..stuff.."\r\n\t? "
end
end
end
msg = string.sub(msg,1,string.len(msg)-2)
msg = msg.."\r\n\t"..Settings.TimedMsg.."\r\n\t"..string.rep("__",55).."\r\n"
return msg
end
SendToAll(TimedMain(Settings.Times[os.date("%H:%M")]))
end
end
collectgarbage(); io.flush();
end
jdate = function(d, m, y)
local a, b, c = 0, 0, 0 if m <= 2 then y = y - 1; m = m + 12; end
if (y*10000 + m*100 + d) >= 15821015 then a = math.floor(y/100); b = 2 - a + math.floor(a/4) end
if y <= 0 then c = 0.75 end return math.floor(365.25*y - c) + math.floor(30.6001*(m+1) + d + 1720994 + b)
end
ShowEntry = function(Start,End,Order,Mode,String,Header,Table)
local msg, border = "\r\n",string.rep("-", 325)
if Table == Entry then
msg = msg.." "..border.."\r\n"..Header.." "..string.rep("-- --",65).."\r\n Nr.\tVotes\tDate - Time\t\tPoster\t\t\tCategory\t\t\tEntry\r\n"
else
msg = msg.." "..border..string.rep("\t",9).."Top "..Settings.vMax.." Votes"..string.rep("\t",8).."["..os.date().."]\r\n "..string.rep("-- --",65).."\r\n Nr.\tVotes\tDate - Time\t\tPoster\t\t\tCategory\t\t\tEntry\r\n"
end
msg = msg.." "..string.rep("-- --",65).."\r\n"
for i = Start, End, Order do
if Table[i] then
local tmp = msg.." "..i..".\t"..Table[i][5].."\t"..Table[i][4].."\t\t"..Table[i][1]..DoTabs(1,CheckSize(Table[i][1]))..Table[i][2]..DoTabs(1,CheckSize(Table[i][2]))..Table[i][3].."\r\n"
if Mode == 1 then
msg = tmp
elseif Mode == 2 then
if Settings.Sensitive == 1 then
where = Table[i][1]..Table[i][2]..Table[i][3]..Table[i][4]
else
where = string.lower(Table[i][1]..Table[i][2]..Table[i][3]..Table[i][4]) String = string.lower(String)
end
if string.find(where,String) then msg = tmp end
elseif Mode == 3 then
if string.lower(Table[i][2]) == string.lower(String) then msg = tmp end
elseif Mode == 4 then
if string.lower(Table[i][2]) == string.lower(String) then table.remove(Table,i) return nil end
elseif Mode == 5 then
msg = msg.." "..Table[i][1]..".\t"..Table[i][6].."\t"..Table[i][5].."\t\t"..Table[i][2]..DoTabs(1,CheckSize(Table[i][2]))..Table[i][3]..DoTabs(1,CheckSize(Table[i][3]))..Table[i][4]..DoTabs(1,CheckSize(Table[i][4])).."\r\n"
elseif Mode == 6 then
if string.lower(Table[i][3]) == string.lower(String) then table.remove(Table,i) return nil end
end
end
end
msg = msg.." "..border.."\r\n" return msg
end
DoTabs = function(Type, size) -- nErBoS Release bot based
local sTmp = ""
if (Type == 1) then
if (size < 8) then sTmp = "\t\t\t" elseif (size < 16) then sTmp = "\t\t" else sTmp = "\t" end return sTmp
elseif (Type == 2) then
if (size < 8) then sTmp = string.rep("\t",12) elseif (size < 16) then sTmp = string.rep("\t",11) elseif (size < 24) then sTmp = string.rep("\t",10)
elseif (size < 32) then sTmp = string.rep("\t",9) elseif (size < 40) then sTmp = string.rep("\t",8) elseif (size < 48) then sTmp = string.rep("\t",7)
elseif (size < 56) then sTmp = string.rep("\t",6) elseif (size < 64) then sTmp = string.rep("\t",5) elseif (size < 72) then sTmp = "\t\t\t\t"
elseif (size < 80) then sTmp = "\t\t\t" elseif (size < 88) then sTmp = "\t\t" else sTmp = "\t" end return sTmp
end
end
CheckSize = function(String) -- nErBoS Release bot based
local realSize,aux,remove = string.len(String),1,0
while aux < realSize + 1 do
for i=1, table.getn(Settings.sChar) do if (string.sub(String,aux,aux) == Settings.sChar[i]) then remove = remove + 0.5 end end
aux = aux + 1
end return realSize - remove
end
Serialize = function(tTable,sTableName,hFile,sTab)
sTab = sTab or "";
hFile:write(sTab..sTableName.." = {\n");
for key,value in tTable do
if (type(value) ~= "function") then
local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
if(type(value) == "table") then
Serialize(value,sKey,hFile,sTab.."\t");
else
local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
hFile:write(sTab.."\t"..sKey.." = "..sValue);
end
hFile:write(",\n");
end
end
hFile:write(sTab.."}");
end
SaveToFile = function(file,table,tablename)
local hFile = io.open(file,"w+") Serialize(table,tablename,hFile); hFile:close()
end
--/----------------------------------------------------------------------------
Quite Big :-) Cheers...
Markitos, there was no need to post all the script. You could ask for it and if necessary, then, post it.
Anyway, in the addCat function, replace the red value to "4":
end, [COLOR=red]6[/COLOR], "Add category and delete Time", sPrefix..Settings.addCatCmd.." Movies 15", },
Best regards
QuoteOriginally posted by jiten
Markitos, there was no need to post all the script. You could ask for it and if necessary, then, post it.
Anyway, in the addCat function, replace the red value to "4":
end, [COLOR=red]6[/COLOR], "Add category and delete Time", sPrefix..Settings.addCatCmd.." Movies 15", },
Best regards
Sorry jiten...thnks for the help but whats the diference about and 5 in the script? They are number of profiles?
Respectfully
QuoteOriginally posted by Markitos
whats the diference about and 5 in the script? They are number of profiles?
Sort of.
-- If you're using Robocop profiles don't change this. If not, remove Profile 4 and 5 and follow this syntax:
-- [Profile number] = value (higher value means more rights)
Levels = { [-1] = 1, [3] = 2, [2] = 3, [1] = 4, [4] = 5, [0] = 6, [5] = 7, }
As you can see in this table, a specific value is assigned to each profile number. The lowest profile, the lowest assignd number.
For example, the profile with less privileges ( -1 = UnReg ) has a value of "1" and the one with most ( 5 = NetFounder ) has a value of "7".
Hope this helps you.
Regards
--/----------------------------------------------------------------------------
-- Entry Bot v1.1f (6/27/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: Cleaner and TimedCat (changed to ipairs)
-- Added: Custom cleaner check
-- Minor fixes
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.co.mz/i/forum_files/Entry.v1.1f.rar).
[/list]
link is dead :P
QuoteOriginally posted by Re@SoN
link is dead :P
Yes...the link was dead since yesterday...
QuoteOriginally posted by Re@SoN
link is dead :P
The site is going through some maintainances but it'll be back today, I guess. Sorry for the trouble ;)
Best regards
--/----------------------------------------------------------------------------
-- Entry Bot v1.1g (7/04/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Fixed: Cleaner
-- Minor fixes
--/----------------------------------------------------------------------------
Grab it
HERE (http://mznetwork.co.mz/i/forum_files/Entry.v1.1g.rar).
[/list]
hi!
Jiten i downloaded the new version 1.1g and when i open the script i have seen this (in red):
-- Entry Bot v1.1g (7/4/2005)
-- For PtokaX 0.3.3.0 build 17.02 or Higher
-- Thanks to Dessamator for the Timed Message efforts
--/ Some Features:
-- Supports pre-defined categories;
-- Commands to add, delete, show, find entries and much more;
-- Entries older than x Days are automatically deleted (optional)
-- Ability to send pre-defined category's content to main when desired
-- Includes an optimized RighClick;
--/----------------------------------------------------------------------------
Settings = {
sBot = frmHub:GetHubBotName(), -- Default Bot Name or -- sBot = "custombot"
sMenu = "Entry Point", -- RightClick Menu Name
cFile = "Category.tbl", -- File where the Categories are stored
rFile = "Entry.tbl", -- File where the Entries are stored
vFile = "Votes.tbl", -- File where the Voters are stored
eFolder = "Entry", -- Folder where the .tbl files are stored
[COLOR=red]iVer = "1.1f",[/COLOR] -- Script Version
iMax = 30, -- Maximum entries to be shown
vMax = 20, -- Maximum votes to be shown
SendOnConnect = 0, -- 1 = Send iMax Entries to every user on connect; 0 = Don't send
CatSize = 20, -- Category's size
EntrySize = 80, -- Entry's size (recommended: 75-80)
Sensitive = 0, -- 1 = Searches case-sensitive; 0 = not case-sensitive
TimedCat = 0, -- 1 = Send specific category content to main in an interval; 0: not
TimedMsg = "your message", -- Message shown below each Timed Category in Main
Times = { -- ["time in 24h format"] = "Category" (not case sensitive)
["12:30"] = "cat1",
["13:00"] = "cat2",
thing this must be something like 1.1g correct me if i'm wrong... :P
for the rest script works fine ;)
best regards,
Re@SoN
it's nothing important...because it will not interfere with the normal fucntion of script and anyone could correct that..just a simple error(it's appeans)..nothing to worry about ;)
QuoteOriginally posted by Re@SoN
it's nothing important...because it will not interfere with the normal fucntion of script and anyone could correct that..just a simple error(it's appeans)..nothing to worry about ;)
Thanks for the tip m8.
That's the result of doing things without much time :D
Best regards
I use PX v0.3.3.1 [debug], RoboCop v10.01e and Entry v1.1g
1) Seems 2 me that You forgot to save entry.tbl after a vote and therefore when the hub is restarted in the entry table the votes are not displayed, even those votes are counted in votes.tbl (i added another line SaveToFile(Settings.eFolder.."/"..Settings.rFile,Entry,"Entry"))
2) The !topvote doesnt seem to work for me, it shows the header but NO actual voting. (+find is performing well)
3) The +vote command is not also performing well, i mean after i voted an , when i want to vote again for ANOTHER its showing 'already voted' err.
5) Is there any posibility to add another column or a \t in EntryTitle to add a link to a website (like the official site for a movie or an IMDB reference), but of course not to show the entire link due' to limited screen space restriction, but just a small /www.> that users can click on it and go to the website, like when they click on a site posted in mainchat.
6) Adding subcategories will be awesome, like /Movies, /Movies/Series...
7) Another small suggestion .. if one is adding a cat, not to be displayed in list in lowercase, i mean when i add "Movies" not to display "movies" in cat column. Thats only for displaying a cat in list when !show, of course, when performing an action on the database like searching or adding another cat to not differentiate "Movies" from "movies".
Thank you very much for your work and support ! :)
Entry Bot v1.2 (7/4/2005)
For PtokaX 0.3.3.0 build 17.02 or Higher
Changelog:
- Added and Fixed all stuff reported by hnr21
HERE (http://www.mznetwork.co.mz/scripts/Entry.v1.2.rar).[/list]
Entry Bot v2 (1/22/2006)
For PtokaX 0.3.3.0 build 17.02 or Higher
Changelog:
- Added: Support for sub-categories
- Changed: Code structure
- Removed: Some extra code
HERE (http://www.mznetwork.co.mz/scripts/Entry.v2.rar).[/list]
Entry Bot v2.1 (3/20/2006) for PtokaX 0.3.3.0 build 17.02 or Higher
Changelog:
- Removed: Sub-category support;
- Added: RSS Feed support (concept from st0ne-db`s Console NFO RSS bot);
- Add/Del/Show commands;
- Inbuild queue and cache.
- Removed: Unnecessary code;
- Added: Comments to the code;
- Changed: Command parsing and table structure;
- Removed: Levels table;
- Changed: RightClick is sent in alphabetical order;
- Changed: Cleaner;
- Fixed: 1.1 to 1.0 in wCmd (thanks to BrotherBear)
- Changed: Other mods.
ATTENTION: In order to use use the RSS Mode, you must download the latest PxWSA lib (PxWSA 0.1.0) and unzip it to your scripts\libs\ folder.
HERE (http://www.mznetwork.co.mz/scripts/Entry.v2.1.rar).[/list]
when released entrybot for 5.1?
Quote from: TrIp-iN-SuN on 24 August, 2006, 02:13:44
when released entrybot for 5.1?
This script has already been converted to LUA 5.1.
Search its 'Finished Scripts' section.
no it's not converted i don't find this
Quote from: TrIp-iN-SuN on 24 August, 2006, 15:03:19
no it's not converted i don't find this
Are you sure? Check this: http://forum.ptokax.org/index.php?topic=5882.0
Don't be afraid to use the
Search button :P
tnx bro :P