PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: D-J Valhala on 14 January, 2004, 09:32:02

Title: release BoT
Post by: D-J Valhala on 14 January, 2004, 09:32:02
Can someone pls change the look of ugly relrease bot?

-- Make a file called releases.txt in \Scripts Folder
-- Made By Optimus

sBot = "=ReleaseBot="

timedate = date()
file = "releases.txt"

display1 = "Artist"
display2 = "Description"
display3 = "Release"

function Main()
frmHub:RegBot(sBot)
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=="!rd") then
ReadRelease(user, data, cmd)
return 1

elseif (cmd=="!add") then
if user.bOperator or user.iProfile == 2 then
s,e,cmd,release,desc = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )

if desc == nil then
description = "No "..display2.." specified!"
s,e,cmd,release = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
description = desc
end
if release == nil then
user:SendData(sBot, "*** No "..display1.." specified!")
return 1
end

News("By: "..user.sName.."\t At: "..timedate.."\r\n"..display1..": "..release.."\r\n"..display2..": "..description.."\r\n")
SendToAll(sBot, "New "..display3.." Added....By <"..user.sName.."> Type !read in Main-Chat to show "..display1..".")
return 1
else
user:SendData(sBot, "*** !write is only availible to [VIP] and above!")
return 1
end
end
end
end

function ReadRelease(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:SendPM(sBot, "\r\n\r\n".."       "..display1.."s posted by users: ".."\r\n\r\n"..release)
readfrom()
end

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

from this
   By: [Telia]Lurfilur    At: 01/12/04 12:20:05
   Release: The_Nommos_-_Digitaria-2004-MYCEL
   Description: Psychedelic Trance
   
   By: [Telia]Lurfilur    At: 01/13/04 09:59:24
   Release: VA_-_Jokke_In_The_Mix-2004-UPE
   Description: Psychedelic Trance
   
   By: [Telia]Lurfilur    At: 01/13/04 09:59:24
   Release: Oryx_-_Advanced_Retromodel-2004-PsyCZ
   Description: Progressive Trance
   
   By: [Telia]Lurfilur    At: 01/13/04 09:59:24
   Release: Psypilot_-_Elements_Form_Divinity-Promo-2003-UPE
   Description: Psychedelic Trance
   
to this
[code]
   L i s t   o f   L a s t   3 0   R e l e a s e s :

      Date                   Style          Release                                Submitter

   040109   psytrance      Phacelift_-_Path_Of_Pathos-2003-MYCEL                     Hook
   040109   Psychedelic   Prodigy-Voodoo_People_(Incl_Eskimo_Remix)-Vinyl-2004-GTi               Toco
   040109   Psychedelic   Minilogue-Leloo-FIXED-Vinyl-2003-USF                        Toco
   040109   Psychedelic   Plexus_Pulsaro-Tributo-CDR-2004-PQM                        Toco
   040110   Psychedelic   The_Nommos_-_Digitaria-2004-MYCEL                        [HUN]PsYtImE

and add whan user type +rd(+read) it will give hem the 30 last releases and add +rdfull(+readfull) it will give hem the full releases list and pls remove the regbot part so the BoT will send pm to user but in MAIN
10x
=)

CyA all
Title:
Post by: plop on 14 January, 2004, 14:22:34
have a look @ freshstuff 3.x or files database.
those show it nearly like you would like it.

plop
Title:
Post by: D-J Valhala on 14 January, 2004, 17:57:33
no no i whant this scrip not other script
Title:
Post by: D-J Valhala on 16 January, 2004, 23:52:55
no body?
:\
Title:
Post by: plop on 17 January, 2004, 00:12:01
QuoteOriginally posted by D-J Valhala
no body?
:\
well i don't wanne be rude but the way you request it 2 be is nearly like freshstuff 3.2.
only the order it shows is different, but you can easely change that.
feels a bit useless 2 make a 2de script which is basicly the same.

plop
Title:
Post by: D-J Valhala on 17 January, 2004, 10:16:33
lol
i dont know how to change it if i know i would didnt ask for one of you guys to change it for me
:P
Title:
Post by: plop on 17 January, 2004, 14:38:04
search for these lines in freshstuff 3.2.
Msg = Msg.."  "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"

Msg = Msg.."  "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"

Msg = Msg.."  "..when.." -- "..who.." -- "..title.."\r\n"
when = the date when it was added
who = the username who added the thing
type = catagory
title = release name

mix them around 2 the order you want.
just make sure you don't touch the Msg.
here's an example of how you want it.
Msg = Msg.."  "..when.." -- "..type.." -- "..title.." -- "..who.."\r\n"

plop
Title:
Post by: D-J Valhala on 17 January, 2004, 15:44:06
thank you plop but it's not help me sorry i dont whant other script i whant this scrip and i dont know how to change it :(