Simple TXT viewer by command
 

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 by command

Started by TTB, 06 May, 2005, 02:19:19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TTB

Hi, was a request from someone, maybe ppl wanna use it to...

-- 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

Don't forget to make the TXT files in the path.
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

badtrip

The new ptokax 16.xx and 17.xx have txt viewer
 ;)

plop

QuoteOriginally posted by badtrip
The new ptokax 16.xx and 17.xx have txt viewer
 ;)
it was introduced earlier, but by doing it with scripts you can add more features.
like locking a txt file 2 some profiles only, like my texter serie's.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

dima_b

QuoteZitat:
--------------------------------------------------------------------------------
Originally posted by badtrip
The new ptokax 16.xx and 17.xx have txt viewer
;)

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


it was introduced earlier, but by doing it with scripts you can add more features.
like locking a txt file 2 some profiles only, like my texter serie's.

plop


great!  but how to use it?  i mean the ptokax one

uffetjur

Place those textfiles you want to have in ptokax/texts folder
ex ptokax.txt


be sure to enable support fort textfiles in hubsoft

To read this specific file use !ptokax    to wiew the file from clientside
Somewhere in Cyberspace

SMF spam blocked by CleanTalk