releas bot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

releas bot

Started by Error, 03 December, 2004, 04:41:40

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Error

hi.
i want a simple releas bot.
only ops type +addrls then
a msg comms in main like this

========================================
 has add  to his share.
Type +rls to see the 30 newest rls.
========================================
 

lawler

hi. why don't u try this one. i think it is as simple as it can be!  ;)

thx 2 nErBoS... here goes:

--Made by nErBoS 

--Version 0.3 



Bot = "ReleaseBot" 


reltxt = "releases.txt" -- Will be created in the Script folder 

prefix = "+" -- Commands Prefix 



function Main() 

frmHub:RegBot(Bot) 

end 



function DataArrival(user, data) 

if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then 

data=strsub(data,1,strlen(data)-1) 

s,e,cmd = strfind(data,"%b<>%s+(%S+)") 

if (cmd==prefix.."add") then --## Adds a Release to the list 

if (strlen(user.sName) > 20) then 

user:SendData(Bot, "Your nick is too long, you can't post the release.") 

else 

AddRelease(user, data) 

end 

return 1 

elseif (cmd==prefix.."all") then --## Show all releases 

ShowRelease(user, data, "all") 

return 1 

elseif (cmd==prefix.."new") then --## Show the last 30 releases 

ShowRelease(user, data, "last") 

return 1 

elseif (cmd==prefix.."del") then --## Erase a release 

if (user.bOperator) then 

DelRelease(user, data) 

else 

user:SendData(Bot, "You don?t have permission to use this command.") 

end 

return 1 

elseif (cmd==prefix.."find") then --## Search for a Release 

local s,e,findrel = strfind(data,"%b<>%s+%S+%s+(%S+)") 

if (findrel == nil or findrel == "") then 

user:SendData(Bot, "Syntax Error, "..prefix.."find , you must write a name.") 

else 

ShowRelease(user, data, "find", findrel) 

end 

return 1 

end 

end 

end 



function AddRelease(user, data) 

local s,e,type,rel,desc = strfind(data,"%b<>%s+%S+%s+(%S+)%s+(%S+)%s+(.*)") 

local tmp = "" 
if (rel == nil or rel == "" or desc == nil or desc == "") then 

user:SendData(Bot, "Syntax Error, "..prefix.."add   .") 

user:SendData(Bot, "Types Avaibale:\r\n\r\n\r\n\t- DnB - DnB, Jungle, RaggaJungle\r\n\t- Break - Breakbeatss\r\n\t- Users - Junglist users production and mixes .) \r\n\t- fav - f###in good shit \r\n\t- 0 - other \r\n\r\n") 

elseif (strlen(rel) > 90) then 

user:SendData(Bot, "The Release Name can't have more then 90 characters.") 

elseif (strlen(desc) > 20) then 

user:SendData(Bot, "The Description can't have more then 20 characters.") 

else 

if (readfrom(reltxt) == nil) then 

writeto(reltxt) 

write("\r\n"..rel.."$"..desc.."$"..user.sName.."$"..GetTime().."$"..strlower(type).."|") 

writeto() 

else 

readfrom(reltxt) 

while 1 do 

local line = read() 

if (line == "") then 

tmp = tmp.."\r\n"..rel.."$"..desc.."$"..user.sName.."$"..GetTime().."$"..strlower(type).."|" 
elseif(line == nil) then 

break 

else 

tmp = tmp.."\r\n"..line 

end 

end 

readfrom() 

writeto(reltxt) 

write(tmp) 

writeto() 

end 

SendToAll(Bot, "A New Release has been added by "..user.sName.."... Write "..prefix.."all to see all Releases.") 

user:SendData(Bot, "Your Release has been added, thank you.") 

end 

end 



function ShowRelease(user, data, type, string) 

local tline = 0 

local tmp = "" 
local dnb = "" 

local breaks = "" 

local fav = "" 

local users = "" 

local other = "" 

if (type == "last") then 

tmp = tmp.."\r\n\r\nThe Last 30 Releases: \r\n\r\n" 

tmp = tmp.." Date\t\tPosted by\t\t\tDescription\t\tRelease Name\r\n" 

elseif (type == "all") then 

tmp = tmp.."\r\n\r\nAll Releases: \r\n\r\n" 

tmp = tmp.." Date\t\tPosted by\t\t\tDescription\t\tRelease Name\r\n" 

elseif (type == "find") then 

local s,e,findrel = strfind(data,"%b<>%s+%S+%s+(%S+)") 

tmp = tmp.."\r\n\r\nSearch Result: \r\n\r\n" 

tmp = tmp.." Date\t\tPosted by\t\t\tDescription\t\tRelease Name\r\n" 

end 

readfrom(reltxt) 

while 1 do 

local line = read() 

if (type == "last") then 

if (tline == 30) then 

break 

end 

end 

if (line == nil) then 

break 

else 

local s,e,rel,desc,who,time,tp = strfind(line, "(.*)%$(.*)%$(.*)%$(.*)%$(.*)%|") 

if (type == "last" or type == "all") then 

if (rel ~= nil) then 

if (tp == "dnb") then 

dnb = dnb.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
elseif (tp == "breaks") then 

breaks = breaks.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
elseif (tp == "fav") then 

fav = fav.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
elseif (tp == "users") then 

users = users.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
else 

other = other.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
end 

tline = tline + 1 

end 

elseif (type == "find") then 

if (rel ~= nil and rel == string) then 

if (tp == "dnb") then 

dnb = dnb.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
elseif (tp == "breaks") then 

breaks = breaks.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
elseif (tp == "fav") then 

fav = fav.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
elseif (tp == "users") then 

users = users.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
else 

other = other.." "..time.."\t"..who..Coluns(who)..desc..Coluns(desc)..rel.."\r\n" 
end 

end 

end 

end 

end 

readfrom() 

if (dnb ~= "") then 

tmp = tmp.."\r\n ==- DnB releasez\r\n -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n" 

tmp = tmp..dnb 

end 

if (breaks ~= "") then 

tmp = tmp.."\r\n -Breaks\r\n -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n" 

tmp = tmp..breaks 

end 

if (fav ~= "") then 

tmp = tmp.."\r\r\n -F###ing good shit \r\n-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n" 

tmp = tmp..fav 

end 

if (users ~= "") then 

tmp = tmp.."\r\r\n - Junglist Users Production and mixes\r\n -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n" 

tmp = tmp..users 

end 

if (other ~= "") then 

tmp = tmp.."\r\r\n Other Styles:\r\n -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\r\n" 


tmp = tmp..other 


tmp = tmp.."\r\n ----------------------------------------------------------------------------------------------------------junglist.no-ip.com----------------------------------------------------------------------------------------------------------------------------\r\n" 
end 

user:SendPM(Bot, tmp) 

end 



function DelRelease(user, data) 

local s,e,release = strfind(data,"%b<>%s+%S+%s+(%S+)") 

local time = 0 

local tmp = "" 
if (release == nil or release == "") then 

user:SendData(Bot, "Syntax Error, "..prefix.."del , you must write a name.") 

else 

readfrom(reltxt) 

while 1 do 

local line = read() 

if (line == nil) then 

break 

else 

local s,e,rel = strfind(line, "(.*)%$.*%$.*%$.*%$.*%|") 

user:SendData(Bot, rel) 

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

tmp = tmp..line.."\r\n" 
elseif (strlower(rel) == strlower(release)) then 

time = 1 

else 

tmp = tmp..line.."\r\n" 
end 

end 

end 

readfrom() 

writeto(reltxt) 

write(tmp) 

writeto() 

end 

if (time == 1) then 

user:SendData(Bot, "The Release has been erased.") 

else 

user:SendData(Bot, "The Release was not found.") 

end 

end 



function GetTime() 

d = date("%d") 

mm = date("%m") 

y = date("%y") 

Date = d.."/"..mm.."/"..y 

return Date 

end 



function Coluns(string) 

local tmp = "" 
if (strlen(string) < 8) then 

tmp = "\t\t\t" 
elseif (strlen(string) < 16) then 

tmp = "\t\t" 
else 

tmp = "\t" 
end 

return tmp 

end

Error

thx but i dont need a bot how says "a new relea has bin added" i need a bot how says has bin added

SMF spam blocked by CleanTalk