Jump to content

mIRC Script -- "birthday"


charles256

Recommended Posts

Hello

 

I wrote the following script for Koach.com

 

To install the script:

 

Open mIRC.exe

Press Alt+R to open the mIRC Scripts Editor

Copy and paste the script

Click OK

 

To use the script:

 

Please read the comments in the script for how to use :-)

 

 

--------------------------------------------------------------------

 

 

 

/*

{

 

 

"birthday"

by Charles "charles" M. (February 2012)

 

 

# Prelude

 

Koach (a hacker) put a list of birthdays (name month/day) on the Koach.com forum.

 

 

# What does this script do?

 

This script attempts to connect to the Koach.com forum to retrieve the list of

birthdays. It then compares each birthday to today's date. If there is a

comparison, it will notify you with the user's birthday.

 

 

# How do I use this script?

 

The script can be used in two ways:

 

Alias: birthday

 

or

 

Popups: Status Window or Channel Window -> Birthday -> Check for Birthdays

 

 

# How do I contact you?

 

charles @ irc.koach.com

 

 

# Version history

 

11/02/2012

 

First public release.

 

 

}

*/

 

 

 

 

/*

**

** Aliases

**

*/

 

 

 

 

; _echo [-eiw] <text>

; Prints text in the active window using the optional colour switch.

;

; The colour switches are as follows:

;

; -e -- error

; -i -- information

; -w -- warning

 

alias _echo {

if ($0) {

var %colour, %switches

if ($active == Status Window) {

%switches = -cegs

}

else {

%switches = -cga

}

 

if (-* iswm $1) {

if (e isincs $1) {

%colour = "ctcp text"

}

elseif (i isincs $1) {

%colour = "info text"

}

else {

if (w isincs $1) {

%colour = "wallops text"

}

else {

%colour = "info text"

}

}

tokenize 32 $2-

}

else {

%colour = "info text"

}

 

echo %switches %colour * $1-

}

}

 

; birthday

;

 

alias birthday {

if ($sock(birthday)) {

sockclose birthday

}

 

set -e %birthdays 0

sockopen birthday www.koach.com 80

.timerbirthday -o 0 28800 birthday

 

if ($show) {

_echo -i Connecting to birthday server

}

}

 

 

 

 

/*

**

** Popups

**

*/

 

 

 

 

menu status,channel {

&Birthday

.&Check for Birthdays: {

birthday

}

}

 

 

 

 

/*

**

** Events

**

*/

 

 

 

 

on *:START: {

if ($version < 7.22) {

_echo -e birthday is designed for mIRC 7.22. It should work on your $&

mIRC version $+($chr(40), $version, $chr(41)) but it is untested $&

and may act strange.

}

 

birthday

}

 

 

 

 

/*

**

** Socket events

**

*/

 

 

 

 

on *:SOCKOPEN:birthday: {

if ($sockerr > 0) {

_echo -e Error while connecting to birthday server

return

}

 

var %% = sockwrite -n birthday

 

%% GET /forum/index.php?/topic/328-current-birthday-list/ HTTP/1.1

%% Accept: */*

%% Host: www.koach.com

%% Connection: close

%%

}

 

on *:SOCKCLOSE:birthday: {

if ($sockerr > 0) {

_echo -e Error while disconnecting from birthday server

return

}

}

 

on *:SOCKREAD:birthday: {

if ($sockerr > 0) {

_echo -e Error while reading data from birthday server

return

}

 

var %data

sockread %data

 

while ($sockbr > 0) {

tokenize 32 %data

 

if (HTTP/1.?* iswm $1) {

if ($2 != 200) {

_echo -e Error while connecting to birthday server

sockclose birthday

}

}

elseif (*cached*Date Nick* iswm $1-) {

sockmark birthday 1

}

else {

if ($sock(birthday).mark) {

if ($regex(birthday, $1-, /0?(\d+)\/0?(\d+)\S*([^<]+)/)) {

if ($+($regml(birthday, 1), /, $regml(birthday, 2)) == $asctime(m/d)) {

beep

inc %birthdays

_echo -w It's $+($regml(birthday, 3), 's) birthday!

}

}

else {

if (*</div>* iswm $1-) {

sockmark birthday

_echo -i Finished checking for birthdays. Found: %birthdays

unset %birthdays

}

}

}

}

 

if ($sockname) {

sockread %data

}

}

}

 

 

 

 

; EOF

Link to comment
Share on other sites

yesterdays:

 

* Connecting to birthday server

-

* It's code's birthday!

-

* Finished checking for birthdays. Found: 1

 

Todays ;)

 

* Connecting to birthday server

-

* It's Crysta's birthday!

-

* Finished checking for birthdays. Found: 1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...