;######################################################################### ;## 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 %eventdaycalc [ $+ [ $nick ] ] $ctime( %nexteventdate ) /set -u %eventcurrentdate [ $+ [ $nick ] ] $ctime /set -u %eventcalculated [ $+ [ $nick ] ] $round($calc(( %eventdaycalc [ $+ [ $nick ] ] - %eventcurrentdate [ $+ [ $nick ] ] )/3600),2) /set -u %eventhoursbefore [ $+ [ $nick ] ] %eventcalculated [ $+ [ $nick ] ] %eventdaysleft [ $+ [ $nick ] ] = 0 ; If there are enough hours, it changes them into days. while (%eventcalculated [ $+ [ $nick ] ] >= 24.00) { %eventcalculated [ $+ [ $nick ] ] = %eventcalculated [ $+ [ $nick ] ] - 24 /inc %eventdaysleft [ $+ [ $nick ] ] /dec %eventcalculated [ $+ [ $nick ] ] 24 } ; Takes the decimal out of the hours and converts it to minutes. Removes decimal from minutes. %eventminutesleft [ $+ [ $nick ] ] = $round($calc(($gettok(%eventcalculated [ $+ [ $nick ] ],2,46))/100*60),0) %eventhoursleft [ $+ [ $nick ] ] = $deltok(%eventcalculated [ $+ [ $nick ] ],2,46) ;Displays how much time is left. if ( %eventhoursbefore [ $+ [ $nick ] ] > 0) { notice $nick 7The %upcomingevent starts in approximately %eventdaysleft [ $+ [ $nick ] ] Day(s), %eventhoursleft [ $+ [ $nick ] ] Hour(s), and %eventminutesleft [ $+ [ $nick ] ] Minute(s). } if ( %eventhoursbefore [ $+ [ $nick ] ] < 0) { notice $nick 7The %upcomingevent has already begun or is already over. Please contact a leader for more info. } ; Unsets all variables beggining with event /unset %event* } 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 } }