Simple TXT viewer with more commands
 

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

Simple TXT viewer with more commands

Started by Loading, 02 July, 2005, 14:59:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Loading

hi ppl

i have this script :


-- Simple TXT / file viewer by TTB

-- Requested by Pingelmonster

-- Made: 06-05-05

----------------------------------



-- ## Settings ## --



bot = "[BOT]TXT-assistent"	-- botname

path = "extratxt"		-- path for your txt file(s)



File1= "hublists.txt"		-- filename

cmd1 = "#hublists"		-- command



regbot = "0" 			-- Reg your bot?

PM = "1"			-- Send your message by PM or in MAIN chat? 1 = PM, 0 = Main Chat.



-- NOTE: If you choose to send by PM, your bot will be REGGED anyway (can't send PM without sender).



-- ## Don't change below! ## --



function Main()

	if regbot == "1" or PM == "1" then

		frmHub:RegBot(bot)

	end

end



function ChatArrival(curUser,data)

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

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

	if cmd and cmd == cmd1 then

		local sdata = LoadFile(File1)

		if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

	end

end



function LoadFile(file)

	local handle = io.open(path.."/"..file,"r")

	if handle then

		local sdata = ""

		local line = ""

		for line in handle:lines() do

			sdata = sdata..line.."\r\n"

		end

		return sdata

	else

		sdata = "File / command not available!"

		return sdata

	end

	handle:close()

end

i want is :

more commands like :


<>     ?       !capas
<>     ?       !codecs
<>     ?       !cracks
<>     ?       !games
<>     ?       !gajas
<>     ?       !Grizas
<>     ?       !legendas
<>     ?       !players
<>     ?       !dance

each command have a txt file in a especific directory , and the commands is avaiable to anyone

can  anyone make this modification ?



best regards


Loading

jiten

Give "Rotating Message" a try or if it doesn't suit your needs, search the forum. I'm sure you'll find lots to choose from ;)

Cheers

Dessamator

#2
or use the text support in ptokax !
Ignorance is Bliss.

Loading

hi ppl

i searched in the forum and i can't find a script can suit my needs

and i don't like the text support from the ptokax


so can you help me with tis script ?



best regards


Loading

Loading

tnks mutor
but isn't i want

instead this :
bot = "[BOT]TXT-assistent"	-- botname



path = "extratxt"		-- path for your txt file(s)







File1= "hublists.txt"		-- filename



cmd1 = "#hublists"		-- command

i want this:
bot = "[BOT]TXT-assistent"	-- botname



path = "extratxt"		-- path for your txt file(s)







File1= "codecs.txt"		-- filename



cmd1 = "!codecs"		-- command



File2= "cracks.txt"		-- filename



cmd2 = "!cracks"		-- command



File3 = "legendas.txt"        --filename



cmd3 = "!legendas"          --command



file4 = "players.txt"           --filename



cmd4 = "!players"            --command

you understand now ?

but with all this commands :
 !capas
 !codecs
 !cracks
 !games
 !gajas
 !Grizas
 !legendas
 !dance
 !players
 !hublists

can you help me ?


best regards


Loading

Markitos

well...othrwise u can use Release/request bot or entry bot by jiten.
U can add new things in new categorys were can be displayed in Pm by users and ofcourse with a rotating message were u can choose the hour and categ. to be displayed in the main (timed)

Loading

hi

but this script is more easy to configure

but tanks for the help  ;)

best regards


loading

Markitos

QuoteOriginally posted by Loading
hi

but this script is more easy to configure

but tanks for the help  ;)

best regards


loading

Try this (its in lua 4 try convert it too tired)
Bot = "Bot?" 

gamerstxt = "gamers.txt" -- O ficheiro gamers.txt tem de estar criado na pasta script  


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=="!gamers") then 
      ReadJokes(user, data) 
        return 1 
      end 
   end 
end 

function ReadJokes(user, data) 
local tmp = "" 
   readfrom(gamerstxt) 
   while 1 do 
   local line = read() 
      if (line == nil) then 
         break 
      else 
    tmp = tmp..line.."\r\n" 
      end 
   end 
   readfrom() 
user:SendPM(Bot, tmp) 
end


Cheers...

Loading

ok

i changed myself and it works  :)

-- Simple TXT / file viewer by TTB

-- Requested by Pingelmonster

-- Made: 06-05-05

-- More commands added by [PT]Loading  03/07/05

----------------------------------



-- ## Settings ## --



bot = "?FBI??"	-- botname

path = "URLs"		-- path for your txt file(s)



File1= "hublists.txt"		-- filename

cmd1 = "+listas"		-- command

File2= "Codecs.txt"		-- filename

cmd2 = "+codecs"		-- command

File3= "legendas.txt"		-- filename

cmd3 = "+legendas"		-- command

File4= "Players.txt"		-- filename

cmd4 = "+players"		-- command

File5= "jogos.txt"		-- filename

cmd5 = "+jogos"		        -- command

File6= "cracks.txt"		-- filename

cmd6 = "+cracks"		-- command

File7= "capas.txt"		-- filename

cmd7 = "+capas"		        -- command

File8= "grizas.txt"		-- filename

cmd8 = "+grizas"		-- command

File9= "ptokax.txt"		-- filename

cmd9 = "+ptokax"		-- command

File10= "musica.txt"		-- filename

cmd10 = "+musica"	        -- command

cmd11 = "+showhelp"	        -- command



regbot = "1" 			-- Reg your bot?

PM = "1"			-- Send your message by PM or in MAIN chat? 1 = PM, 0 = Main Chat.



-- NOTE: If you choose to send by PM, your bot will be REGGED anyway (can't send PM without sender).



-- ## Don't change below! ## --



function Main()

	if regbot == "1" or PM == "1" then

		frmHub:RegBot(bot)

	end

end



function ChatArrival(curUser,data)

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

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

	    if cmd == "+listas" then

		local sdata = LoadFile(File1)

		if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+codecs" then

            local sdata = LoadFile(File2)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+legendas" then

            local sdata = LoadFile(File3)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+players" then

            local sdata = LoadFile(File4)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+jogos" then

            local sdata = LoadFile(File5)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+cracks" then

            local sdata = LoadFile(File6)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+capas" then

            local sdata = LoadFile(File7)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+grizas" then

            local sdata = LoadFile(File8)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

            elseif cmd == "+ptokax" then

            local sdata = LoadFile(File9)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1

	elseif cmd == "+showhelp" then
		local sdata = "Lista de comandos disponiveis\r\n\r\n"..
		"\t-=======<>Comandos disponiveis<>=======-\r\n"..
		" +listas\t\t\t-\t\tMostra a lista de hubs nacionais e internacionais\r\n"..
		" +codecs\t\t-\t\tMostra a lista de url's para sacar os codecs mais precisos\r\n"..
		" +legendas\t\t-\t\tMostra a lista de url's para sacar legendas\r\n"..
		" +players\t\t\t-\t\tMostra a lista de url's para sacar os melhores players\r\n"..
		" +jogos\t\t-\t\tMostra a lista de url's de Jogos\r\n"..
		" +cracks\t\t-\t\tMostra a lista de url's para sacar os mais variados cracks\r\n"..
		" +capas\t\t-\t\tMostra a lista de url's para sacar capas para jogos/filmes\r\n"..
		" +grizas\t\t-\t\tMostra a lista de url's para grizas\r\n"..
		" +ptokax\t\t-\t\tMostra a lista de url's para ir buscar os melhores scripts para este fabuloso programa de Hubs\r\n"..
		" +musica\t\t-\t\tMostra a lista de url's de dance music\r\n"..
		" +showhelp\t\t-\t\Mostra este menu de ajuda\r\n"

              if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

                else

                        curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

                end
            
                return 1


            elseif cmd == "+musica" then

            local sdata = LoadFile(File10)

            if PM == "1" then

			curUser:SendPM(bot,"\r\n"..sdata)

		else

			curUser:SendData(bot,"\r\n\r\n"..sdata.."\r\n")

		end

		return 1



	end

end


function LoadFile(file)

	local handle = io.open(path.."/"..file,"r")

	if handle then

		local sdata = ""

		local line = ""

		for line in handle:lines() do

			sdata = sdata..line.."\r\n"

		end

		return sdata

	else

		sdata = "File / command not available!"

		return sdata

	end

	handle:close()

end

best regards

Loading

Loading

hi mutor

this script take me 4 hours to modify

and hi have proud to see it works perfectly

i don't like the ptokax because is to  confusion
 i like scripts to make the "job"

best regards

Loading

Markitos

#10
QuoteOriginally posted by Loading
hi mutor

this script take me 4 hours to modify

and hi have proud to see it works perfectly

i don't like the ptokax because is to  confusion
 i like scripts to make the "job"

best regards

Loading

Lol loading but PX jt want to make ur life easy adding that text support ;)
BTW u spent 4 h moding a script that could be made in an easier way

Dessamator

yap and the script is messy, full of repition, and does the exact same thing that plop's script, or ptokax text support does !
Ignorance is Bliss.

SMF spam blocked by CleanTalk