A message in main at 1 time - Page 2
 

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

A message in main at 1 time

Started by Syphrone-NL, 29 April, 2005, 09:28:01

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dessamator

Ignorance is Bliss.

LoTeK_

I tried Send Random Text Line every x minute, and eats less memory than Memories, but I'd like some more adjustments if it's possible.

First when it send the line, it add: memory sent.
Is possibile to not show this status message?

Second botname is not show in userlist.
Thanks again.

James

Hi

look at the script from jiten...Rotating Mesage !!!
maybe it's better for you -)))

 :D

Dessamator

QuoteOriginally posted by LoTeK_
I tried Send Random Text Line every x minute, and eats less memory than Memories, but I'd like some more adjustments if it's possible.

First when it send the line, it add: memory sent.
Is possibile to not show this status message?

Second botname is not show in userlist.
Thanks again.

done, post edited !!
Ignorance is Bliss.

LoTeK_

QuoteOriginally posted by Dessamator
QuoteOriginally posted by LoTeK_
I tried Send Random Text Line every x minute, and eats less memory than Memories, but I'd like some more adjustments if it's possible.

First when it send the line, it add: memory sent.
Is possibile to not show this status message?

Second botname is not show in userlist.
Thanks again.

done, post edited !!

Ok now the bot is the userlist but when it send the line, it add another message: "Done , following Memory has been Sent :". I would like to remove this message at all, can you tell where I have to edit the code? thanks

jiten

QuoteOriginally posted by LoTeK_
QuoteOriginally posted by Dessamator
QuoteOriginally posted by LoTeK_
I tried Send Random Text Line every x minute, and eats less memory than Memories, but I'd like some more adjustments if it's possible.

First when it send the line, it add: memory sent.
Is possibile to not show this status message?

Second botname is not show in userlist.
Thanks again.

done, post edited !!

Ok now the bot is the userlist but when it send the line, it add another message: "Done , following Memory has been Sent :". I would like to remove this message at all, can you tell where I have to edit the code? thanks
That message is only sent to the user that requests the command.
Anyway, if u don't want it to be show replace this:
curUser:SendData(cBotName," Done , following Memory has been Sent :"..SendStuff())
 
with
--curUser:SendData(cBotName," Done , following Memory has been Sent :"..SendStuff())
Cheers

Syphrone-NL

A little request more got that script:

--Timebot for LUA 5 
-- 
-- by blackwings 
--Little changed by nErboS 
-- 
-- Converted to LUA 5 by Mutor 2/28/2005 
-- Changed by DTM?-Message only MainChat no PM 
-- Deutsche Anleitung 
-- 

bot = "Message" -- BotNamen in UserListe 
name2 = "News" --BotNamen in MainChat 


sec = 60 


fMsgAll2 = "MsgAll2.txt"--Namen der txt datei af dem der script zugreift--datei muss in Ordner scripte sein 
sMsgAll2 = "" 

tClock = { 
["tMsgAll2"] = os.clock() + 1*sec, -- Time to show in math.minutes 
} 

function Main() 
frmHub:RegBot(bot) 
sMsgAll2 = Readtext(fMsgAll2) 
StartTimer() 
end 

function OnTimer() 
if (tClock["tMsgAll2"] <= os.clock() and sMsgAll2~= "") then 
tClock["tMsgAll2"] = os.clock() + 30*sec --Hier die WiederholungsZeit eintragen.30=30Min 
SendPmToAll(name2, sMsgAll2) 
end 
end 

function Readtext(file) 
local sTmp="\r\n\r\n" 
for line in io.lines(file) do 
sTmp = sTmp..line.."\r\n" 
end 
return sTmp 
end

Can you make it that you insert 7 .txt files and that it every 60 seconds the other one chooses so first minute 1.txt second minute 2.txt third minute 3.txt

Thx in advanced
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

jiten

Have a look at Rotating Message.
It already does that ;)

Cheers

Dessamator

QuoteOriginally posted by LoTeK_
Ok now the bot is the userlist but when it send the line, it add another message: "Done , following Memory has been Sent :". I would like to remove this message at all, can you tell where I have to edit the code? thanks

Done post edited , once more !!!
Ignorance is Bliss.

Syphrone-NL

That one selects a file that it wants. Not in a row.

I want first 1.txt then 2.txt then 3.txt then 4.txt then 5.txt then 6.txt then 7.txt
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

kepp

QuoteOriginally posted by Syphrone-NL
That one selects a file that it wants. Not in a row.

I want first 1.txt then 2.txt then 3.txt then 4.txt then 5.txt then 6.txt then 7.txt

It selects the file in order, it's then  up to you to name the files in order :P
Guarding    

Syphrone-NL

I got this one:

-- Rotating Message 1.1 by jiten - for PtokaX 0.3.3.0 build 16.09 or Higher
-- based on Rotating Message 1.0 by Mutor The Ugly
-- Rotates n text files posted to main chat at interval
-- Added: Rotates every .txt file stored in sFolder (by kepp)

mSet = {
	sBot = "Disneys_diner", -- Bots Name
	RunStatus = 1,			-- Auto Start -> 1=ON 0=OFF
	iDelay = 144,			-- Delay between each text file in minutes
	sFolder = "diners",		-- Folder where all the .txt files are stored
	-- Don't change this
	iCnt = 1,
}

sFile = {}

Main = function()
	ReloadText()
	SetTimer(mSet.iDelay*60*1000) 
	if (mSet.RunStatus == 1) then
		StartTimer()
	end
end 


ChatArrival = function(sUser, sData)
	sData=string.sub(sData,1,-2)
	local s,e,cmd = string.find(sData, "%b<>%s+[%!%?%+%#](%S+)" )
	if sUser.bOperator then
		local tCmds = {
		["adon"] =	function(user,data)
					mSet.RunStatus = 1
					user:SendData(mSet.sBot,"Messages started...")
					StartTimer()
				end,
		["adoff"] =	function(user,data)
					mSet.RunStatus = 0
					user:SendData(mSet.sBot,"Messages stopped...")
					StopTimer()
				end,
		["reload"] =	function(user,data)
					ReloadText()
					user:SendData(mSet.sBot,"Textfiles loaded...")
				end,
		}
		if tCmds[cmd] then
			return tCmds[cmd](sUser,sData),1
		end
	end
end

OnTimer = function()
	local TableSize = table.getn(sFile)
	for i=1,TableSize do
		if (i == mSet.iCnt) then
			local sContent = FileExists(mSet.sFolder.."/"..sFile[i])
			if (sContent) then
				SendToAll(mSet.sBot,"\r\n"..sContent)
			end
			if (TableSize == i) then mSet.iCnt = 1 else mSet.iCnt = mSet.iCnt + 1 end
			break
		end
	end
end

function FileExists(sFile)
	local oFile = io.open(sFile,"r");
	if (oFile) then
		local line = oFile:read("*all");
		oFile:close();
		return string.gsub(line,"\r","\r\n");
	else
		return nil;
	end
end

function ReloadText()
	sFile = nil;
	sFile = {};
	collectgarbage();

	--// Load up files to table from folder \\--
	os.execute("dir /b "..mSet.sFolder.."\\*.txt > files.txt");
	local hFile = io.open("files.txt","r");
	local line = hFile:read();
	while line do
		table.insert(sFile,1,line)
		line = hFile:read();
	end
	hFile:close();
	os.remove("files.txt");
end

My files:
Diner 1
Diner 2
Diner 3
Diner 4
Diner 5
Diner 6
Diner 7

but it started with 3

i want to do that in that order
Owner of 2 public hubs in Palace Network ---> www.palace-network.nl

SMF spam blocked by CleanTalk