Popup fix in FAQBOT
 

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

Popup fix in FAQBOT

Started by Herodes, 08 May, 2004, 02:44:00

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Herodes

What follows is something I am cooking for a FAQ bot ..
I need it to display txts in PM in certain cases ...
When a User connects to send an informative txt in PM , and do the same when invoked by a cmd...

Now,... what I can't get to work is the Popup part ...
and also I wish there was a way to make one unique function to get along with the files ...

This one should need a Switch Off/Switch On function ....
 ... the thing is whatever I 've tried to do, these two had no luck :(


-- --- GRFaq ---- Script -----
--  Various Scripts Rewrite for GreekWorldHub
--..  By Herodes...
-- thanks to NerBoS for the work in 
--		-- Requested by Woodster
--		-- Made by nErBoS
--		-- Bot = "Welcome-Bot"
-- and Nightlitch for DarkMinds Script..
-- you teach us, us teach us .. :)

-- A bot done for having a FAQ display functoion that is also 
-- suitable for use as a Book Reading bot 
-- with comands calling for for text files...

Bot = "-grfaq-bot-"
-------------------------------------------------------  t x t s - h e r e
ellinika = "/ChannelBot/Txt/ellinika.txt"

intro = "GRFAQ/gr.faq.intro.txt"

periex = "GRFAQ/gr.faq.index.txt"

keim1 = "GRFAQ/gr.faq.part1a.txt"

keim2 = "GRFAQ/gr.faq.part1b.txt"

keim3 = "GRFAQ/gr.faq.part2.txt"

keim4 = "GRFAQ/gr.faq.part3a.txt"

keim5 = "GRFAQ/gr.faq.part3b.txt"

keim6 = "GRFAQ/gr.faq.part3c.txt"

-------------------------------------------------------  r e g - b o t - i n - h u b
function Main()

frmHub:RegBot(Bot)

end

-------------------------------------------------------  n e w - u s e r - p o p u p
function NewUserConnected(user,data) 

		Directions(user)

end 

------------------------------------------------------- c m d s - f o r - c a l l i n g - t x t s 
function DataArrival(user,data)

	if strfind(data, "!faq-intro",1,1) then

		FaqIntro(user) 

	elseif strfind(data, "!faq-index",1,1) then

		FaqPeriex(user)

	elseif strfind(data, "!faq-part1a",1,1) then

		FaqPart1a(user)

	elseif strfind(data, "!faq-part1b",1,1) then

		FaqPart1b(user)

	elseif strfind(data, "!faq-part2",1,1) then

		FaqPart2(user)

	elseif strfind(data, "!faq-part3a",1,1) then

		FaqPart3a(user)

	elseif strfind(data, "!faq-part3b",1,1) then

		FaqPart3b(user)

	elseif strfind(data, "!faq-part3c",1,1) then

		FaqPart3c(user)

	end
end

------------------------------------------------------- f u n c t i o n s - f o r - c a l l i n g - t x t s 
function Directions(user)

	readfrom(ellinika)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 


end

function FaqIntro(user) 

	readfrom(intro)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			elseif line ~= "" then
			end
		text = text.."\r\n"..line
	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end


function FaqPeriex(user) 

	readfrom(periex)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

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

	user:SendPM(Bot,text.."|") 

	readfrom() 

end


function FaqPart1a(user)

	readfrom(keim1)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end

function FaqPart1b(user)

	readfrom(keim2)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end

function FaqPart2(user)

	readfrom(keim3)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end

function FaqPart3a(user)

	readfrom(keim4)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end

function FaqPart3b(user)

	readfrom(keim5)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end

function FaqPart3c(user)

	readfrom(keim6)

	local text = "\r\n"

	while 1 do 

		line = read()

			if line == nil then 

				break 

			end 

		text = text.."\r\n"..line

	end 

	user:SendPM(Bot,text.."|") 

	readfrom() 

end

Hope it makes sense ...

SMF spam blocked by CleanTalk