Finally debugged and converted, also added a search function, as i got the idea from someone from here. If you have any requests please post, seems I have taken over this 3.x version.
-- FreshStuff v.3.5
-----------------------------------------------------------------------------------------
-- original idea/script by chilla
-- completely rewriten by plop
-- if you were running 3.0 then you gotta delete the old file
-- it's incompatible with this version
-- deleting now goes by id number
-- anounces the new releas in mainchat
-----------------------------------------------------------------------------------------
-- converted to lua5 and added search function by bastya_elvtars
-- Name the commands to what U like
-- This command adds stuff, syntax : +addalbum TYPE/CATAGORY THESTUFF2ADD
cmd1 = "+addalbum"
-- This command shows the stuff, syntax : +albums with options new/game/warez/music/movie
cmd2 = "+albums"
-- This command deletes an entry, syntax : +delalbum THESTUFF2DELETE
cmd3 = "+delalbum"
-- This command shows the latest stuff, syntax : +newalbums
cmd4 = "+newalbums"
-- This command reloads the txt file. syntax : +reloadalbums
-- (this command is needed if you manualy edit the text file)
cmd5 = "+reloadalbums"
-- This is for searching inside releases.
cmd6="+searchalbum"
-- Show latest stuff on entry 1=yes, 0=no
ShowOnEntry = 0
-- Max stuff shown on newalbums/entry
MaxNew = 20
-- The file storing the stuff
file = "releases.dat"
-- Name of the bot
Bot = "post-it_memo"
-- you can add catagory's yourself ["trigger_name"]="catagory_name"
Types = {["movie"] = "Movies", ["music"]="Music", ["warez"]="Warez", ["game"]="Games"}
--------------------- don't change anything below here
AllStuff = {}
NewestStuff = {}
function Main()
frmHub:RegBot(Bot)
ReloadRel()
end
function NewUserConnected(user)
if ShowOnEntry == 1 then
user:SendPM(Bot, MsgNew.."|")
end
end
function OpConnected(user)
if ShowOnEntry == 1 then
user:SendPM(Bot, MsgNew.."|")
end
end
function ChatArrival(user,data)
data = string.sub(data,1,string.len(data)-1)
s,e,cmd,type,tune = string.find(data, "%b<>%s+(%S+)%s*(%S*)%s*(.*)")
if cmd == cmd2 then
if type == "" then
user:SendPM(Bot, MsgAll.."|")
elseif type == "new" then
user:SendPM(Bot, MsgNew.."|")
elseif Types[type] then
ShowRelType(type)
user:SendPM(Bot, MsgType.."|")
end
return 1
elseif cmd == cmd4 then
user:SendPM(Bot, MsgNew.."|")
return 1
elseif user.bOperator then
if cmd == cmd3 then
if type ~= "" then
DelRel(user, type)
else
user:SendData(Bot, "yea right, like i know what i got 2 delete when you don't tell me!|")
end
return 1
elseif cmd == cmd1 then
if tune ~= "" and Types[type] then
AddRel(user, tune, type)
elseif Types[type] == nil then
user:SendData(Bot, "I need to know the catagory to add it to!|")
else
user:SendData(Bot, "yea right, like i know what you got 2 add when you don't tell me!|")
end
return 1
elseif cmd == cmd5 then
Reload()
user:SendData(Bot, "Albums reloaded!|")
elseif cmd==cmd6 then
if type~="" and tune=="" then
SearchRel(user,type)
else
user:SendData(Bot, "yea right, like i know what you got 2 search when you don't tell me!|")
end
return 1
end
end
end
function OpenRel()
AllStuff = nil
NewestStuff = nil
AllStuff = {}
NewestStuff = {}
Count = 0
Count2 = 0
local f=io.open(file,"r")
if f then
for line in f:lines() do
Count = Count +1
AllStuff[Count]=line
end
end
if Count > MaxNew then
local temp = Count - MaxNew + 1
for i=temp, Count do
Count2 = Count2 + 1
NewestStuff[Count2]=AllStuff[i]
end
else
for i=1, Count do
Count2 = Count2 + 1
NewestStuff[Count2]=AllStuff[i]
end
end
end
function ShowRel(table)
Msg = "\r\n"
if table == NewestStuff then
if Count2 == 0 then
MsgNew = "\r\n\r\n".." --------- The Latest Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- The Latest Releases -------- \r\n\r\n"
else
for i=1, Count2 do
s,e,type,who,when,title=string.find(NewestStuff[i], "(.+)$(.+)$(.+)$(.+)")
if title then
Msg = Msg.." "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
else
Msg = Msg..NewestStuff[i].."\r\n"
end
end
MsgNew = "\r\n\r\n".." --------- The Latest "..MaxNew.." Releases -------- "..Msg.."\r\n --------- The Latest "..MaxNew.." Releases -------- \r\n\r\n"
end
else
if Count == 0 then
MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- All The Releases -------- \r\n\r\n"
else
MsgHelp = " use "..cmd2.." for a,b in Types do
MsgHelp = MsgHelp.."/"..a
end
MsgHelp = MsgHelp.."> to see only the selected types"
for i=1, Count do
s,e,type,who,when,title=string.find(AllStuff[i], "(.+)$(.+)$(.+)$(.+)")
if title then
Msg = Msg.." ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
else
Msg = Msg..AllStuff[i].."\r\n"
end
end
MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- "..Msg.."\r\n --------- All The Releases -------- \r\n"..MsgHelp.."\r\n"
end
end
end
function ShowRelType(what)
Msg = "\r\n"
tmp = 0
if Count == 0 then
MsgType = "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n\r\n No "..string.lower(Types[what]).." yet\r\n\r\n --------- All The "..Types[what].." -------- \r\n\r\n"
else
for i=1, Count do
s,e,type,who,when,title=string.find(AllStuff[i], "(.+)$(.+)$(.+)$(.+)")
if type == what then
tmp = tmp + 1
Msg = Msg.." "..when.." -- "..who.." -- "..title.."\r\n"
end
end
if tmp == 0 then
MsgType = "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n\r\n No "..string.lower(Types[what]).." yet\r\n\r\n --------- All The "..Types[what].." -------- \r\n\r\n"
else
MsgType= "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n"..Msg.."\r\n --------- All The "..Types[what].." -------- \r\n\r\n"
end
end
end
function AddRel(user, what, type)
Count = Count + 1
AllStuff[Count]=(type.."$"..user.sName.."$"..os.date("%x").."$"..what)
user:SendData(Bot, what.." is added to the releases as "..type.."|")
SendToAll(Bot, user.sName.." added to the "..type.." releases: "..what.."|")
SaveRel()
ReloadRel()
end
function DelRel(user, what)
if tonumber(what) then
what = tonumber(what)
if AllStuff[what] then
local s,e,which=string.find(AllStuff[what], "([^%$]+)$")
user:SendData(Bot, which.." is deleted from the releases|")
AllStuff[what]=nil
SaveRel()
ReloadRel()
else
user:SendData(Bot, what.." wasn't found in the releases|")
end
else
user:SendData(Bot, "I need the ID number to delete a releas|")
end
end
function SaveRel()
local f= io.open(file,"w+")
for i=1,Count do
if AllStuff[i] then
f:write(AllStuff[i].."\n")
end
end
f:flush()
f:close(f)
end
function ReloadRel()
OpenRel()
ShowRel(NewestStuff)
ShowRel(AllStuff)
end
function DelRelOld(user, what)
Okie = nil
for a,b in AllStuff do
s,e,title=string.find(b, ".+$(.+)$")
if title == what then
AllStuff[a]=nil
user:SendData(Bot, what.." is removed from the releases|")
Okie = 1
break
end
end
if Okie then
SaveRel()
ReloadRel()
else
user:SendData(Bot, what.." wasn't found in the releases|")
end
end
function SearchRel(user,what)
local res=0
local rest={}
local _,_,bdc=string.find(what,"([%%%[%]%(%)%*%+%-%?%^])")
local msg=""
if bdc then
user:SendData(Bot,"you cannot use the character "..bdc)
return
end
for a,b in AllStuff do
if string.find(b,what) then
table.insert(rest,b)
end
end
if table.getn(rest)~=0 then
for a=1,table.getn(rest) do
s,e,type,who,when,title=string.find(rest[a], "(.+)$(.+)$(.+)$(.+)")
res = res + 1
msg = msg.."\r\n "..when.." -- "..who.." -- "..title
end
user:SendPM(Bot,msg.."\r\n\r\n"..res.." results.")
else
user:SendData(Bot,"Search string "..what.." was not found in releases database.")
end
end
Gettin this error man Syntax C:\PHH-NEW\scripts\Fresh3.5.lua:207: attempt to call global `date' (a nil value)
Thx for reporting, edited the script above.
Yer it works now man. Also in ma current version of Fresh when an item is added I've got this:
function AddRel(user, what, type)
Count = Count + 1
AllStuff[Count]=(type.."$"..user.sName.."$"..os.date("%x").."$"..what)
user:SendData(Bot, what.." is added to the releases as "..type.."|")
local msg = "|\r\n \r\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n"
..what.." Has Jus' Been Added To The Pure Hip-Hop Releases As "..type..""..
"\r\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\r\n"
SendToAll(Bot, user.sName.." added to the "..type.." releases: "..what.."|")
SaveRel()
ReloadRel()
end
I put it in ur version but it aint workin, is it possible to adapt?
Tried this one out and its simply awesome!!! Something you could help me with though is what would I have to add\change that would allow all profiles to add to it, instead of just Ops masters ect..? This feature would be most excellent for the hub I run :)
Again, nicely done!
hello ppl
this is great conversation m8
=)
well i test it out and everything is working great
exept 1 thing the _-->>> cmd6="+searchalbum"
this command doesnt seems to work
can you help ??
QuoteOriginally posted by XPMAN
Tried this one out and its simply awesome!!! Something you could help me with though is what would I have to add\change that would allow all profiles to add to it, instead of just Ops masters ect..? This feature would be most excellent for the hub I run :)
Again, nicely done!
Yes, gonna make a complete rewrite soon. What will be in it?
- Nicer listing (can be ordered by owner, name and category hopefully).
- Profile-specific setting of commands.
- Optimized metadata handling routine.
- Flushing of releases, secured by secret code.
- Autodeleting of old releases.
QuoteOriginally posted by bastya_elvtars
QuoteOriginally posted by XPMAN
Tried this one out and its simply awesome!!! Something you could help me with though is what would I have to add\change that would allow all profiles to add to it, instead of just Ops masters ect..? This feature would be most excellent for the hub I run :)
Again, nicely done!
Yes, gonna make a complete rewrite soon. What will be in it?
- Nicer listing (can be ordered by owner, name and category hopefully).
- Profile-specific setting of commands.
- Optimized metadata handling routine.
- Flushing of releases, secured by secret code.
- Autodeleting of old releases.
gogogogo
plop
Ok, made a 3.7 version, changes are:
- Metadata handling rewritten
- Added ability to delete releases with one single line (i. e. +delalbum 1,3,45,6666)
- Few minor bugfixes
- Extended search a lil.
Download here. (http://www.aokol.u-szeged.hu/freshstuff37.lua)
Great job, bastya! :)
Btw, I was testing the FreshStuff 3.7 script and found a small "bug".
When I add a release with more than one line like this:
[22:04:16] jiten added to the movie releases: sssssssssssssssssssssssss
sssssssssssssssssssssssss
sssssssssssssssssssssssss
and then try to see the releases i get this:
[22:04]
--------- All The Releases --------
ID: 1 -- 03/21/05 -- jiten -- movie -- sssssssssssssssssssssssss
--------- All The Releases --------
use +albums to see only the selected types
It only reads the first line of the multi-line entry.
Can u check that, please?
Thanks in advance...
jiten
Here is a preview of 4.0, changed many-many things. You should back your files up.
Usage:
- Extract the archive to the PtokaX scripts folder
- Copy your releases file to the folder named freshstuff.
There can be bugs, altho kept testing it.
Download here (http://lawmaker.no-ip.org/download.php?get=Li91cGxvYWRzL290aGVyL2ZyZXNoc3R1ZmYzLjQuMHByZTEuemlw).
Keep it coming, bastya :]
Gonna test it l8r.
Cheers
yo can sum1 upload a easy .lua file that i can use for releases but i need one for ptokax 0.3.3.0 bulid 16.09 and robocop 10b . thank you
Please tell me why this is NOT easy.
If you mean the config, the default settings are good.
No feedback @ all? :(
QuoteOriginally posted by bastya_elvtars
No feedback @ all? :(
hmm, feedback, really, heres some for u:::
QuoteSyntax ....3.3.0.b16.09.nt.rls\scripts\freshstuff3.4.0pre1.lua:300: attempt to concatenate global `MsgHelp' (a nil value)
Quoteline 300:
MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- "..Msg.."\r\n --------- All The Releases -------- \r\n"..MsgHelp.."\r\n"
:D
This error should NEVER occur. What brings it on? Could you please post your configuration?
QuoteOriginally posted by bastya_elvtars
This error should NEVER occur. What brings it on? Could you please post your configuration?
configuration, what configuration?, i downloaded the script, extracted to the script folder, restarted the scripts, and voila, there was the error that should "NEVER occur", NB.: i didnt change anything, and all others scripts were switched off !!
What is in your freshstuff folder?
QuoteWhat is in your freshstuff folder?
well in the beginning there was only categories.dat, now there are two files namely :::
categories.dat, releases.dat
btw, im running ptokax 16.09, mayb thats the prob
That should not be a problem, this does not use too much of the api. However I haven't yet tested it with 16.09 as I am lazy. :)
MsgHelp error occurs when some commands are nil or there are no categories.
Oh, and please delete the OnExit() function and test it again.
nothing changed, same error ! :rolleyes: , well, ull just have to get past ur laziness, and "DOWNLOAD" ptokax 16.09 from here (//www.ptokax.org) , there i even put a link to help with ur "laziness"
function ShowRel(table)
Msg = "\r\n"
local type,who,when,title
if table == NewestStuff then
if Count2 == 0 then
MsgNew = "\r\n\r\n".." --------- The Latest Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- The Latest Releases -------- \r\n\r\n"
else
for i=1, Count2 do
if NewestStuff[i] then
type,who,when,title=NewestStuff[i][1],NewestStuff[i][2],NewestStuff[i][3],NewestStuff[i][4]
if title then
Msg = Msg.." ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
else
Msg = Msg..(table.concat(NewestStuff[i])).."\r\n"
end
end
end
end
MsgNew = "\r\n\r\n".." --------- The Latest "..MaxNew.." Releases -------- "..Msg.."\r\n --------- The Latest "..MaxNew.." Releases -------- \r\n\r\n"
else
if Count == 0 then
MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- All The Releases -------- \r\n\r\n"
else
MsgHelp = " use "..commands.cmd2.." for a,b in Types do
MsgHelp = MsgHelp.."/"..a
end
MsgHelp = MsgHelp.."> to see only the selected types"
for i=1, Count do
if AllStuff[i] then
type,who,when,title=AllStuff[i][1],AllStuff[i][2],AllStuff[i][3],AllStuff[i][4]
if title then
Msg = Msg.." ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
else
Msg = Msg..(table.concat(AllStuff[i])).."\r\n"
end
end
end
MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- "..Msg.."\r\n --------- All The Releases -------- \r\n"..MsgHelp.."\r\n"
end
end
end
solved, i think, i just moved the:
MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- "..Msg.."\r\n --------- All The Releases -------- \r\n"..MsgHelp.."\r\n"
,upwards now its after 3 "end" and not 4!
btw, theres only a trig to add categories, y not add 1 to delete them?
I wanna test for BUGS first, not add anything, if you do not use a category, it will not show up, altho planning to add.
BTW yes,you found the bug, I just ignored this one, good job! :P
The weird thing is, when I trigger saving from a normal function, it saves categories, but at OnExit() it only saves {}. Maybe the tables are flushed before OnExit(), I will ask PPK, but OnExit is not mandatory anyway, just a play-safe thing. THX again for the bug fix, gonna add category listing and deleting command.
Also, post some more feature requests if you want to!
QuoteOriginally posted by bastya_elvtars
I wanna test for BUGS first, not add anything, if you do not use a category, it will not show up, altho planning to add.
BTW yes,you found the bug, I just ignored this one, good job! :P
The weird thing is, when I trigger saving from a normal function, it saves categories, but at OnExit() it only saves {}. Maybe the tables are flushed before OnExit(), I will ask PPK, but OnExit is not mandatory anyway, just a play-safe thing. THX again for the bug fix, gonna add category listing and deleting command.
Also, post some more feature requests if you want to!
indeed it was a great job, i charge 1 dolar per word, ill expect my wage at the end of the week, :D.
anyways, yw.
for the testing of bugs, well u better use a good bug spray, i will bring all the bugs out, :D
feature requests, lets c. a timer to display categories, an on or off switch for that, and something to remove automaticaly old albums , after a some days weeks or whatever !!,
anyways hows the clone alert going, any progress?
All the functions you mentioned were planned (pruning, mainchat, etc.)
About clonebot: need to find a good method.
hello again , well i have the same problem too , when the hub is restarting the categories don t saved so i when it the old releases of the script
why is this happpeneing ??
bastya_elvtars r you gonna fix a new release unbaged ?? can t wait _!!
hop the script gonna end some day =)
can somebody give me a working link for this script? thx
OK, the fixed version is online, this (http://tweaky.dox.hu/freshstuff3.4.0pre2.zip) link should work.
Tried the new version and the problem with the categories still remains.
After restarting the scripts, now the contents of "categories.dat" aren't lost but, it doesn't seem to load it. So, when trying to add something, he says that the category doesn't exist.
Here:
[18:46:27] The category cinemas has successfully been added.
[18:46:38] Test is added to the releases as cinemas
[18:46:38] jiten added to the cinemas releases: Test
[18:46:41] *** Parts: ?bot?
[18:46:45] Unknown category: cinemas
well i decided to use the older version it works great exept this function with the +rlsfind
and something more VIPs can t add releases =/ this is not good
can anyone fix this?
-- FreshStuff 3 - 3.7beta ----------------------------------------------------------------------------------------- -- original idea/script by chilla -- completely rewriten by plop -- taken over by bastya_elvtars (the rock n' roll doctor) -- if you were running 3.0 then you gotta delete the old file -- it's incompatible with this version -- deleting now goes by id number -- anounces the new releas in mainchat ----------------------------------------------------------------------------------------- --------------------------- 3.7 ----------------------------- -- converted to lua5 and added search function by bastya_elvtars -- also taken over with permission by plop. :P -- rewrote the metadata routine: pattern matching is applied upon opening, using nested arrays ---> faster. -- added ability to delete multiple releases with a single line. --------------------------- 3.7.5 ----------------------------- -- added choice between showing in main or PM on entry -- new stuff is shown by real ID (idea by LiqUiD~TrolL) -- security fixes have been made, corrupt entries are ignored ----------------------------------------------------------------------------------------- senddebugto={"[TGA-OP]bastya_elvtars"} -- Name the commands to what U like -- This command adds stuff, syntax : +addalbum TYPE/CATAGORY THESTUFF2ADD cmd1 = "+addrls" -- This command shows the stuff, syntax : +albums with options new/game/warez/music/movie cmd2 = "+rlsall" -- This command deletes an entry, syntax : +delalbum THESTUFF2DELETE cmd3 = "+delrls" -- This command shows the latest stuff, syntax : +newalbums cmd4 = "+rls" -- This command reloads the txt file. syntax : +reloadalbums -- (this command is needed if you manualy edit the text file) cmd5 = "+reloadalbums" -- This is for searching inside releases. cmd6="+rlsfind" -- Show latest stuff on entry 1=PM, 2=mainchat, 0=no ShowOnEntry = 0 -- Max stuff shown on newalbums/entry MaxNew = 40 -- The file storing the stuff file = "releases.dat" -- Name of the bot Bot = "•NemO•" -- you can add catagory's yourself ["trigger_name"]="catagory_name" Types = {["psychedelic"] = "Psychedelic", ["ambient"]="Ambient", ["electronic"]="Electronic", ["psytrance"]="Psytrance", ["goa"]="Goa", ["chill"]="Chill", ["psytrance"]="Psytrance", ["house"]="House", ["proggresive"]="Proggresive", ["trance"]="Trance", ["psymovie"]="Psymovie"} --------------------- don't change anything below here AllStuff = {} NewestStuff = {} function Main() frmHub:RegBot(Bot) ReloadRel() end function Show(user) if ShowOnEntry ~=0 then if ShowOnEntry==1 then user:SendPM(Bot, MsgNew.."|") end end end function NewUserConnected(user) Show(user) end function ChatArrival(user,data) data = string.sub(data,1,string.len(data)-1) local _,_,cmd,type,tune = string.find(data, "%b<>%s+(%S+)%s*(%S*)%s*(.*)") if cmd == cmd2 then if type == "" then user:SendPM(Bot, MsgAll.."|") elseif type == "new" then user:SendPM(Bot, MsgNew.."|") elseif Types[type] then ShowRelType(type) user:SendPM(Bot, MsgType.."|") end return 1 elseif cmd == cmd4 then user:SendPM(Bot, MsgNew.."|") return 1 elseif user.bOperator then if cmd == cmd3 then if type ~= "" then DelRel(user, type) else user:SendData(Bot, "yea right, like i know what i got 2 delete when you don't tell me!|") end return 1 elseif cmd == cmd1 then if tune ~= "" and Types[type] then AddRel(user, tune, type) elseif Types[type] == nil then user:SendData(Bot, "I need to know the catagory to add it to!|") else user:SendData(Bot, "yea right, like i know what you got 2 add when you don't tell me!|") end return 1 elseif cmd == cmd5 then ReloadRel() user:SendData(Bot, "Albums reloaded!|") elseif cmd==cmd6 then if type~="" and tune=="" then SearchRel(user,type) else user:SendData(Bot, "yea right, like i know what you got 2 search when you don't tell me!|") end return 1 end end end function OpenRel() AllStuff = nil NewestStuff = nil AllStuff = {} NewestStuff = {} Count = 0 Count2 = 0 local f=io.open(file,"r") if f then for line in f:lines() do Count = Count +1 local _,_,type,who,when,title=string.find(line, "(.+)$(.+)$(.+)$(.+)") if type and who and when and title then AllStuff[Count]={type,who,when,title} else SendToOps(Bot, "Releases file is corrupt, failed to load all items.") end end f:close() end if Count > MaxNew then local tmp = Count - MaxNew + 1 Count2=Count - MaxNew + 1 for i = tmp, Count do Count2=Count2 + 1 if AllStuff[Count2] then NewestStuff[Count2]=AllStuff[Count2] end end else for i=1, Count do Count2 = Count2 + 1 if AllStuff[i] then NewestStuff[Count2]=AllStuff[i] end end end end function ShowRel(table) Msg = "\r\n" local type,who,when,title if table == NewestStuff then if Count2 == 0 then MsgNew = "\r\n\r\n".." --------- The Latest Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- The Latest Releases -------- \r\n\r\n" else for i=1, Count2 do if NewestStuff[i] then type,who,when,title=NewestStuff[i][1],NewestStuff[i][2],NewestStuff[i][3],NewestStuff[i][4] if title then Msg = Msg.." ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n" else Msg = Msg..(table.concat(NewestStuff[i])).."\r\n" end end end end MsgNew = "\r\n\r\n".." --------- The Latest "..MaxNew.." Releases -------- "..Msg.."\r\n --------- The Latest "..MaxNew.." Releases -------- \r\n\r\n" else if Count == 0 then MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- All The Releases -------- \r\n\r\n" else MsgHelp = " use "..cmd2.." to see only the selected types" for i=1, Count do if AllStuff[i] then type,who,when,title=AllStuff[i][1],AllStuff[i][2],AllStuff[i][3],AllStuff[i][4] if title then Msg = Msg.." ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n" else Msg = Msg..(table.concat(AllStuff[i])).."\r\n" end end end end MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- "..Msg.."\r\n --------- All The Releases -------- \r\n"..MsgHelp.."\r\n" end end function ShowRelType(what) local type,who,when,title Msg = "\r\n" tmp = 0 if Count == 0 then MsgType = "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n\r\n No "..string.lower(Types[what]).." yet\r\n\r\n --------- All The "..Types[what].." -------- \r\n\r\n" else for i=1, Count do type,who,when,title=AllStuff[i][1],AllStuff[i][2],AllStuff[i][3],AllStuff[i][4] if type == what then tmp = tmp + 1 Msg = Msg.." "..when.." -- "..who.." -- "..title.."\r\n" end end if tmp == 0 then MsgType = "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n\r\n No "..string.lower(Types[what]).." yet\r\n\r\n --------- All The "..Types[what].." -------- \r\n\r\n" else MsgType= "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n"..Msg.."\r\n --------- All The "..Types[what].." -------- \r\n\r\n" end end end function AddRel(user, what, type) Count = Count + 1 AllStuff[Count]={type,user.sName,os.date("%x"),what} user:SendData(Bot, what.." is added to the releases as "..type.."|") SendToAll(Bot, user.sName.." added to the "..type.." releases: "..what.."|") SaveRel() ReloadRel() end function DelRel(user, what) string.gsub(what,"(%d+)",function(what) what = tonumber(what) if what then if AllStuff[what] then local which=(AllStuff[what][4]) user:SendData(Bot, which.." is deleted from the releases|") AllStuff[what]=nil else user:SendData(Bot, "release numbered "..what.." wasn't found in the releases|") end else user:SendData(parseenv(user,env,Bot).. "I need the ID number to delete an entry.|") end end) SaveRel() ReloadRel() end function SaveRel() local f= io.open(file,"w+") for i=1,Count do if AllStuff[i] then f:write(AllStuff[i][1].."$"..AllStuff[i][2].."$"..AllStuff[i][3].."$"..AllStuff[i][4].."\n") end end f:flush() f:close(f) end function ReloadRel() OpenRel() ShowRel(NewestStuff) ShowRel(AllStuff) end function DelRelOld(user, what) Okie = nil local title for a,b in AllStuff do title=b[4] if title == what then AllStuff[a]=nil user:SendData(Bot, what.." is removed from the releases|") Okie = 1 break end end if Okie then SaveRel() ReloadRel() else user:SendData(Bot, what.." wasn't found in the releases|") end end function SearchRel(user,what) local res=0 local rest={} local _,_,bdc=string.find(what,"([%%%[%]%(%)%*%+%-%?%^])") local msg="\r\n---------- You searched for keyword \""..what.."\". The results: ----------\r\n" if bdc then user:SendData(Bot,"you cannot use the character "..bdc) return end for a,b in AllStuff do if string.find(b[4],what) then table.insert(rest,{b[1],b[2],b[3],b[4]}) end end if table.getn(rest)~=0 then for i=1,table.getn(rest) do local type,who,when,title=rest[i][1],rest[i][2],rest[i][3],rest[i][4] res= res + 1 msg = msg.."\r\n "..when.." -- "..who.." -- "..title end msg=msg.."\r\n\r\n"..res.." results." else msg=msg.."\r\nSearch string "..what.." was not found in releases database." end user:SendPM(Bot,msg) end function OnError(ErrorMsg) if enabledebug==1 then for f=1,table.getn(senddebugto) do SendPmToNick(senddebugto[f],Bot, ErrorMsg.."\r\n".."Stack traceback: "..debug.traceback()) end end end OpConnected=NewUserConnected
thx a lot, looks great, just really has the problem jiten said... you restart the script, and you cant add anything to the cat's created... hope to see it fixed :P
Very nice job :]
A rightclicker would be nice to ;)
Well, ok, the customizability simply forces me to make this feature. :)
After a looooooooong silence, here is some update.
DOWNLOAD HERE (http://www.szote.u-szeged.hu/jancso/freshstuff3.4.0pre3.zip)
What's new:
---------------- --------------- 4.0 pre3
added showing and deleting of a category
fixed ugly bugs hopefully, please test
TODO:
1) add PM and env support
2) add some kind of !help
As usual, use at own risk, however it seems neat. :P Bug reports are more than welcome.
Pre5.
Pre4 had a critical bug, please update!
Go to download site. (http://ptxscriptdb.psycho-chihuahua.net/download.php?view.41)
The long-awaited update is NOW.
Special thx to oldman for ideas/reports.
Read the notes please, there are too many new things to list here.
Download (http://ptxscriptdb.psycho-chihuahua.net/download.php?view.82)
4.3 is out.
Download (http://ptxscriptdb.psycho-chihuahua.net/download.php?view.89)
fixed category saving bug
added timed announces
added help
added PM command parsing
added some version info :-)
TODO: optimize a bit more
[19:15] Syntax ...ents\Azim (Business)\Ptokax\Ptokax\scripts\fresh.lua:243: attempt to compare number with nil
QuoteOriginally posted by ?Tr??T_????
[19:15] Syntax ...ents\Azim (Business)\Ptokax\Ptokax\scripts\fresh.lua:243: attempt to compare number with nil
What profiles do you use?
A bug crawled into the file. :)
Replace the whole OnTimer() to:
function OnTimer()
if FreshStuff.Timer < 60 then
FreshStuff.Timer=FreshStuff.Timer+1
else
if FreshStuff.WhenAndWhatToShow[os.date("%H:%M")] then
if FreshStuff.Types[FreshStuff.WhenAndWhatToShow[os.date("%H:%M")]] then
SendToAll(Bot.name, FreshStuff.ShowRelType(FreshStuff.WhenAndWhatToShow[os.date("%H:%M")]))
else
if FreshStuff.WhenAndWhatToShow[os.date("%H:%M")]=="new" then
SendToAll(Bot.name, FreshStuff.MsgNew)
elseif FreshStuff.WhenAndWhatToShow[os.date("%H:%M")]=="all" then
SendToAll(Bot.name, FreshStuff.MsgAll)
else
SendToOps(Bot.name,"Some fool added something to my timed ad list that I never heard of. :-)")
end
end
end
FreshStuff.Timer=0
end
end
[20:07] Syntax ...ents\Azim (Business)\Ptokax\Ptokax\scripts\fresh.lua:243: attempt to compare number with nil
QuoteOriginally posted by ?Tr??T_????
[20:07] Syntax ...ents\Azim (Business)\Ptokax\Ptokax\scripts\fresh.lua:243: attempt to compare number with nil
1) What brings this on?
2) I asked once: what profiles do you have?
profile?
my is netfounder ?(
QuoteOriginally posted by ?Tr??T_????
profile?
Look in cfg/Profiles.xml
ie
Master
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Operator
1001111111111111111101110011111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
VIP
0000111000000111111000000000000111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Reg
0000101000000010000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
-
Master
1111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
Operator
1001111110110011111001100010111101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
VIP
0011110010100011000000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
Reg
0000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
Moderator
1111111110110011111011100110111101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-
NetFounder
1111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
OK, the script uses the standard profiles. Wait and gonna do, I assume this is Robo or something...
Replace
userlevels={ [-1] = 1, [0] = 5, [1] = 4, [2] = 3, [3] = 2 }
to
userlevels={ [-1] = 1, [0] = 5, [1] = 4, [2] = 3, [3] = 2, [4]=4, [5]=5 }
(Goes for robocop users only!!!)
Syntax ...ministrator\My Documents\Azim (Business)\Ptokax\Ptokax\scripts\fresh.lua:86: `=' expected near `FreshStuff'
QuoteOriginally posted by ?Tr??T_????
Syntax ...ministrator\My Documents\Azim (Business)\Ptokax\Ptokax\scripts\fresh.lua:86: `=' expected near `FreshStuff'
You have done something wrong. Should work.
workin now..
i did not put that ontimer thing..
Is't possible to change the order of the releases so the latest one upears in top of the 10 instead of last??
one more thing .. when someone have added something then onyone add the same release.
Can you fix it Bastya??
Bumbi
QuoteOriginally posted by Bumbi
Is't possible to change the order of the releases so the latest one upears in top of the 10 instead of last??
So backwards list? Why? For users having to scroll up?
QuoteOriginally posted by Bumbi
one more thing .. when someone have added something then onyone add the same release.
Can you fix it Bastya??
Bumbi
I don't understand this, please explain better.
Well Bastya
If I post a Movie like KingKong.2.avi Then after one hour a friend of mine post the same one in Movie .. that one also get in Movie releases. In Freshstuff 2.60 you get a message like... Sorry that release is already added by
Anyway to correct that you cant double post the same release??
Bumbi
Ps. Otherwise this script rocks :D
QuoteOriginally posted by Bumbi
Well Bastya
If I post a Movie like KingKong.2.avi Then after one hour a friend of mine post the same one in Movie .. that one also get in Movie releases. In Freshstuff 2.60 you get a message like... Sorry that release is already added by
Anyway to correct that you cant double post the same release??
Bumbi
Ps. Otherwise this script rocks :D
This protection can only be done if the name is exactly the same. Decide if you want it or not.
P. S.: THX! :D
Yes Bastya i want it becourse I got same releases 2-4 times a day ... if one got it then after some hours more got it and can seach by alternative instead :))
thx in advanced
Bumbi
QuoteOriginally posted by Bumbi
Yes Bastya i want it becourse I got same releases 2-4 times a day ... if one got it then after some hours more got it and can seach by alternative instead :))
thx in advanced
Bumbi
I cannot do it right now, but maybe later I will, also there are some more enhanced functions.
Nice work Bastya
Only small pieces to mod to get the bot to work the way I want it to
But I do want to have an opportunity to set different times in cleaning for each added category
Reason is, want to keep som categorys for 12 weeks, but added a request category and this one I want to clean every 4:th week
QuoteOriginally posted by uffetjur
Nice work Bastya
Only small pieces to mod to get the bot to work the way I want it to
But I do want to have an opportunity to set different times in cleaning for each added category
Reason is, want to keep som categorys for 12 weeks, but added a request category and this one I want to clean every 4:th week
Maybe a prune by cat?
think I preefer a Timed cleaning by cat
QuoteOriginally posted by uffetjur
think I preefer a Timed cleaning by cat
No autocleaning function will be implemented, since it's not eating a lot of RAM like userinfo.
Hello
I think there mait be a little bug in the script.
I have posted 20 releases but when I check top adders It shows that I posted 420 releases.
Anyway to fix this or does the script count words instead of the ID's ??
Bumbi
Hi I get this when prunrel
Syntax PtokaX\scripts\freshstuff3.4.3.lua:635: attempt to call global `SplitTimeString' (a nil value)
Can someone help?
Still miss the function that users only can add the same release string one time :-(
Bumbi
Gonna fix everything this week, really. Please post all request/problems to the LawMaker forum, there is a thread for FS3.
Hey,
Hows it going Doc? :-p Been a long time hows the development of Freshstuff coming along? Just curious as its an excellent script and something I will definately use.
Devastator
QuoteOriginally posted by Devastator
Hey,
Hows it going Doc? :-p Been a long time hows the development of Freshstuff coming along? Just curious as its an excellent script and something I will definately use.
Devastator
Please wait till Sunday/Monday. I can only review the code then.
Is it possible for you to publish fresh stuff separately from lawmaker?
QuoteOriginally posted by uffetjur
Is it possible for you to publish fresh stuff separately from lawmaker?
I thought I did. (http://ptxscriptdb.psycho-chihuahua.net/download.php?list.32) :D
Just a little bug report....when i set the script to show the latest 5 releases on motd, it only shows 4
QuoteOriginally posted by Herman
Just a little bug report....when i set the script to show the latest 5 releases on motd, it only shows 4
Report bugs here, please (http://lawmaker.no-ip.org/forum/index.php).
OK, I have released a test version. Please use it with caution.
Get it here (http://lawmaker.no-ip.org/forum/topic.php?id=23).
Hey Bastya,
I'm usin 3.4.2 the problem is when I right-click the option "Help" it jus runs the relhelp command instead of addin the prefix. Any ideas?
Find this: RegRC(FreshStuff.Levels.Help,"1 3","Releases\Help",FreshStuff.Commands.Help)
and replace to RegRC(FreshStuff.Levels.Help,"1 3","Releases\Help","!"..FreshStuff.Commands.Help)
It was:
RegRC(FreshStuff.Levels.Help,"1 3","Releases\\Help",FreshStuff.Commands.Help)
But I found it now, many thanx man :))
The forum engine removed a backslash. X(
GREAT WORK
its okey fine work for me this script
thank bastya
When add new category This is added to de right click automatic or if necesary the edit the script?
If you add a new category, you have to restart the script and force all your users to reconnect. I can do it without restart, but then adding a category might hang your hub for 1-2 secs if you have many categories.
I cannot help the reconnect part - $UserCommand's cannot be properly changed on-the-fly in the NMDC protocol.
thanks
Syntax ...tware\0.3.3.21.nt.ibiza.dreams\scripts\Novedator.lua:433: attempt to index field `?' (a nil value)
Report in the forum (link in my sig).
I get an error when I use the timer function if I select the option "new". If I select a particular genre then it's fine but new doesn't work.
Damnit, please report it in the forum, I told many times that bugs reported here will be ignored.
Sorry for inconvenience, but I need to track bugs/requests somehow.
Bastya I jus registered wid ur forum but it aint sent the activation email ?(
QuoteOriginally posted by QuikThinker
Bastya I jus registered wid ur forum but it aint sent the activation email ?(
Activated you by hand. Sorry 'bout that, moved to a new server, will fix mail() soon.
bastya i need help with freshtuff 3.4.3
i nedd added a new Rc menu for special category but this have work into de normal rc menu of fesshstuf and off into your menu
this use a two categories added only for add new an see the material
example name in rc menu
CifiRip
functions
add a new enter for CifiRip_Peliculas
add a new enter for CifiRip_Series
see enters for CifiRip_Peliculas
see enters for CifiRip_Series
are 4 option into the menu
and only see te window for put the name of the enter not for selection of the category
thanks
experimetn and experimet _)
this is the solution
code---------------------------------------------------------------
RegRC(FreshStuff.Levels.Add,"1 3","-=CifiRip=-\\A?adir entrada Series","!"..FreshStuff.Commands.Add.." CifiRip_Series %[line:Nombre:]")
RegRC(FreshStuff.Levels.Add,"1 3","-=CifiRip=-\\A?adir entrada Peliculas","!"..FreshStuff.Commands.Add.." CifiRip_Peliculas %[line:Nombre:] ")
RegRC(FreshStuff.Levels.Show,"1 3","-=CifiRip=-\\Ver entradas Series","!"..FreshStuff.Commands.Show.." CifiRip_Series")
RegRC(FreshStuff.Levels.Show,"1 3","-=CifiRip=-\\Ver entradas Peliculas","!"..FreshStuff.Commands.Show.." CifiRip_Peliculas")
code----------------------------------------------------------------
tu add menu for rc for special categories
Can you please post some feedback to my forum (or here, but preferring LMForum)? If there are no errors, I will release it ASAP.
Further discussion goes here (http://forum.ptokax.org/index.php?topic=5932#new). This thread is very big now, and there is Lua 5.1 support.
Note: Lua 5.0 support will be there until the Lua 5.1 versions go stable - I don't fel like developing for incomplete implementations.
Locked.