Simple !time

By Spoofing on Dec 18, 2010

Just simple !time script.

on *:TEXT:!time:#: {
  msg # The time is $asctime(h:nn) $iif($asctime(H) isnum 0-5,at night) $iif($asctime(H) isnum 6-11,in the morning) $iif($asctime(H) isnum 12-17,in the afternoon) $iif($asctime(H) isnum 18-23,in the evening)
  msg # on $day $+ , the $ord($asctime(d)) day of $asctime(mmmm) $+ .
  msg # $chr(15) $chr(15) $+($chr(3),14,$replace($day,Sunday,Today you should make your own bread.,Monday,Don't forget; you have a mission.,Tuesday,Today you should play Minecraft.,Wednesday,Remember to brush twice daily.,Thursday,Today your life is an RPG.,Friday,It's Friday; go buy some tape.,Saturday,Today you should invest in solar panels.),$chr(3))
}

Comments

Sign in to comment.
jaytea   -  Dec 21, 2010

sorry to leave you hanging Jethro - i should really elaborate on what i wrote :P i'm going to write a small article in the near future to discuss these views formally - i'll let you know when i'm done!

 Respond  
Daking   -  Dec 19, 2010

Fun script, has potential for a greater script
1 like
nice spoofing

 Respond  
[85]   -  Dec 19, 2010

nice... :))

 Respond  
Jethro   -  Dec 18, 2010

So what are you suggesting precisely? Use the if ($1 == trigger) ? as a good habit or practice :? Perhaps you can give me some pointers as to what you mean by "chunky, outdated, or invalid as opposed to that of nightmares. Explain the downfalls to me.

 Respond  
jaytea   -  Dec 18, 2010

Jethro, when i first pointed out that $($iif( )) in matchtext idea it was purely to show that it is actually possible to perform such checks in the header portion of an event - i didn't mean for it to serve as an example of good scripting practice. in terms of readability and suitability, i would place it in the same category as chunky $regsubex() loops, overuse of outdated or invalid code and other scripting related nightmares :P

 Respond  
Jethro   -  Dec 18, 2010

One thing to make the snippet more interesting is to diversify the day replies a bit. Over time people might get bored with the same thing over and over.

 Respond  
cupcake   -  Dec 18, 2010

how stupid didn't use my bot which already strips code ..i'm badddd LoL it works :D [12:49] < babycakes> !time
[12:49] < sugar^cookie> The time is 12:49 in the afternoon
[12:49] < sugar^cookie> on Saturday, the 18th day of December.
[12:49] < sugar^cookie> Today you should invest in solar panels.
by the way it's cute ..

 Respond  
Jethro   -  Dec 18, 2010

Yes, but I tend not to use regex for one word match. Change \b to $ so it won't trigger by punctuation characters affixing to it. And there is no $2 used anyway.

Also, spoofing could have used $time(h:nn) and $time(H) in place of $asctime(h:nn) and $asctime(H)

It's slimmer and does the same thing.

 Respond  
a careful warchild   -  Dec 18, 2010

Or

on $*:text:/^!time\b/Si:*:{
 Respond  
Jethro   -  Dec 18, 2010

cupcake, it's working. Chances are the control codes caused the code to not recognize the command. Change the text event to this:

on *:TEXT:$($iif(!time = $strip($1),$1)):#:{

It's always a good idea to use $strip() for the trigger commands. You'd never know if people have a custom script using control codes and that you do not have your mirc set to strip out incoming messages.

P.S. I know the user Teen would think otherwise.

 Respond  
cupcake   -  Dec 18, 2010

tried tested this snippet doesn't work.
[10:31] < babycakes> !time
[10:32] < vicky123> !time
maybe you can explain why ...
thank you :)

 Respond  
Spoofing   -  Dec 18, 2010

lol; I love simple scripts like this because it's reminds me of times when I just started learning mSL (6 years ago).

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.