BirthDayMan
 

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

BirthDayMan

Started by Cêñoßy†ê, 22 March, 2006, 10:57:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cêñoßy†ê

--- BirthdayMan v 3.5
--- by Herodes -- Update 5/10/2004
--- Converted to Lua 5 by jiten (some ideas taken from BirthdayMan v 2.6 LUA_5.0 by TT and Jelf)
--- --- --- --- --- --- 
-- v2.5
--- When Users are connected if there is a birthday it informs
--- When a Birhtday-User connect it plays surprise and informs the Hub
-- v2.6
--- Fix from ... comment for the display age
-- v 3 
--- ability to display the Birthday nicks in the topic of the hub ... ( all of them ... the Ofline ones are in parentheses like (Herodes))
--- added agecmd to get exact age
--- added bhelpcmd 
--- added display of birthdays in the findcmd
--- added ability for pm or main cmds .. ;)
-- v3.5
--- added integration of zodiac signs in various parts of the script 
--- added celebrities birthdays with a switch to load or not the file
--- added celebcmd ,... works like findcmd but for celebrities
--- added switch for displaying birthday in topic
-- Small mod by C??o?y?? 21/03/2006
--- removed celebrity part
--- removed You Are a xxxxx!!!  when someone adds b-day
--- added rightclick
--- added option to reg or unreg bot in userlist
--- removed TopicShow from settings (mayby forgotten thing there,allready was titshow)
--- changed settings table little more to my taste :P
--- Made needed changes to run with Ptokax DC Hub 0.3.4.0c



Download BirthDayMan v3.5 [cMod]
Powered By Leviathan™ 2nd Generation v. 1.9

jiten

#1
--[[ 

	Birthday Man v.4.08 - LUA 5.0/5.1 by jiten (11/29/2007)
	?????????????????????????????????????????????????????
	Based on: BirthdayMan v 3.5 by Herodes and mods by C??o?y??

	CHANGELOG:
	??????????
	Rewritten: Whole code;

	Changed: Command structure to tables (Function, Permissions, RightClick and Description);
	Changed: B-Day table structure to Julian values;
	Removed: File content that was sent on B-Day;
	Removed: Allowed Age;
	Removed: Topic updater (maybe in the future);
	Changed: Whole B-Day counting system to os.*;
	Changed: Commands returned according to input (Main or PM);
	Changed: Many other mods that can't recall at the moment (4/12/2006);
	Added: addbirthday command - requested by TT (4/13/2006);
	Fixed: Zodiac Sign Dates - thanks to Walazo;
	Changed: Error message on empty !bornon result - thanks to Walazo;
	Changed: !birthdays' content structure to fix bad tabbing;
	Changed: Settings.iVer;
	Added: string.lower checks - thanks to Walazo (4/14/2006)
	Fixed: !bornon Year function - thanks to Walazo
	Added: sNick to keep original nick - requested by TT (4/15/2006);
	Changed: *t to !*t;
	Fixed: Birthday is at midnight - reported by TT (6/25/2006)
	Added: Send Text File content - requested by TT (7/6/2006)
	Added: Hub Topic updater - requested by UwV (7/11/2006)
	Added: Celebrity's feature - requested by UwV (7/15/2006)
	Fixed: BDayCheck function - reported by TT (7/16/2006)
	Fixed: Added correct tabbing for messy !birthdays - reported by [NL]_Yvisaur and UwV;
	Changed: !birthdays is sorted from Jan to Dez - requested by UwV;
	Added: Details and 'All' field to !bornon command - requested by UwV;
	Added: Common fields to !celeb command - requested by UwV (7/24/2006)
	Added: %ptodaybirthdays - requested by Yahoo (11/28/2007)

]]--

TiMeTrAVelleR

when 2 users have same date  you get this
[15:08:57] <-T?M????-> *** Error: I already have Birthday on May 16, 1966! If it wasn't correctly set, ask Operators for help!

greetzz TT

jiten

Quote from: T?M??r?V?ll?R on 12 April, 2006, 14:11:30
when 2 users have same date? you get this
[15:08:57] <-T?M????-> *** Error: I already have Birthday on May 16, 1966! If it wasn't correctly set, ask Operators for help!

greetzz TT

This error will occur if the user has already added its Birthday to the DB.

In this version, there isn't an option to add another user's B-day. Is that your case/request?

jiten

Maybe I didn't explain it well, but, the error reported by TT doesn't really happen, as you can see:

Quote
[19:00:18] <B-Day> *** Your Birthday is on July 25, 1983! I didn't know you were a Leo!
[19:00:18] <B-Day> *** New Birthday added by jiten on: 25/07/1983

[19:00:45] <B-Day> *** Your Birthday is on July 25, 1983! I didn't know you were a Leo!
[19:00:45] <B-Day> *** New Birthday added by test on: 25/07/1983

[19:01:42] <B-Day>
   =================================================================================
   Nr.   Birthdate:         Weekday:   Zodiac Sign:   Status:      Name:
   ------------------------------------------------------------------------------------------------------------------------------------------------------------------
   1   July 25, 1983      Monday      Leo      *Online*      test
   2   July 25, 1983      Monday      Leo      *Online*      jiten

TiMeTrAVelleR

you where right i added part to add other users mysel;f and then you get the error   when i log in whit other nick and do that its np

sorry about that

greetzz TT

jiten

Quote from: T?M??r?V?ll?R on 12 April, 2006, 20:45:01
you where right i added part to add other users mysel;f and then you get the error? ?when i log in whit other nick and do that its np

sorry about that

greetzz TT


No problem, TT :)

jiten

First post updated with TT's request.

TiMeTrAVelleR

thanks  great job  :D


jiten

#9
As requested, and for those that may need this:

--[[ 

	Birthday Man 3.x - 4.x DB Converter by jiten (4/15/2006)

	Requested by: T?M??r?V?ll?R

	Changelog:

	- Changed: string.lowered index;
	- Added: sNick to each index (4/15/2006)

	1. Place your old birthdays.tbl under your scripts' folder;
	2. Run this script and the new file "tBirthday.tbl" will appear in the same folder;
	3. And that's it!

]]--

tConvert = {}

Main = function()
	local tmp; dofile("birthdays.tbl")
	for i,v in pairs(tBirthdays) do
		if v[3] < 1970 then tmp = 1970 - v[3]; v[3] = 1970 else tmp = 0 end
		local tTable = { day = v[1], month = v[2], year = v[3] }
		tConvert[string.lower(i)] = { sNick = i, iJulian = os.time(tTable), iAdjust = tmp }
	end
	local hFile = io.open("tBirthday.tbl","w+") Serialize(tConvert,"tBirthday",hFile); hFile:close() 
end

Serialize = function(tTable,sTableName,hFile,sTab)
	sTab = sTab or "";
	hFile:write(sTab..sTableName.." = {\n");
	for key,value in pairs(tTable) do
		if (type(value) ~= "function") then
			local sKey = (type(key) == "string") and string.format("[%q]",key) or string.format("[%d]",key);
			if(type(value) == "table") then
				Serialize(value,sKey,hFile,sTab.."\t");
			else
				local sValue = (type(value) == "string") and string.format("%q",value) or tostring(value);
				hFile:write(sTab.."\t"..sKey.." = "..sValue);
			end
			hFile:write(",\n");
		end
	end
	hFile:write(sTab.."}");
end

TiMeTrAVelleR

thanks worked great

greetzz TT

jiten

First post has been updated with some changes.

TiMeTrAVelleR


6Marilyn6Manson6

Very nice work jiten ;)

jiten

First post updated once more with some bugfixes.

Attention: The old .tbl must be deleted before using this version, as its index must be in lower-case.

I've also updated the 3.x - 4.x converter to fix this issue.

jiten

First post updated with a small, yet important change in the code (requested by TT):

In 4.03, nicks were saved to the DB in lower-case. Therefore, when displayed by the script wouldn't look the same.

Attention: You must delete your .old tbl before using this version.

I've also updated the 3.x - 4.x DB converter to support this.

jiten

First post updated with a small, yet important change in the code (reported by TT):

In the older 4.0x versions, birthdays only counted from 12 am. So, this version fixes this 'huge' bug.

Attention: You must delete your .old tbl before using this version.

I'm attaching a Birthday Man 4.01-04 to 4.05 Database Converter to this post, so that you can convert you current DB's content to the new format.

jiten

First post has been updated with an addition [requested by TT] to the main code.


UwV

hi Jilten   great work .. looking very good. :0)
just i am still using  a "slightly modded" version 3.5 (with !celebs with show you are a "zodiacsign", topicchanger etc. etc.
now i was wondering .. would you mind to add those nice extra's again ?..
obviously this one still has the 'bugs' not solved since that version .. (in other word this script works perfect, no errors)

i will attach the version that  i use (+ celebstable) it would be really nice if you could add that back in again ..

... for  my own mod's  i will add them back in myself offcourse (nagging  etc.)
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

jiten

Quote from: UwV on 09 July, 2006, 13:54:50
now i was wondering .. would you mind to add those nice extra's again ?..
i will attach the version that? i use (+ celebstable) it would be really nice if you could add that back in again ..

Sure. I'll add them as soon as possible.

Best regards

jiten

First post has been updated with some changes:

CHANGELOG:
??????????
Added: Hub Topic updater - requested by UwV (7/11/2006)
Added: Celebrity's feature - requested by UwV (7/15/2006)
Fixed: BDayCheck function - reported by TT (7/16/2006)

[NL]_Yvisaur

hi

I want to transolate this script to dutch
it's all going good. but with the !birthdays command it's a mess  ;)

click for picture

is it possible to get this good?

jiten

Quote from: [NL]_Yvisaur on 16 July, 2006, 15:14:16
but with the !birthdays command it's a mess? ;)

click for picture

is it possible to get this good?

In your tCommands' table, replace the existing 'birthdays' sub-table with this one:

birthdays = {
	tFunc = function(user)
		if next(tBirthday) then
			local sMsg, n = "\r\n\t"..string.rep("=", 105).."\r\n\tNr.\tStatus:\t\tZodiac Sign:\tWeekday:"..
			"\tBirthdate:\t\t\tName:\r\n\t"..string.rep("-", 210).."\r\n", 0
			for i, v in pairs(tBirthday) do
				local sStatus, sTab = "*Offline*", "\t"
				n = n + 1; if GetItemByName(i) then sStatus= "*Online*" end; 
				local sDate, sWDay, sZodiac = tFunctions.JulianToDate(v)
				if string.len(sZodiac) < 8 then sTab = "\t\t" end
				sMsg = sMsg.."\t"..n..".\t"..sStatus.."\t\t"..sZodiac..sTab..sWDay.."\t\t"..sDate..
				"\t\t"..v.sNick.."\r\n"
			end
			user:SendMessage(Settings.sBot, sMsg)
		else
			user:SendMessage(Settings.sBot, "*** Error: There are no saved Birthdays!")
		end
	end,
	tLevels = {
		[-1] = 1, [0] = 1, [1] = 1, [2] = 1, [3] = 1, [4] = 1, [5] = 1,
	},
	sDesc = "\t\tShows all Birthdays",
	tRC = "Show all B-Days$<%[mynick]> !{}"
},

[NL]_Yvisaur

it's super now  ;D

ty Jiten!

UwV

Quote from: jiten on 16 July, 2006, 12:33:38
First post has been updated with some changes:

CHANGELOG:
??????????
Added: Hub Topic updater - requested by UwV (7/11/2006)
Added: Celebrity's feature - requested by UwV (7/15/2006)
Fixed: BDayCheck function - reported by TT (7/16/2006)


thanks Jilten
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

SMF spam blocked by CleanTalk