PtokaX forum

Archive => Archived 5.0 boards => Finished Scripts => Topic started by: (-=TrIp-iN-SuN=-) on 16 April, 2005, 19:27:05

Title: i need to help convret same script
Post by: (-=TrIp-iN-SuN=-) on 16 April, 2005, 19:27:05
who can convert this script plz


--## Release Bot Re-Written

--## Removed some functions to MesCaLine

--## Made by nErBoS

--## Commands:

--##+add - Will add a Release to the list

--##+del - Will deleted a Relese from the list

--##+rlsall- Will Show all the Releases

--##+rls- Will Show the Lastest Releases

--##+rlsfind - Will make a search for a Release



sBot = "-NemO-"



arrRelease = {}

fDataRelease = "release.dat"

fRelease = "release.work"



--## Configuration ##--



iLastRelease = 30 -- Choose how many new release you want to show in +rls

uLaterPtokax = 0-- Choose 0 if you are using Ptokax version 0.3.3.0 or higher

-- Choose 1 if you are using Ptokax version lower then 0.3.3.0



--## END ##--



function Main()

frmHub:RegBot(sBot)

LoadFromFile(fDataRelease)

end



function OnExit()

SaveToFile(fDataRelease , arrRelease , "arrRelease")

end



function DataArrival(user, data)

if (string.sub(data,1,1) == "<" or string.sub(data,1,5+string.len(sBot)) == "$To: Psychedelic~Dreams2"..sBot) then

data = string.sub(data,1,string.len(data)-1)

s,e,cmd = string.find(data, "%b<>%s+(%S+)")

if (cmd == "+add" and user.bOperator) then

LoadFromFile(fDataRelease)

AddRelease(user, data)

if (uLaterPtokax == 0) then

OnExit()

end

arrRelease = {}

return 1

elseif (cmd == "+rlsall") then

ShowAllRelease(user)

return 1

elseif (cmd == "+rls") then

ShowLastestReleases(user)

return 1

elseif (cmd == "+del" and user.bOperator) then

LoadFromFile(fDataRelease)

DeleteRelease(user, data)

if (uLaterPtokax == 0) then

OnExit()

end

arrRelease = {}

return 1

elseif (cmd == "+rlsfind") then

FindRelease(user, data)

return 1

end

end

end



function AddRelease(user, data)

local s,e,rel,style = string.find(data, "%b<>%s+%S+%s+(%S+)%s+(%S+)")

if (rel == nil or style == nil) then

user:SendData(sBot, "Syntax Error, +addrls