;#########################################################################Wsc ;## Mystic Knights Upcoming Events Code ## ;## Coded by: Crossfire39 ## ;## Support: Runescape89@prodigy.net ## ;## Last Update: 4th August, 2006 1:02pm ## ;######################################################################### ;######################################################################### ;## Instructions: ## ;## First place all the code below into the remote section of you mIRC ## ;## Client. All the variables will be created automatically. To beging ## ;## type !setnewevent. This will bring up a menu in your pm window ## ;## where all the commands will be explained. ## ;## Make sure that the time and date you input are base on you own ## ;## timezone and that all the other ops know about this. ## ;## Enjoy ## ;######################################################################### on *:text:!event:#:{ ; Bunch of code + variables that calculate how much time is left in seconds. The converted to hours. /set -u %event.daycalc [ $+ [ $nick ] ] $ctime(%nexteventdate) /set -u %event.currentdate [ $+ [ $nick ] ] $ctime /set -u %event.calculated [ $+ [ $nick ] ] $round($calc(( %event.daycalc [ $+ [ $nick ] ] - %event.currentdate [ $+ [ $nick ] ] )/3600),2) /set -u %event.hoursbefore [ $+ [ $nick ] ] %event.calculated [ $+ [ $nick ] ] /set -u %event.daysleft [ $+ [ $nick ] ] 0 ; If there are enough hours, it changes them into days. while (%event.calculated [ $+ [ $nick ] ] >= 24.00) { /dec %event.calculated [ $+ [ $nick ] ] 24 /inc %event.daysleft [ $+ [ $nick ] ] } ; Takes the decimal out of the hours and converts it to minutes. Removes decimal from minutes. /set -u %event.minutesleft [ $+ [ $nick ] ] $round($calc(($gettok(%event.calculated [ $+ [ $nick ] ],2,46))/100*60),0) /set -u %event.hoursleft [ $+ [ $nick ] ] $deltok(%event.calculated [ $+ [ $nick ] ],2,46) ;Displays how much time is left. if ( %event.hoursbefore [ $+ [ $nick ] ] > 0) { /notice $nick 7The %upcomingevent starts in approximately %event.daysleft [ $+ [ $nick ] ] Day(s), %event.hoursleft [ $+ [ $nick ] ] Hour(s), and %event.minutesleft [ $+ [ $nick ] ] Minute(s). } if ( %event.hoursbefore [ $+ [ $nick ] ] < 0) { /notice $nick 7The %upcomingevent has already begun or is already over. Please contact a leader for more info. } } on *:text:!Setnewevent:#:{ if ( $nick isop $chan ) { /notice $nick The events menu has been sent to you in a PM .timer 1 2 { /msg $nick «« Event Setting Menu »» $chr(124) /msg $nick Please remember that the time and date has to be set in the CST Timezone $chr(124) /msg $nick The proper syntax for setting a date is: $chr(124) /msg $nick Current Settings: Event -7 %upcomingevent 1Date -7 %nexteventdate $chr(124) /msg $nick Day(8th) Month(June) Year(2006) Hours(8):Minutes(3)(am/pm) $chr(124) /msg $nick To rename an event type - /notice Mene[mIRC] !setevent $chr(124) /msg $nick To change the date type - /notice Mene[mIRC] !setdate } } } on *:notice:!setevent*:?:{ if ( $nick isop #emkay ) { /set %upcomingevent $2- /notice $nick Thank you. The event is currently set to:7 %upcomingevent /notice $nick If you have not done so already, do not forget to set the date by typing !setdate Day(4th) Month(August) Year(2006) Hour(3):Minutes(30)(am/pm) } } on *:notice:!setdate*:?:{ if ( $nick isop #emkay ) { ; Sets the date for the next event. Correct syntax is Day/Month/Year Hour:Minutes:Seconds ( 17/8/06 3:00:00 ) /set %nexteventdate $2- /notice $nick Thank you. The date is currently set to:7 %nexteventdate /notice $nick Please make sure you followed the correct syntax - Day(4th) Month(August) Year(2006) Hour(3):Minutes(30)(am/pm) /notice $nick And the time and date are for the CST Timezone /notice $nick If you have not done so already, do not forget to set the event by typing !setevent Pk Trip } }