Sponsored Links




Topic Options
Rate This Topic
#1452 - 03/29/08 10:16 PM !time scripts
TuxedoJericho Offline
newbie

Registered: 12/24/07
Posts: 42
Loc: Whitesburg, TN
Hey guys, I wanted to share a really easy !time script for an mIRC bot. This is basically when the bot is just saying your time.

on 1:TEXT:!time:#channelname:/msg $chan $time

yeah, easy.

However, it if want to the bot to display the time for another user's chat, then here is a code that I found and edited to work. It is using #datalore and the timezone for Dublin

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

on 1:TEXT:!time*:#datalore:{
wtime dublin
}
alias wtime {
sockopen timed www.timeanddate.com 80
set %srch $1
}
on 1:SOCKOPEN:timed:{
sockwrite -n $sockname GET $+(/search/results.html?query=,%srch) HTTP/1.1
sockwrite -n $sockname Host: www.timeanddate.com
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:timed:{
sockread %temp
if (<a href="/worldclock/city.html?n= isin %temp) { sockmark timed $remove($gettok(%temp,1,62),<a href=",") | wdtime }
if (<div class="minititle">No matches were found for*word</div> iswm %temp) { msg #testaway Sorry, No Match Found for $+(",,%srch,") | unset %srch }
}
alias wdtime {
sockopen wtimed www.timeanddate.com 80
}
on 1:sockopen:wtimed:{
sockwrite -n $sockname GET $+(/,$sock(timed).mark) HTTP/1.0
sockwrite -n $sockname Host: www.timeanddate.com
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname $crlf
}
on 1:sockread:wtimed:{
sockread %temp
if (<tr><th class="head" colspan="2"><span class="biggest">* iswm %temp) { /msg $chan ** $remove($gettok(%temp,4,62),</span) ** }
if (<tr class="d0"><th>Current time</th> isin %temp) { /msg #datalore Datalore's Current Time: $remove($gettok(%temp,5,60) $+(,$iif($remove($gettok(%temp,7,62),</a) == </td,,$remove($gettok(%temp,7,62),</a))) }
if (<tr><td>Standard time zone:</td> isin %temp) { /msg #datalore Datalore's current time: $remove($gettok(%temp,10,62), </td>) }
unset %srch
}

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

Now, I tried to get this to work for multiple channels, but it kept attempting to PM a user named CURRENT (who doesn't exist) instead of the channel name, so I had to set it to only trigger and reply in datalore's chat. Now, there is nothing against running separate versions of the script in the same bot for separate channels.

if you want to experiment with this and see if you can get it to work in multiple chats, then please have at it.

Edit: There seems to be a few weird gaps in the lower parts of the code when I preview. If there is, I apologize for that.
_________________________
I am Gary "TuxedoJericho" Greenlee, and I support this message.

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top
#1454 - 03/29/08 10:31 PM Re: !time scripts [Re: TuxedoJericho]
Pctech37 Offline
newbie

Registered: 03/26/08
Posts: 33
Loc: Everett, WA
So weird i just almost posted that script! (dang)
_________________________
Hi. I am a forum signature virus. Paste me to your signature(s). *evil laugh*

Pctech37
G33k
Recognized WyldRyde Life Form
#Chris - VOP
#DavisCreation - SOP
#davisops - Founder
#gtaivchat - SOP
#Karol - HOP
#mancode - 5
#McInTEC - VOP
#pctech37 - Founder
#pctech37poker - Founder
#sports - Founder
#turtles - HOP

Top


Recent Posts
Accept - Reject Pm script. Final Version.
by Kevin_28
1 second ago
Script to join channels with 30+ users.
by usrbingeek
Yesterday at 02:32 PM
Rules for Voiced (+v) users in #Chris
by Brandon
Yesterday at 01:05 PM
Ustream IRC Auto Identtifyer
by Dark_Aaron
Yesterday at 10:42 AM
IRC Bot Platforms
by Sam Ferry
Yesterday at 02:58 AM
Get a free forum for your channel!
by Sam Ferry
Yesterday at 02:48 AM
Ban Appeal Process
by Sam Ferry
Yesterday at 02:36 AM
Flood Protection
by Dark_Aaron
01/03/09 08:14 PM
IRCop Script
by Samuel
01/03/09 04:57 AM
A simple topic script.
by Samuel
01/03/09 04:56 AM
Complete Autojoin script.
by Samuel
01/03/09 04:47 AM
Voice
by Matt Smith
01/02/09 07:54 PM
Recent Pics
Xchat
mIRC on Linux
mIRC on Linux???
Who's Online
1 registered (Kevin_28), 4 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
usrbingeek 512
Kat 281
Phil 112
iPhone 109
Freekie 88
Justin 81
CCMike 78
techman224 75
tengrrl 58
wirelesspacket 53
Terms Of Use
Use of this community signifies your agreement to the Terms Of Service and Conditions of Use.