Author Topic: releases script  (Read 4750 times)

0 Members and 1 Guest are viewing this topic.

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
releases script
« on: 22 December, 2004, 18:20:16 »
hello everyone
i have a small request for everyone who wants to help

well i have a releases script in my hub
and i m trying many months to fix it a little

does anyone wanna help me out???
plz don t tell about full scripts i want to fix mine
it s great script,it just needs to coifigure a little
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

PtokaX forum

releases script
« on: 22 December, 2004, 18:20:16 »

Offline kepp

  • Scripter
  • King
  • ******
  • Posts: 790
  • Karma: +2/-0
(No subject)
« Reply #1 on: 22 December, 2004, 20:32:05 »
Wrong thread?
Guarding    

Offline enema

  • Lord
  • ***
  • Posts: 276
  • Karma: +1/-0
(No subject)
« Reply #2 on: 23 December, 2004, 06:47:03 »
Maybe right one!
 All you have to do is post your non-working script here and give a question like - How-to  (and certain question follows here...)

I think we all wanna help each other out, thats why we're here!
8)  mitava.no-ip.org   8)

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
(No subject)
« Reply #3 on: 07 January, 2005, 16:16:16 »
hi my firends wel here is my script




BotName = "-AdmiN~BoT-"
timedate = date("%d/%m/%y")
file = "releases.txt"

SendOnConnect = nil  ----send new releases on connect(1=on , nil=off)
MaxNew = 25    ----max releases on the newrleases command
Count = 0
Count2 = 0
AllStuff = {}
NewestStuff = {}


display1 = "Release"
display2 = "Style"
display3 = "Date"



function NewUserConnected(curUser)
if SendOnConnect then
   local release = ""
   readfrom(file)
        for i=1, Count2 do
        release = release.."   "..NewestStuff.."\r\n"
        end
   curUser:SendData(BotName,"(private)>\t\t\tNEWS !!!\r\n\r\n\t\t\t\tNewest  "..MaxNew.."  "..display1.."s posted by users: ".."\r\n\r\n\t   "..display3.."\t\t     "..display2.."\t       "..display1.."\r\n\t   \t\t    \t\t           \t\t       \r\n"..release)
   readfrom()
end
end


OpConnected = NewUserConnected


function Main()
   OpenStuff()
file = "releases.txt"

end


function DataArrival(user, data)
   if (strsub(data, 1, 1) == "<" ) then
      data=strsub(data,1,strlen(data)-1)
         _,_,cmd=strfind(data, "%b<>%s+(%S+)")

      if (cmd=="+rls") then
         ReadRelease(user, data, cmd)
      end
      if (cmd=="+rlsall") then
         ReadReleaseAll(user, data, cmd)
      end
      if (cmd=="+addrls") then
         WriteRelease(user, data, cmd)
      end
            if (cmd=="+delrls") then
         DeleteRelease(user, data, cmd)
      end

   end


end

function WriteRelease(user, data, cmd)
   s,e,cmd,desc,release = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
   if desc == nil then
   desc = "Psychedelic"
   s,e,release = strfind( data, "%b<>%s+%S+%s+(.+)" )
   end
   if desc == "P"
      then desc = "Psychedelic"
      elseif desc == "p"
         then desc = "Psychedelic"
         elseif desc == "C"
            then desc = "Chill"
            elseif desc == "c"
               then desc = "Chill"
               elseif desc == "A"
                  then desc = "Ambient"
                  elseif desc == "a"
                     then desc = "Ambient"
      
   end
   
   if release == nil then
      user:SendData(BotName,"(private)  ________<>________")
      user:SendData(BotName,"(private)> NO "..display1.." Was Write !!!!!!")
      user:SendData(BotName,"(private)> Write Like This :\t +addrls "..display2.." "..display1)
   else
      if (user.bOperator) then
      News("  "..timedate.."\t   "..desc.."\t          "..release)
      SendToAll(BotName, "A New "..display1.."  Is Added By  <"..user.sName..">. Type +rls/+rlsall to see the "..display1.."s.")
   
      else
      user:SendData("-----------------------------------------------------------------------------------")
      user:SendData(BotName,"(private))  ________<>________")
      user:SendData(BotName,"(private)> You Not Operator You Can't Write "..display1.."'s")
      user:SendData("-----------------------------------------------------------------------------------")
      end
   end
end
function ReadRelease(user, data, cmd)
   local release = ""
   readfrom(file)
        for i=1, Count2 do
        release = release.."   "..NewestStuff.."\r\n"
        end
   user:SendData(BotName,"(private)  ________<>________")
   user:SendData(BotName,"(private)>\r\n\r\n\t\t\t\tNewest  "..MaxNew.."  "..display1.."s posted by users: ".."\r\n\r\n\t   "..display3.."\t\t           "..display2.."\t           "..display1.."\r\n\t   \t\t    \t\t           \t\t       \r\n"..release)



   readfrom()
end

function ReadReleaseAll(user, data, cmd)
   local release = ""
   readfrom(file)
   while 1 do
   local line = read()
   if (line == nil) then
   break
   else
   release = release.."   "..line.."\r\n"
   end
   end
   user:SendData(BotName,"(private))  ________<>________")
   user:SendData(BotName,"(private)>\r\n\r\n\t\t\t\tAll "..display1.."s posted by users: ".."\r\n\r\n\t   "..display3.."\t\t     "..display2.."\t               "..display1.."\r\n\t   \t\t    \t\t       \t\t       \r\n"..release)
   user:SendData(BotName,"(private)>  This Is All The Releases  :  [ "..Count.." ]  Total ")
   readfrom()
end

function News(what)
   appendto(file)
      write(what.."\n")
   writeto()
OpenStuff()

end

function OpenStuff()
   AllStuff = nil
   NewestStuff = nil
   AllStuff = {}
   NewestStuff = {}
   Count = 0
   Count2 = 0
   readfrom(file)
   while 1 do
      local line = read()
      if ( line == nil ) then
         break
      else
         Count = Count +1
         AllStuff[Count]=line
      end
   end
   readfrom()
   if Count > MaxNew then
      local temp = Count - MaxNew + 1
      for i=temp, Count do
         Count2 = Count2 + 1
         NewestStuff[Count2]=AllStuff
      end
   else
      for i=1, Count do
         Count2 = Count2 + 1
         NewestStuff[Count2]=AllStuff
      end
   end
end




i need few things to coifigure out

to start from them, i need to send the releases txt in private, but is this possible cause i don t want the bot on the userslist_( i want him invisible)


and is there any way for the script to read the release TXt and don t allow to users  add a release 2 times
cause many problems are all the time show up with double release addings
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

imby

  • Guest
(No subject)
« Reply #4 on: 07 January, 2005, 17:29:51 »
With regards to your first question, a bot must have a name in the nicklist if it is to be able to send a PM to all users in the hub. Therefore, what one could do, is change:

Code: [Select]
BotName = "-AdmiN~BoT-"
and use your main bot name instead. i.e.

Code: [Select]
BotName = "your_main_bot_name_here"
Just a suggestion.

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #5 on: 07 January, 2005, 19:57:32 »
Quote
Originally posted by LiqUiD~TrolL
hi my firends wel here is my script

i need few things to coifigure out

to start from them, i need to send the releases txt in private, but is this possible cause i don t want the bot on the userslist_( i want him invisible)


and is there any way for the script to read the release TXt and don t allow to users  add a release 2 times
cause many problems are all the time show up with double release addings
how about giving credit 2 the ppl who deserve it ??
i can clearly see that this is a badly modded version of my freshstuff 3.x series.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

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

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
hi plop
« Reply #6 on: 08 January, 2005, 15:45:07 »
hello for one more time  , what do you mean by saying

give 2 credit???

and -->>  i can clearly see that this is a badly modded version of my freshstuff 3.x series



is this script yours???

have you fixed a releases bot???

a link plz???
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
(No subject)
« Reply #7 on: 08 January, 2005, 15:51:46 »
ohhh nice i saw your releases scripts my friend

=)

wel i m between few versions now heheheh

well i ll tell you what i need to tell me whitch version to download

i need max 2 lists of releases if there is only 1 list no prob to me

i need the script don t add a releases if it is already there in the TXT FILE

and i need a   -->   +delete release command

do you have something like this i need???
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #8 on: 10 January, 2005, 00:26:37 »
Quote
Originally posted by LiqUiD~TrolL
ohhh nice i saw your releases scripts my friend

=)

wel i m between few versions now heheheh

well i ll tell you what i need to tell me whitch version to download

i need max 2 lists of releases if there is only 1 list no prob to me

i need the script don t add a releases if it is already there in the TXT FILE

and i need a   -->   +delete release command

do you have something like this i need???
all except the double checking is in both serie 3 and 4.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

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

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
hiiiii
« Reply #9 on: 10 January, 2005, 15:18:54 »
plop i finaly find out witch version i want


=)

plop i own you a big THANKS cause you saved me many times
already 3 sripts of yours are in my hub =)

tnx for the help m8
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

[NL]Pur

  • Guest
(No subject)
« Reply #10 on: 10 January, 2005, 23:59:43 »
Maybe right one!
All you have to do is post your non-working script here and give a question like - How-to (and certain question follows here...)
 


WRONG!  

moved to :
Your Developing Problems
If you have a problem withDEVELOPING a script ... go here

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #11 on: 11 January, 2005, 17:19:33 »
Quote
Originally posted by LiqUiD~TrolL
plop i finaly find out witch version i want


=)

plop i own you a big THANKS cause you saved me many times
already 3 sripts of yours are in my hub =)

tnx for the help m8
yw, but pls when you mod a script leave the credits in it.
this small thing is all we scripters ask from you ppl.
for us it's a good feeling 2 come into a hub and see your own stuff @ work.
btw which 3 scripts are you running and how many in total do you run??

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

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

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
(No subject)
« Reply #12 on: 05 February, 2005, 11:47:19 »
heya my friend plop

well now i m useing 3 of your scripts

1 a text script

2 the antiflood script

3 the txt script


they r working fine
specialty the releaes script saved me from the last one in memory usage,it s great jobg well done my m8 and keep going goo work with these baby's


;-)
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
plooooooooop
« Reply #13 on: 16 February, 2005, 03:07:34 »
heya ,hi again,



plop i need you help again_!!!!

man i m useing your script  -- FreshStuff v.3.2

well what i need now is to tell me what to change cause i want VIPs to be able add releases
now only operators can


and by the way this command not working ,why?

-- This command reloads the txt file. syntax : +reloadalbums
-- (this command is needed if you manualy edit the text file)
cmd5 = "+reloadalbums"

and here is the full script :



-- FreshStuff v.3.2
-- 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

-- 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"

-- Show latest stuff on entry 1=yes, 0=no
ShowOnEntry = 0

-- Max stuff shown on newalbums/entry
MaxNew = 40

-- The file storing the stuff
file = "releases.txt"

-- 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 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 DataArrival(user,data)
   if (strsub(data, 1, 1) == "<") then
      data = strsub(data,1,strlen(data)-1)
      s,e,cmd,type,tune = strfind(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!|")
            return 1
         end
      end
   end
end

function OpenRel()
   AllStuff = nil
   NewestStuff = nil
   AllStuff = {}
   NewestStuff = {}
   Count = 0
   Count2 = 0
   readfrom(file)
   while 1 do
      local line = read()
      if ( line == nil ) then
         break
      else
         Count = Count +1
         AllStuff[Count]=line
      end
   end
   readfrom()
   if Count > MaxNew then
      local temp = Count - MaxNew + 1
      for i=temp, Count do
         Count2 = Count2 + 1
         NewestStuff[Count2]=AllStuff
      end
   else
      for i=1, Count do
         Count2 = Count2 + 1
         NewestStuff[Count2]=AllStuff
      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=strfind(NewestStuff, "(.+)$(.+)$(.+)$(.+)")
            if title then
               Msg = Msg.."  "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
            else
               Msg = Msg..NewestStuff.."\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=strfind(AllStuff, "(.+)$(.+)$(.+)$(.+)")
            if title then
               Msg = Msg.."  "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"
            else
               Msg = Msg..AllStuff.."\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 "..strlower(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=strfind(AllStuff, "(.+)$(.+)$(.+)$(.+)")
         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 "..strlower(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.."$"..date("%x").."$"..what)
   user:SendData(Bot, what.." is added to the releases as "..type.."|")
   SaveRel()
   ReloadRel()
end

function DelRel(user, what)
   Okie = nil
   for a,b in AllStuff do
      s,e,title=strfind(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 SaveRel()
   writeto(file)
   for i=1,Count do
      if AllStuff then
         write(AllStuff.."\n")
      end
   end
   writeto()
end

function ReloadRel()
   OpenRel()
   ShowRel(NewestStuff)
   ShowRel(AllStuff)
end
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

Offline TTB

  • Lord
  • ***
  • Posts: 436
  • Karma: +17/-1
(No subject)
« Reply #14 on: 16 February, 2005, 16:02:40 »
Hi,

I just had some time to fix this... didn't test it, hope it will be ok. Please, next time paste your code with these TAGS -> {CODE} and {/CODE} where {} should be [].

Here is your modified script... please note that in this version VIPs also can delete a release and reload the albums... if you don't want to... please post again.

Code: [Select]
-- FreshStuff v.3.2
-- 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

-- 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"

-- Show latest stuff on entry 1=yes, 0=no
ShowOnEntry = 0

-- Max stuff shown on newalbums/entry
MaxNew = 40

-- The file storing the stuff
file = "releases.txt"

-- 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 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 DataArrival(user,data)
 if (strsub(data, 1, 1) == "<") then
  data = strsub(data,1,strlen(data)-1)
  s,e,cmd,type,tune = strfind(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 or user.iProfile == 2) 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!|")
 return 1
 end
 end
end
end

function OpenRel()
AllStuff = nil
NewestStuff = nil
AllStuff = {}
NewestStuff = {}
Count = 0
Count2 = 0
readfrom(file)
while 1 do
local line = read()
if ( line == nil ) then
break
else
Count = Count +1
AllStuff[Count]=line
end
end
readfrom()
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=strfind(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=strfind(AllStuff[i], "(.+)$(.+)$(.+)$(.+)")
if title then
Msg = Msg.." "..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 "..strlower(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=strfind(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 "..strlower(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.."$"..date("%x").."$"..what)
user:SendData(Bot, what.." is added to the releases as "..type.."|")
SaveRel()
ReloadRel()
end

function DelRel(user, what)
Okie = nil
for a,b in AllStuff do
s,e,title=strfind(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 SaveRel()
writeto(file)
for i=1,Count do
if AllStuff[i] then
write(AllStuff[i].."\n")
end
end
writeto()
end

function ReloadRel()
OpenRel()
ShowRel(NewestStuff)
ShowRel(AllStuff)
end
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
hellooooooooooooooooooooooo
« Reply #15 on: 18 February, 2005, 17:05:04 »
eheh well my firend the news are great, the correction of the script works well,and it s good =)


tnx a lot for your help mate, take care
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

PtokaX forum

hellooooooooooooooooooooooo
« Reply #15 on: 18 February, 2005, 17:05:04 »