Horizontal Parser
 

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

Horizontal Parser

Started by jiten, 02 June, 2005, 22:10:36

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jiten

Hi there fellas.
Got stuck with a Release bot function, so, decided to ask you guys for some hints, as I can't get to TGA (my ISP blocked all international hub connections).
I want to send a certain category's content to Main. But, sometimes that category has entries longer than 300 characters.
Here comes the problem: I pretend to parse that entry, so that the extra content (from the 145th character) appears in a new line and well tabbed (not distorted).
Here's mine and Dessamator's attempt:
local TimedMain = function(cat)
	local msg = ""
	msg = msg.."\r\n\r\n\t".." Category: "..cat.."\r\n\t"..string.rep("__",55).."\r\n\r\n\t? "
	for i = 1, table.getn(Entry) do
		if Entry[i] then
			if string.lower(Entry[i][2]) == string.lower(cat) then
				stuff = Entry[i][3] 
				while string.len(stuff) > 145 do
					msg = msg..string.sub(stuff,1,145).."\r\n\t"
					stuff  = string.sub(stuff,146,string.len(stuff))
				end
				msg = msg..stuff.."\r\n\t? "
			end
		end
	end
	msg = msg.."\r\n\t-- Your message here --\r\n\t"..string.rep("__",55).."\r\n"
	return msg
end
SendToAll(TimedMain("cinemas"))

Best regards,

jiten

jiten

Hopefully we were able to sort this problem out :D
Anyway, thanks for your efforts.

Best regards

SMF spam blocked by CleanTalk