Day, time and quote
 

News:

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

Day, time and quote

Started by Northwind, 17 September, 2005, 16:58:14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Northwind

hi again :)

Can somebody make this, it shouild be before MOTD

=================================
Today is #date and hub's current time is #time

Quote of day #quote
=================================

#quote1 "T?m? p?iv? on huomisen eilinen."
#quote2 "I?ll? ei ole merkityst? ellei satu olemaan juusto."
#quote3 "Mik? pahan tappaisi"
#quote4 "Kaikkihan me kuljemme loassa, toiset vain katsovat t?htiin."

i have more quotes but those are examples...



Dessamator

But, im quite sure a similar script already exists somewhere in this forum.
Ignorance is Bliss.

Northwind

I tried to search, ... but nothing fit the purpose... or maybe i use wrong search words. Dunno... If somebody was lucky and find the script what fit the purpose please post it...

Have to try couple more times  :D  :D


bastya_elvtars

What about having a quote list in a file?
Everything could have been anything else and it would have just as much meaning.

Northwind

yeah that would be good idea :) but first i need a script what shows those things


bastya_elvtars

When should the quote with time show? On connect/specified intervals/what?
Everything could have been anything else and it would have just as much meaning.

Northwind

#6
Everytime when a user enter the hub on the same day he sees same quote. Only time changes.

Sorry iam little ill so my brains dont work right... tried my best to say what i need....


bastya_elvtars

QuoteOriginally posted by Northwind
Everytime when a user enter the hub on the same day he sees same quote. Only time changes.

Sorry iam little ill so my brains dont work right... tried my best to say what i need....

So there is the quote of the day and a random quote can be shown at any time by a command?
Everything could have been anything else and it would have just as much meaning.

Northwind

no random only that quote what is before motd... and when somebody type !quote it show this days quote... so i only need 365 quotes for a year...


bastya_elvtars

QuoteOriginally posted by Northwind
no random only that quote what is before motd... and when somebody type !quote it show this days quote... so i only need 365 quotes for a year...

So basically it just chooses a quote every day? :-)
Everything could have been anything else and it would have just as much meaning.

Northwind

yeah :)

can u make the script


Northwind

thanks, i am  going to test it tonight...


kunal

nothing is being shown below the motd also when i use the cmd +qod nothing appears.

Northwind

#13
[11:42] Syntax D:\moon_3\scripts\qot.lua:139: attempt to index global `QOD' (a nil value)


Psycho_Chihuahua

Well i put a copy in the Scriptdb including the quote file

you can find it here --> QOD.rar

@Mutor: Hope you dont mind  :D
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Psycho_Chihuahua

Sure no problem, i thought they could add the quotes themselfs  :D

Here ya go --> Link to v1.0b Script and full Quote file from Scriptdb
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

kash?

#16
I wanted a option whether to show qoute in main
or PM or not to show at all either in main or PM
but right click commands should work in all 3 options

Waiting Reply,

kash?

Nice1

but can u plz make that right click option
for toggle quotes on/off and toggle pms on/off and
list all QOD's only for ops so that ops will get all four options in right click but others will get only ONE
option of show Quote of the day

Regards

6Marilyn6Manson6

#18
This for example:


--
--QOD 1.0c LUA 5
--
--by Mutor The Ugly		9/18/05
--
--Requested by Northwind
--
-- Sends a 'Quote Of The Day' to new logins
-- Option to list all quotes in PM
-- Checks for existance of quote file alerts OpChat if OpChat enabled, all users if not.
-- Provides context menu.
--
--	+Changes from v1.0  9/18/05
--		+Changed display format of quote to that of request
--
--	+Changes from v1.0b  11/19/05		Requests by kash?
--		+Added option to toggle script on/off
--		+Added option to toggle PM's on/off
--		+Added new commands to context menu (right click)
--

--User Settings------------------------------------------------
QODFile = "QOD.dat"             --QOD file
QODList = "+listqod"            --List all QOD's in PM
QODCmd = "+qod"                 --Get Todays quote
QODEnable = "+qon"              --Toggle quotes on/off
QODOn = "on"			--Quotes on at script start? "on"/"off"
QODPmOn = "+qpm"		--Toggle display of quotes in pm on/off
QODPm = "off"			--Should send in pm at script start? "on"/"off"
QODBot = frmHub:GetHubBotName()	--QODBot name pulled from hub or use "custom name"
QodMenu = frmHub:GetHubName()	--Menu name pulled from hub, uses hub name for menu
QodSubMenu ="Quote Of The Day"	--Custom submenu
[COLOR=red]QodUserCommands = 1			-- Send usercommands on connect 1=on/0=off[/COLOR]
--End User Settings--------------------------------------------

local timein=os.date("%B %d %Y")

function Main()
local f,e = io.open( QODFile, "r" )
	if f then
        	dofile(QODFile)
	else
		local QodFileErrMsg="\r\n\r\n\tFile Error: "..QODFile.." does not exist.\r\n"
		if not (frmHub:GetOpChatName()) then
			SendToOps(QODBot,QodFileErrMsg)
		else
			SendPmToOps(frmHub:GetOpChatName(),QODBot..QodFileErrMsg)
		end
	end
	if QODBot ~= frmHub:GetHubBotName() then
		frmHub:RegBot(QODBot, 1, "Quote Of The Day", "")
	end
end

function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
local s,e,cmd = string.find(data, "^%b<>%s+(%p%w+)")
	if cmd then
		if cmd == QODCmd and QODOn == "on" then
			local day = tonumber(os.date("%j"))
			if QOD[day] then
				local Quote = "\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
				"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
				"time is "..os.date("%I:%M %p").."\r\n\t[ Quote Of The Day: ]\r\n\t\" "..QOD[day]..
				"\r\n\t"..string.rep("=",100).."\r\n\r\n"
				if QODPm == "on" then
					user:SendPM(QODBot,Quote)
					return 1
				else
					user:SendData(QODBot,Quote)
					return 1
				end
			end
		elseif cmd == QODList then
			local Quote = "\r\n\r\n"
			for i,v in QOD do
				Quote = Quote.."[Day #"..i.."] : "..v.."\r\n\r\n"
			end
			user:SendPM(QODBot,"\r\n\r\n"..string.rep("=",75).."[ Quotes Of The Day ]"..
			string.rep("=",25)..Quote.."\r\n"..string.rep("=",75).."[ End Quote Listing ]"..string.rep("=",25).."\r\n")
			return 1
		elseif cmd == QODEnable then
			if QODOn == "on" then
				QODOn = "off"
			elseif QODOn == "off" then
				QODOn = "on"
			end
			local reply = user.sName..", the Quote of the Day script is now "..QODOn.."."
			user:SendData(QODBot,reply)
			return 1
		elseif cmd == QODPmOn then
			if QODPm == "on" then
				QODPm = "off"
			elseif QODPm == "off" then
				QODPm = "on"
			end
			local reply = user.sName..", Display Quote of the Day in pm is now "..QODPm.."."
			user:SendData(QODBot,reply)
			return 1
		end
		return 1
	end
end

function NewUserConnected(user,data)
QodCommands(user)
local day = tonumber(os.date("%j"))
	if QOD[day] and QODOn == "on" then
		local Quote = "\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
		"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
		"time is "..os.date("%I:%M %p").."\r\n\t[ Quote Of The Day: ]\r\n\t\" "..QOD[day]..
		"\r\n\t"..string.rep("=",100).."\r\n\r\n"
		if QODPm == "on" then
			user:SendPM(QODBot,Quote)
		else
			user:SendData(QODBot,Quote)
		end
	end
end

OpConnected = NewUserConnected

function QodCommands(user)
[COLOR=red]	if QodUserCommands == 1 then[/COLOR] 
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Show Today's QOD $<%[mynick]> "..QODCmd.."||")
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Toggle Quotes On/Off $<%[mynick]> "..QODEnable.."||")
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Toggle PM's On/Off$<%[mynick]> "..QODPmOn.."||")
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\List All QOD's $<%[mynick]> "..QODList.."||")
[COLOR=red]	end[/COLOR] 
end


C ya

kash?

#19
u did not read the post correctly
I want all the commands in right click option
only to ops and only Quote of the day command
to others

Means only OPs have all the right click commands  :P

and also I just found that if I restart scripts or host
hub again, it again sets quotes in main, I want
it to make it permanently till it is changed using
command  

Regards

6Marilyn6Manson6

Sorry for me error, but I things this is what you want.

--
--QOD 1.0c LUA 5
--
--by Mutor The Ugly		9/18/05
--
--Requested by Northwind
--
-- Sends a 'Quote Of The Day' to new logins
-- Option to list all quotes in PM
-- Checks for existance of quote file alerts OpChat if OpChat enabled, all users if not.
-- Provides context menu.
--
--	+Changes from v1.0  9/18/05
--		+Changed display format of quote to that of request
--
--	+Changes from v1.0b  11/19/05		Requests by kash?
--		+Added option to toggle script on/off
--		+Added option to toggle PM's on/off
--		+Added new commands to context menu (right click)
--

--User Settings------------------------------------------------
QODFile = "QOD.dat"             --QOD file
QODList = "+listqod"            --List all QOD's in PM
QODCmd = "+qod"                 --Get Todays quote
QODEnable = "+qon"              --Toggle quotes on/off
QODOn = "on"			--Quotes on at script start? "on"/"off"
QODPmOn = "+qpm"		--Toggle display of quotes in pm on/off
QODPm = "off"			--Should send in pm at script start? "on"/"off"
QODBot = frmHub:GetHubBotName()	--QODBot name pulled from hub or use "custom name"
QodMenu = frmHub:GetHubName()	--Menu name pulled from hub, uses hub name for menu
QodSubMenu ="Quote Of The Day"	--Custom submenu
QodUserCommands = 1			-- Send usercommands at user on connect 1=on/0=off
QodOPCommands = 1			-- Send usercommands at OP on connect 1=on/0=off
--End User Settings--------------------------------------------

local timein=os.date("%B %d %Y")

function Main()
local f,e = io.open( QODFile, "r" )
	if f then
        	dofile(QODFile)
	else
		local QodFileErrMsg="\r\n\r\n\tFile Error: "..QODFile.." does not exist.\r\n"
		if not (frmHub:GetOpChatName()) then
			SendToOps(QODBot,QodFileErrMsg)
		else
			SendPmToOps(frmHub:GetOpChatName(),QODBot..QodFileErrMsg)
		end
	end
	if QODBot ~= frmHub:GetHubBotName() then
		frmHub:RegBot(QODBot, 1, "Quote Of The Day", "")
	end
end

function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
local s,e,cmd = string.find(data, "^%b<>%s+(%p%w+)")
	if cmd then
		if cmd == QODCmd and QODOn == "on" then
			local day = tonumber(os.date("%j"))
			if QOD[day] then
				local Quote = "\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
				"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
				"time is "..os.date("%I:%M %p").."\r\n\t[ Quote Of The Day: ]\r\n\t\" "..QOD[day]..
				"\r\n\t"..string.rep("=",100).."\r\n\r\n"
				if QODPm == "on" then
					user:SendPM(QODBot,Quote)
					return 1
				else
					user:SendData(QODBot,Quote)
					return 1
				end
			end
		elseif cmd == QODList and user.bOperator then
			local Quote = "\r\n\r\n"
			for i,v in QOD do
				Quote = Quote.."[Day #"..i.."] : "..v.."\r\n\r\n"
			end
			user:SendPM(QODBot,"\r\n\r\n"..string.rep("=",75).."[ Quotes Of The Day ]"..
			string.rep("=",25)..Quote.."\r\n"..string.rep("=",75).."[ End Quote Listing ]"..string.rep("=",25).."\r\n")
			return 1
		elseif cmd == QODEnable and user.bOperator then
			if QODOn == "on" then
				QODOn = "off"
			elseif QODOn == "off" then
				QODOn = "on"
			end
			local reply = user.sName..", the Quote of the Day script is now "..QODOn.."."
			user:SendData(QODBot,reply)
			return 1
		elseif cmd == QODPmOn and user.bOperator then
			if QODPm == "on" then
				QODPm = "off"
			elseif QODPm == "off" then
				QODPm = "on"
			end
			local reply = user.sName..", Display Quote of the Day in pm is now "..QODPm.."."
			user:SendData(QODBot,reply)
			return 1
		end
		return 1
	end
end

function NewUserConnected(user,data)
QodUserCommands(user)
local day = tonumber(os.date("%j"))
	if QOD[day] and QODOn == "on" then
		local Quote = "\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
		"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
		"time is "..os.date("%I:%M %p").."\r\n\t[ Quote Of The Day: ]\r\n\t\" "..QOD[day]..
		"\r\n\t"..string.rep("=",100).."\r\n\r\n"
		if QODPm == "on" then
			user:SendPM(QODBot,Quote)
		else
			user:SendData(QODBot,Quote)
		end
	end
end

function OpConnected(user,data)
QodOPCommands(user)
local day = tonumber(os.date("%j"))
	if QOD[day] and QODOn == "on" then
		local Quote = "\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
		"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
		"time is "..os.date("%I:%M %p").."\r\n\t[ Quote Of The Day: ]\r\n\t\" "..QOD[day]..
		"\r\n\t"..string.rep("=",100).."\r\n\r\n"
		if QODPm == "on" then
			user:SendPM(QODBot,Quote)
		else
			user:SendData(QODBot,Quote)
		end
	end
end

function QodUserCommands(user)
	if QodUserCommands == 1 then 
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Show Today's QOD $<%[mynick]> "..QODCmd.."||")
	end 
end

function QodOPCommands(user)
	if QodOPCommands == 1 then 
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Show Today's QOD $<%[mynick]> "..QODCmd.."||")
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Toggle Quotes On/Off $<%[mynick]> "..QODEnable.."||")
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Toggle PM's On/Off$<%[mynick]> "..QODPmOn.."||")
		user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\List All QOD's $<%[mynick]> "..QODList.."||")
	end 
end

C ya

speedX

#21
Quote from: Mutor on 18 September, 2005, 18:45:56
Changed the script to display quote per your original request. Example:

<[Botname]> 

	========================================================================
	Today is September 18 2005 and YourHub's current time is 12:40 PM
	Quote Of The Day:
	" Quote of the day text displays here  "
	========================================================================



--
--QOD 1.0b LUA 5  9/18/05
--
--by Mutor The Ugly
--
--Requested by Northwind
--
-- Sends a 'Quote Of The Day' to new logins
-- Option to list all quotes in PM
-- Checks for existance of quote file alerts OpChat if OpChat enabled, all users if not.
-- Provides context menu.
--
--	+Changes from v1.0  9/18/05
--		+Changed display format of quote to that of request
--

--User Settings------------------------------------------------
QODFile = "QOD.dat"             --QOD file
QODCmd = "+qod"                 --Get Todays quote
QODList = "+listqod"            --List all QOD's in PM
Bot = frmHub:GetHubBotName()	--Bot name pulled from hub or use custom name
QodMenu = frmHub:GetHubName()	--Menu name pulled from hub, uses hub name for menu
QodSubMenu ="Quote Of The Day"	--Custom submenu
--End User Settings--------------------------------------------

local timein=os.date("%B %d %Y")

function Main()
local f,e = io.open( QODFile, "r" )
	if f then
        	dofile(QODFile)
	else
		local QodFileErrMsg="\r\n\r\n\tFile Error: "..QODFile.." does not exist.\r\n"
		if not (frmHub:GetOpChatName()) then
			SendToAll(Bot,QodFileErrMsg)
		else
			SendPmToOps(frmHub:GetOpChatName(),Bot..QodFileErrMsg)
		end
	end
	if Bot ~= frmHub:GetHubBotName() then
		frmHub:RegBot(Bot, 1, "Quote Of The Day", "")
	end
end

function ChatArrival(user, data)
data = string.sub(data,1,string.len(data)-1)
local s,e,cmd = string.find(data, "^%b<>%s+(%p%S+)")
	if cmd and cmd == QODCmd then
		local day = tonumber(os.date("%j"))
		if QOD[day] then
			user:SendData(Bot,"\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
			"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
			"time is "..os.date("%I:%M %p").."\r\n\tQuote Of The Day:\r\n\t\" "..QOD[day]..
			" \"\r\n\t"..string.rep("=",100).."\r\n\r\n")
		end
		return 1
	elseif cmd and cmd == QODList then
		local Quote = "\r\n\r\n"
		for i,v in QOD do
			Quote = Quote..v.."\r\n\r\n"
		end
		user:SendPM(Bot,"[Quotes Of The Day]\r\n\r\n"..Quote)
		return 1
	end
end

function NewUserConnected(user,data)
QodCommands(user)
local day = tonumber(os.date("%j"))
	if QOD[day] then
		user:SendData(Bot,"\r\n\r\n\t"..string.rep("=",100).."\r\n\tToday "..
		"is "..os.date("%B %d %Y").." and "..frmHub:GetHubName().."'s current "..
		"time is "..os.date("%I:%M %p").."\r\n\tQuote Of The Day:\r\n\t\" "..QOD[day]..
		" \"\r\n\t"..string.rep("=",100).."\r\n\r\n")
	end
end

OpConnected = NewUserConnected

function QodCommands(user)
	user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\Show Today's QOD $<%[mynick]> "..QODCmd.."||")
	user:SendData("$UserCommand 1 3 "..QodMenu.."\\"..QodSubMenu.."\\List All QOD's $<%[mynick]> "..QODList.."||")
end



When i type +qod or +listqod it doesnt give any output. (I am using ptokax 0.3.5.1 lua 5.1, I converted it to 5.1 by mutor's app)
Thanking You,

speedX

SMF spam blocked by CleanTalk