determinate determinate

Author Topic: BirthDayMan  (Read 6326 times)

0 Members and 1 Guest are viewing this topic.

Offline Cêñoßy†ê

  • Scripter
  • Triple Ace
  • ******
  • Posts: 179
  • Karma: +29/-3
BirthDayMan
« on: March 22, 2006, 10:57:46 am »
Code: [Select]
--- 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]
« Last Edit: February 22, 2007, 06:13:08 am by Cêñoßy†ê »
***********************
Powered By Leviathan v? ;)[KvN]
***********************

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v4.08 - LUA 5.0/5.1
« Reply #1 on: April 12, 2006, 09:50:13 am »
Code: [Select]
--[[

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)

]]--
« Last Edit: November 29, 2007, 03:43:09 pm by jiten »

Offline TïMê†råVêlléR

  • Scripter
  • Lord
  • ******
  • Posts: 317
  • Karma: +16/-0
Re: BirthDayMan
« Reply #2 on: April 12, 2006, 02:11:30 pm »
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

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #3 on: April 12, 2006, 04:01:58 pm »
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?

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #4 on: April 12, 2006, 06:05:18 pm »
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

Offline TïMê†råVêlléR

  • Scripter
  • Lord
  • ******
  • Posts: 317
  • Karma: +16/-0
Re: BirthDayMan
« Reply #5 on: April 12, 2006, 08:45:01 pm »
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

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #6 on: April 12, 2006, 09:19:04 pm »
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 :)

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.01 - LUA 5.0/5.1
« Reply #7 on: April 13, 2006, 10:56:48 am »
First post updated with TT's request.

Offline TïMê†råVêlléR

  • Scripter
  • Lord
  • ******
  • Posts: 317
  • Karma: +16/-0
Re: BirthDayMan
« Reply #8 on: April 13, 2006, 12:13:12 pm »
thanks  great job  :D


Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man 3.x - 4.x DB Converter
« Reply #9 on: April 13, 2006, 08:05:55 pm »
As requested, and for those that may need this:

Code: [Select]
--[[

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
« Last Edit: April 15, 2006, 05:44:24 pm by jiten »

Offline TïMê†råVêlléR

  • Scripter
  • Lord
  • ******
  • Posts: 317
  • Karma: +16/-0
Re: BirthDayMan
« Reply #10 on: April 13, 2006, 09:28:06 pm »
thanks worked great

greetzz TT

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.02 - LUA 5.0/5.1
« Reply #11 on: April 14, 2006, 08:11:15 am »
First post has been updated with some changes.

Offline TïMê†råVêlléR

  • Scripter
  • Lord
  • ******
  • Posts: 317
  • Karma: +16/-0
Re: BirthDayMan
« Reply #12 on: April 14, 2006, 10:46:57 am »
yep looks nicer  :D

Offline 6Marilyn6Manson6

  • Scripter
  • King
  • ******
  • Posts: 869
  • Karma: +47/-35
    • http://www.marilynmanson986.altervista.org
Re: BirthDayMan
« Reply #13 on: April 14, 2006, 10:49:18 am »
Very nice work jiten ;)

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.03 - LUA 5.0/5.1
« Reply #14 on: April 15, 2006, 02:11:50 pm »
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.

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.04 - LUA 5.0/5.1
« Reply #15 on: April 15, 2006, 05:52:04 pm »
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.

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.05 - LUA 5.0/5.1
« Reply #16 on: June 25, 2006, 06:41:15 pm »
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.

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.051 - LUA 5.0/5.1
« Reply #17 on: July 07, 2006, 08:47:08 pm »
First post has been updated with an addition [requested by TT] to the main code.

 

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #18 on: July 09, 2006, 01:54:50 pm »
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 --

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #19 on: July 09, 2006, 05:15:06 pm »
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

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.061 - LUA 5.0/5.1
« Reply #20 on: July 16, 2006, 12:33:38 pm »
First post has been updated with some changes:

Code: [Select]
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)

Offline [NL]_Yvisaur

  • Junior Member
  • **
  • Posts: 16
  • Karma: +3/-0
Re: BirthDayMan
« Reply #21 on: July 16, 2006, 03:14:16 pm »
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?

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #22 on: July 16, 2006, 07:17:47 pm »
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:

Code: [Select]
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]> !{}"
},

Offline [NL]_Yvisaur

  • Junior Member
  • **
  • Posts: 16
  • Karma: +3/-0
Re: BirthDayMan
« Reply #23 on: July 16, 2006, 09:15:44 pm »
it's super now  ;D

ty Jiten!

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #24 on: July 17, 2006, 10:06:37 am »
First post has been updated with some changes:

Code: [Select]
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 --

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #25 on: July 18, 2006, 12:07:39 pm »
I'm glad you guys like it.

And don't mention it, you're welcome.

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #26 on: July 18, 2006, 02:35:42 pm »
but i insist sir,..

THANK YOU !!!

 ;)
\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 --

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #27 on: July 19, 2006, 10:44:13 am »
working A-ok ..

just " Sagittarius "    (in Microsoft sans serif  8 )  is too long so needs a small edit here.

and i miss the "full celeb info" (it used to show  all (same day nr, same moth, same year, same day month and year)

and a small request .. could  birthday list be sorted ?
like first one to have b-day on top and last one in bottom ?
or just sorted byt b-day like..   jan 1 on top dec 31 in bottom ..


all else look great :0) database converters work A-ok very very nice work :0)))
\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 --

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #28 on: July 19, 2006, 11:01:05 am »
small thing or ?..

Code: [Select]
=========================================================================================================
People born in the same "Field" as yours:
Field: Nick:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Year UwV2; _Saartje_
Day UwV2
Month Notox; PurpleHaze; [Rus]Elpa; UwV2; [Tele2][10mbitTele2]tripsun; _tntns_


i have exact same b- day as UwV2  .. but it doesn't show the "all" field ..
or is this not supposed to ?

and yet another request (my requests are just requests i can mod it myself offcourse)
in the new layout (wich really does look good) i kindda miss the deatails mabye ..
Code: [Select]
Year UwV2 25/12/1971 ; _Saartje_ 04/04/1971
Day UwV2 25/12/1971
Month ; _tntns_ 10/11/68; UwV2 25/12/1971 ;
would be nice ?

and i see "findsame" is still "same-same" for the findbday so the celebs could be like that too ?

*edit ..
or in other words ..
can we see both on both ?
like it shows the same celebs now i would like to see that on same user bday too
and the way it shows same user bday  show on same celebs  too ..
« Last Edit: July 19, 2006, 11:12:48 am by UwV »
\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 --

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Re: BirthDayMan
« Reply #29 on: July 19, 2006, 12:05:35 pm »
just " Sagittarius "    (in Microsoft sans serif  8 )  is too long so needs a small edit here.

and i miss the "full celeb info" (it used to show  all (same day nr, same moth, same year, same day month and year)

and a small request .. could  birthday list be sorted ?

i have exact same b- day as UwV2 .. but it doesn't show the "all" field ..

in the new layout (wich really does look good) i kindda miss the deatails mabye ..

Yes, this can be done and will be fixed/added in the next update.

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #30 on: July 19, 2006, 12:24:16 pm »
thanks .. is really nice    :0)
 
\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 --

Offline BrotherBear

  • Triple Ace
  • **
  • Posts: 165
  • Karma: +20/-1
Re: BirthDayMan
« Reply #31 on: July 19, 2006, 07:15:05 pm »
Thanks jiten for another great Script :)
Regards,

BrotherBear

Offline jiten

  • Scripter
  • Forum Legend
  • ******
  • Posts: 1 585
  • Karma: +71/-5
Birthday Man v.4.07 - LUA 5.0/5.1
« Reply #32 on: July 28, 2006, 01:32:29 pm »
First post has been updated with some changes:

Code: [Select]
CHANGELOG:
¯¯¯¯¯¯¯¯¯¯
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)

Offline 6Marilyn6Manson6

  • Scripter
  • King
  • ******
  • Posts: 869
  • Karma: +47/-35
    • http://www.marilynmanson986.altervista.org
Re: BirthDayMan
« Reply #33 on: July 28, 2006, 02:39:51 pm »
First to download it :D

Offline UwV

  • Scripter
  • Lord
  • ******
  • Posts: 325
  • Karma: +38/-0
  • Music = Love
    • homepages
Re: BirthDayMan
« Reply #34 on: July 28, 2006, 09:55:58 pm »
thanks again :0)
\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 --

 

determinate determinate
guestbook