Addy-Bot by Shad_dow?
 

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

Addy-Bot by Shad_dow?

Started by ((UKSN))shad_dow, 24 July, 2004, 23:50:43

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

((UKSN))shad_dow

--// Addy-bot by Shad_dow?
--// with hnts/tips by Plop and Hawk

--//description
--// save place for user to palce addys , 
--// they type !add  (1 , 2 ,3 ) 
--// then !list to see addys

--// example , !add therapyuk 1  
--// !list   > bot replys in pm > User Shad_dow? added therapyuk.styes.net
--// depending on the number , diceds what gets add to it 1 = styes.net 2 = no-ip.com etc

--// use in Therapy-X V2.1 cos of the anti-advertising :)

Bot = "addy-test"

Hubslist = "Hublist.txt"

tAddys = {
[1]="styes.net",
[2]="no-ip.com",
[3]="beer.net"
}

function DataArrival(curUser,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 == "!add")   then
			doaddy(curUser,data)
			return 1
                elseif (cmd == "!list") then
			readaddy(curUser,data)
			return 1                                    
		end
	end
end

function doaddy(curUser,data)
	local s,e,cmd,hub,unit = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s+(%d+)")
	if hub == nil and unit == nil then
		curUser:SendData(Bot,"Syntex is !add [hub name] [reason] ")
	else
		local add = tAddys[tonumber(unit)]
                if add == nil then
			curUser:SendData(Bot,"addy not found")
		else
			SendPmToNick(curUser.sName,Bot,"You wrote this into the news txt: "..hub.."."..add.." ")
			SendToAll(Bot, "User "..curUser.sName.." added "..hub.."."..add.." ")                                           
			appendto(Hubslist)
			write("User "..curUser.sName.." added "..hub.."."..add.."\r\n")
			writeto() 
		end	
	end
end 

function readaddy(curUser,data)
	readfrom(Hubslist)						 
	local message = "" 
	while 1 do 
		local line = read() 
		if line == nil then 
			break 
		else 
			message = message..line.."\r\n"			 
		end 
	end 
	curUser:SendPM(Bot,message)
end
creator of Therapy-X? bot

D-J Valhala

#1
what that Bot do? can you explane please  ?(
 :D
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

((UKSN))shad_dow

#2
Quote[00:12] !add therapy 2

[00:12] You wrote this into the addy file: theyapyuk.no-ip.com


 



id adds styes.net, no-ip.com,beer.net  instaed of the number on to any hub addy u add to the hubsddy file

simaler to a links bot

yours shad
creator of Therapy-X? bot

D-J Valhala

My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

((UKSN))shad_dow

Thank U Mutor :)

just trying to keep it all alive  ;)
creator of Therapy-X? bot

((UKSN))shad_dow

#5
--// Addy-Bot by shad_dow 
--// help by plop and hawk
--// read fuction corrected by hawk
--// write table correct by Optimus
--// Serialize Function by [UKNOWN]

--//REMBER to crate a floder called Links in the scripts folder ,all text files the script will create :)



Bot = "Addy-Bot"


ZGAME = "Links/game.txt"
BMOVIE = "Links/movie.txt"
EMUSIC = "Links/music.txt"


UrlFile = "Links/addys.txt"


tAddys = {
[1]="3utilities.com",
[2]="bounceme.net",
[3]="hopto.org",
[4]="myftp.biz",
[5]="myftp.org",
[6]="myvnc.com",
[7]="no-ip.biz",
[8]="no-ip.com",
[9]="no-ip.info",
[10]="no-ip.org",
[11]="redirectme.net",
[12]="servebeer.com",
[13]="servecounterstrike.com",
[14]="serveftp.com",
[15]="servegame.com",
[16]="servehalflife.com",
[17]="servehttp.com",
[18]="servemp3.com",
[19]="servepics.com",
[20]="servequake.com",
[21]="sytes.net",
[22]="zapto.org",
[23]="ciscofreak.com",
[24]="damnserver.com",
[25]="ditchyourip.com",
[26]="dnsiskinky.com",
[27]="geekgalaxy.com",
[28]="net-freaks.com",
[29]="no-ip.ca",
[30]="no-ip.co.uk",
[31]="no-ip.net",
[32]="point2this.com",
[33]="securityexploits.com",
[34]="securitytactics.com",
[35]="servehumour.com",
[36]="servep2p.com",
[37]="servesarcasm.com",
[38]="stufftoread.com",
[39]="unusualperson.com",
[40]="workisboring.com" }

function Main()
frmHub:RegBot(Bot)
LoadFromFile(UrlFile)
end

function DataArrival(curUser,data)
	if (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 == "game") or (cmd == "movie") or (cmd == "music") then
			doaddy(curUser,data)
			return 1
                elseif (cmd == "MusicsHubs") then
                     Readmusic(curUser)

                      return 1
		elseif (cmd == "MoviesHubs") then
                     ReadMOVIE(curUser)
                      return 1
		elseif (cmd == "GamesHubs") then
                     ReadGame(curUser)
                      return 1
		
                elseif (cmd == "!linkshelp") then 
                        dohelp(curUser)
                           return 1
                elseif (cmd == "!add") then 
                          donewurl(curUser,data)
			return 1
             
			
                                    
		end
	end
end


function doaddy(curUser,data)
	local s,e,cmd,hub,unit = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(%d+)" )
	
	if hub == nil and unit == nil then
		curUser:SendData(Bot,"Syntex is "..cmd.." [hub name] [reason] ")
	else
		local add = tAddys[tonumber(unit)]
                if add == nil then
                                    curUser:SendData(Bot,"addy not found")

else

				SendPmToNick(curUser.sName,Bot,"You added this but to the links directory : "..hub.."."..add.." ")
                             SendToAll(Bot, "User "..curUser.sName.." added a New Hub ,Pm "..Bot.." with !linkshelp ")                                           
			appendto("Links/"..cmd..".txt")
				write("**********************************\r\n")
				write(" \r\n")
				write("User "..curUser.sName.." added dchub://"..hub.."."..add.."\r\n")
				write(" \r\n")
				writeto()
				
		                                    


	end	
end
end 

function ReadGame(curUser)
		readfrom(ZGAME)						 
			local message = "" 
			while 1 do 
			local line = read() 
			if line == nil then break 
			else 
			message = message..line.."\r\n"			 
			end 
			end 
			curUser:SendPM(Bot,message)
			end

function Readmusic(curUser)
             
		readfrom(EMUSIC)						 
			local message = "" 
			while 1 do 
			local line = read() 
			if line == nil then break 
			else 
			message = message..line.."\r\n"			 
			end 
			end 
			curUser:SendPM(Bot,message)
			end



             
	function ReadMOVIE(curUser)
		readfrom(BMOVIE)						 
			local message = "" 
			while 1 do 
			local line = read() 
			if line == nil then break 
			else 
			message = message..line.."\r\n"			 
			end 
			end 
			curUser:SendPM(Bot,message)
			end



             
		

function dohelp(curUser,data)

		curUser:SendData(Bot,"help not ready yet  ")
			end



function donewurl(curUser,data)
local s,e,newurl = strfind(data, "%b<>%s+%S+%s*(%S*)") 

if newurl ~= "" then 
		tinsert (tAddys, newurl) 
		SendToAll(Bot, "New "..newurl.." is added!") 
		SaveToFile(UrlFile, tAddys, "tAddys") 
		return 1 
	end 
end


function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";
	sTmp = ""

	sTmp = sTmp..sTab..sTableName.." = {\n"

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t"); 
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end

		sTmp = sTmp..",\n"
	end

	sTmp = sTmp..sTab.."}\r\n"
	return sTmp
end

function SaveToFile(file , table , tablename)
	writeto(file)
	write(Serialize(table, tablename))
	writeto()
end

function LoadFromFile(UrlFile)	
	if (readfrom(UrlFile) ~= nil) then
		readfrom(UrlFile)
		dostring(read("*all"))
		readfrom()
	end
end
creator of Therapy-X? bot

((UKSN))shad_dow

#6
--// Addy-Bot V1.2 by shad_dow 
--// help by plop and hawk
--// read fuction corrected by hawk
--// write table correct by Optimus
"--// Serialize Function by RabitWombat (thx Nerbos)
--// table help from Mutor and Plop 

--//REMBER to crate a floder called Links in the scripts folder ,all text files the script will create :)

--// still to do , Help function

Bot = "Addy-Bot"


hubbase = "Links/hubs.txt"


UrlFile = "Links/addys.txt"


tAddys = {
[1]="3utilities.com",
[2]="bounceme.net",
[3]="hopto.org",
[4]="myftp.biz",
[5]="myftp.org",
[6]="myvnc.com",
[7]="no-ip.biz",
[8]="no-ip.com",
[9]="no-ip.info",
[10]="no-ip.org",
[11]="redirectme.net",
[12]="servebeer.com",
[13]="servecounterstrike.com",
[14]="serveftp.com",
[15]="servegame.com",
[16]="servehalflife.com",
[17]="servehttp.com",
[18]="servemp3.com",
[19]="servepics.com",
[20]="servequake.com",
[21]="sytes.net",
[22]="zapto.org",
[23]="ciscofreak.com",
[24]="damnserver.com",
[25]="ditchyourip.com",
[26]="dnsiskinky.com",
[27]="geekgalaxy.com",
[28]="net-freaks.com",
[29]="no-ip.ca",
[30]="no-ip.co.uk",
[31]="no-ip.net",
[32]="point2this.com",
[33]="securityexploits.com",
[34]="securitytactics.com",
[35]="servehumour.com",
[36]="servep2p.com",
[37]="servesarcasm.com",
[38]="stufftoread.com",
[39]="unusualperson.com",
[40]="workisboring.com" }

function Main()
frmHub:RegBot(Bot)
LoadFromFile(UrlFile)
end

function DataArrival(curUser,data)
	if (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 == "!addhub") then
			dogameaddy(curUser,data)
			return 1
                elseif (cmd == "!hubs") then
                     Readhubs(curUser, data)

                      return 1
		
		
                elseif (cmd == "!linkshelp") then 
                        dohelp(curUser)
                           return 1
                elseif (cmd == "!adddomain") then 
                          donewurl(curUser,data)
			return 1
                 elseif (cmd == "!listdomains") then
                 showlist(curUser, data)
return 1
                 elseif (cmd == "!totaldomains") then
                   showtotal(curUser, data)
return 1 
                     
                  
             
			
                                    
		end
	end
end


function dogameaddy(curUser,data)
	local s,e,cmd,hub,unit = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(%d+)" )
	
	if hub == nil and unit == nil then
		curUser:SendData(Bot,"Syntex is !game [hub name] [reason] ")
	else
		local add = tAddys[tonumber(unit)]
                if add == nil then
                                    curUser:SendData(Bot,"addy not found")

else

				SendPmToNick(curUser.sName,Bot,"You added this Hub to the links directory : "..hub.."."..add.." ")
                             SendToAll(Bot, "User "..curUser.sName.." added a New Hub ,Pm "..Bot.." with !linkshelp ")                                           
			appendto(hubbase)
				write("**********************************\r\n")
				write(" \r\n")
				write("User "..curUser.sName.." added dchub://"..hub.."."..add.."\r\n")
				write(" \r\n")
				--writeto()
				
		                                    


	end	
end
end 

function Readhubs(curUser, data)
		readfrom(hubbase)						 
			local message = "" 
			while 1 do 
			local line = read() 
			if line == nil then break 
			else 
			message = message..line.."\r\n"			 
			end 
			end 
			curUser:SendPM(Bot,message)
			end



function donewurl(curUser,data)
local s,e,newurl = strfind(data, "%b<>%s+%S+%s*(%S*)") 

if newurl ~= "" then 
		tinsert (tAddys, newurl) 
		SendToAll(Bot, "New "..newurl.." is added!") 
		SaveToFile(UrlFile, tAddys, "tAddys") 
		return 1 
	end 
end


function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";
	sTmp = ""

	sTmp = sTmp..sTab..sTableName.." = {\n"

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t"); 
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end

		sTmp = sTmp..",\n"
	end

	sTmp = sTmp..sTab.."}\r\n"
	return sTmp
end

function SaveToFile(file , table , tablename)
	writeto(file)
	write(Serialize(table, tablename))
	writeto()
end

function LoadFromFile(UrlFile)	
	if (readfrom(UrlFile) ~= nil) then
		readfrom(UrlFile)
		dostring(read("*all"))
		readfrom()
	end
end



function showlist(curUser, data)

	
for key,value in tAddys do --- do a loop for aslong as there are key's with value's in the table.
   
curUser:SendPM(Bot,"Domain Number "..key.." and has the value: ".. value)

end
end

function showtotal(curUser, data)
local n = getn(tAddys)   
	local str = "***[ There are  ( "..n.." ) Domains in "..Bot.." ]***\r\n"   
curUser:SendPM(Bot,str) 
end

yours

shad , ( create to understand tables)
creator of Therapy-X? bot

nErBoS

Hi,

"--// Serialize Function by RabitWombat"

Keep it going  :))

Best regards, nErBoS
--## nErBoS Spot ##--

((UKSN))shad_dow

hi nerbous

cheers for finding out who did the Serialize for me and Thank u for the support and i will keep it going :)

yours

shad

(script been edited on creadits)
creator of Therapy-X? bot

SMF spam blocked by CleanTalk