Top

Calendar Script


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  6.5 (of 6 scores)
Date Added  Feb 01, 2006
Last Updated  Feb 06, 2006
Tags  calendar  callender  date  task  tasks 

Introduction

<b>Features:</b><li>/calendar to start<li>Completely graphical calendar!<li>You can add/delete tasks within a reach of 12 months a head of you<li>You can browse months with right click<li>Gives a notification when mirc starts if you still have undone tasks.<b>Fixes:</b><li>Fix: Calend<b>a</b>r in stead of Calend<i>e</i>r, woops<li>Fix: Color Fix with backgrounds other than white<li>Fix: No leftover data in hash

Grab the Code

 
alias calendar {
  set %calendar $iif($2,$1-,$asctime(mm yyyy))
  tokenize 32 %calendar
 
  var %s = $ctime($asctime(01/ $+ $1 $+ / $+ $2 $+ ) 0:00:00)
 
  window -aCdfk0l20p @Calendar -1 -1 420 480
  clear @Calendar
  drawtext -r @Calendar $inv Fixedsys 25 10 10 $asctime(%s, mmmm yyyy)
 
  ;Draw the lines
  var %line = 60
  while (%line <= 420) {
    drawline -i @Calendar 1 1 0 %line 420 %line
    drawline -i @Calendar 1 1 %line 60 %line 480
    inc %line 60
  }
 
  ;Fill in day notations
  var %d = 1
  while ($x(%d).1) { drawcal $inv %d 1 $v1 | inc %d }
 
  ;Fill in day numbers
  var %m = $asctime(%s,m), %x, %y = 2
  while ($asctime(%s,m) = %m) {
    %x = $x($asctime(%s,ddd))
    drawcal $iif($gettask($asctime(%s,dd/mm/yyyy)),$xor($inv,255), $& 
      $iif($asctime(%s,dd mm) = $asctime(dd mm),$xor($inv,16711680),$inv)) %x %y $asctime(%s,dd)
    inc %s 86400
    if (%x = 7) inc %y
  }
}
menu @Calendar {
  sclick:{
    tokenize 32 %calendar
    var %s = $ctime($asctime(01/ $+ $1 $+ / $+ $2 $+ ) 0:00:00), %a = aline -l @Calendar $+($chr(3),01,$chr(44),00), %d = $& 
      $calc($int($calc(($mouse.x / 60) + 1)) - $x($asctime(%s,ddd)) + 1 + $int($calc(($mouse.y / 60) - 2)) * 7), $&
      %date = $+($base(%d,10,10,2),/,$base($1,10,10,2),/,$2)
    !.echo -q $$ctime(%date)
 
    clear -l @Calendar
    %a $+ %date | %a $+ Add Task | %a $+ -
    var %n = 1
    while ($gettask(%date,%n)) { %a $+ $v1 | inc %n }
  }
  lbclick:{
    if ($1 = 2) {
      var %task = $$input(Please add a task for this day:,e,Task Add)
      addtask $strip($line(@Calendar,1,1)) %task
      aline -l @Calendar $+($chr(3),01,$chr(44),00) $+ %task
      calendar %calendar
    }
    if ($1 > 3) {
      if ($input(Mark this task as done?,y,Delete?)) {
        deltask $strip($line(@Calendar,1,1)) $calc($1 - 3)
        dline -l @Calendar $1
        calendar %calendar
      }
    }
  }
  $submenu($month_menu($1))
}
alias -l month return $gettok(January February March April May June July August September October November December,$1,32)
alias -l x {
  var %days = Mon Tue Wed Thu Fri Sat Sun
  if ($prop) return $gettok(%days,$1,32)
  else return $findtok(%days,$1,1,32)
}
alias -l drawcal drawtext -cr @Calendar $1 Fixedsys 30 $calc(($2 - 1) * 60) $calc($3 * 60) 60 60 $4-
alias -l month_menu {
  if ($1 !isnum) return -
  if ($1 isnum 1-12) {
    var %m = $iif($calc(($asctime(mm) + $1 - 1) % 12),$v1,12), %y = $calc($asctime(yyyy) + $iif(%m < $asctime(mm),1))
    return $month(%m) $chr(40) $+ %y $+ $chr(41) $+ :calendar %m %y
  }
}
alias -l inv return $xor($color($color(background)),16777215)
 
;-- HASH STUFF --
on *:START:{
  .hmake Calendar 10
  if ($isfile($+(",$scriptdircalendar.hsh,"))) .hload Calendar $+(",$scriptdircalendar.hsh,")
  if ($gettask($asctime(dd/mm/yyyy))) {
    beep 10 50
    $iif($input(You still have $v1 tasks for today. Open Calendar?,y,Undone Tasks),calendar)
  }
}
on *:EXIT:if ($hget(Calendar)) hsave -o Calendar $+(",$scriptdircalendar.hsh,")
alias -l gettask {
  ;$gettask(dd/mm/yyyy,N)
  var %value = $hget(Calendar,$$1)
  if (!%value) return
  if (!$2) return $numtok(%value,32)
  return $hget(Calendar,$gettok(%value,$2,32))
}
alias -l addtask {
  hinc -m Calendar total
  hadd -m Calendar $1 $hget(Calendar,$1) $+(id,$hget(Calendar,total))
  hadd -m Calendar $+(id,$hget(Calendar,total)) $$2-
}
alias -l deltask {
  .hdel Calendar $gettok($hget(Calendar,$1),$2,32)
  hadd -m Calendar $1 $deltok($hget(Calendar,$1),$2,32)
}
;--
;-- mknobbout [at] gmail [dot] com
 

Comments

  (9)  RSS
StonedStoner
Comments: 55
 
mIRC Snippet:  Calendar Script
Posted on Feb 1, 2006 9:27 am
I have a black background and the days don't show up.
StonedStoner
Comments: 55
 
mIRC Snippet:  Calendar Script
Posted on Feb 1, 2006 9:39 am
After that was fixed its very good. Nice job.
QuickStep
Comments: 123
 
mIRC Snippet:  Calendar Script
Posted on Feb 1, 2006 9:57 am
After experimenting a bit with my script I noticed that mirc's time doesnt go any further than <b>January 19th 2038</b>. Heh interesting to know
`Kazuma
Comments: 254
 
mIRC Snippet:  Calendar Script
Posted on Feb 1, 2006 10:05 am
nice
bearruler
Comments: 24
 
mIRC Snippet:  Calendar Script
Posted on Feb 1, 2006 3:10 pm
Its a good script, but I have a black background (like StonedStoner) and cant see the lines
I had to change my bg color to grey to see the calendar

You could use the $color identifier to make sure it wasnt the same color as their background


Bear
No0ne
Comments: 68
 
mIRC Snippet:  Calendar Script
Posted on Feb 1, 2006 9:30 pm
Works good. Do you plan on updating this (adding options)?
WDragon
Comments: 8
 
mIRC Snippet:  Calendar Script
Posted on Feb 4, 2006 7:28 pm
how do i change the colours in the calender becouse i also use a black background
StanZ
Comments: 19
 
mIRC Snippet:  Calendar Script
Posted on Feb 6, 2006 4:36 am
Nice one, pretty cool custom window flags and mouse capture :)
I run a blank mirc since I script myself, and I had often problems with irc palette and theme.
QuickStep
Comments: 123
 
mIRC Snippet:  Calendar Script
Posted on Feb 6, 2006 12:47 pm
Update*: It now works with whatever background color you have!

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom