Sponsored Links


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

Registered: 12/24/07
Posts: 32
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
Happy birthday usrbingeek!
by sbushfan11
Today at 03:42 PM
MyNick
by KtecK
Today at 08:50 AM
Automated Ban removal
by iPhone
Yesterday at 11:32 PM
Linkinus Help
by iPhone
Yesterday at 11:29 PM
Who uses Twitter?
by techman224
Yesterday at 11:15 PM
Thank You Moderators
by iPhone
Yesterday at 10:11 PM
Hello, And Welcome To The #SamF Forums
by techman224
Yesterday at 09:01 PM
Trigger Script.
by jwire4
Yesterday at 04:16 PM
How do I identify on Rooms app for iPhone?
by iPhone
Yesterday at 04:09 PM
Topic setter's username is appended to topic
by techman224
Yesterday at 02:59 PM
Away notification script
by evanrocks010
Yesterday at 02:43 PM
Im having trouble with mode commands
by techman224
Yesterday at 02:31 PM
Recent Pics
Old school IRC
How to use Google!
TIX
Who's Online
1 Registered (1 invisible), 9 Guests and 9 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
usrbingeek 431
Kat 233
iPhone 94
Phil 87
Freekie 78
CCMike 66
techman224 64
Justin 59
wirelesspacket 52
tengrrl 50
Terms Of Use
Use of this community signifies your agreement to the Terms Of Service and Conditions of Use.