Sponsored Links




Topic Options
Rate This Topic
#1578 - 04/09/08 03:54 PM World time script
TuxedoJericho Offline
newbie

Registered: 12/24/07
Posts: 42
Loc: Whitesburg, TN
I found this code on the net, but I could never get it to workj for my bot. I found a way to get it to work corrently with some creative edits. Also, I am only able to get it to work in one channel at a time. I have this set for datalore's chat, and I decided to add a different script for each channel it was in.

This script is really best for when you are running a bot in someone else's chat that is in a different timezone than you are in.

Code:
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 for this, since if I just had $chan and the like, it would try to PM either someone named "sorry" or "current" depending on which instance it was.

For people to use this, all you need to edit is #datalore to the chat name you want and dublin in the 2nd line to a city near you.

However, if you are in the same timezone as the bot is all you need is this.

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


_________________________
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
#1582 - 04/09/08 09:12 PM Re: World time script [Re: TuxedoJericho]
dave Offline
n00b

Registered: 04/07/08
Posts: 17
Loc: canada
where it it says on 1:TEXT:!time*:#DATALORE:{
wtime dublin
do we change it to our chanl.
_________________________
O is for on the dark side, beacouse we have some fresh cookies. (COOKIES)
WOO!

Top
#1599 - 04/09/08 10:40 PM Re: World time script [Re: dave]
TuxedoJericho Offline
newbie

Registered: 12/24/07
Posts: 42
Loc: Whitesburg, TN
that is one of the places, but down at the end it says

Code:
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
}


You need to change the chat room there too.


Edited by TuxedoJericho (04/09/08 10:41 PM)
_________________________
I am Gary "TuxedoJericho" Greenlee, and I support this message.

Top


Recent Posts
Script to join channels with 30+ users.
by usrbingeek
44 minutes 32 seconds ago
Rules for Voiced (+v) users in #Chris
by Brandon
Today at 01:05 PM
Ustream IRC Auto Identtifyer
by Dark_Aaron
Today at 10:42 AM
IRC Bot Platforms
by Sam Ferry
Today at 02:58 AM
Get a free forum for your channel!
by Sam Ferry
Today at 02:48 AM
Ban Appeal Process
by Sam Ferry
Today 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
Kicked & Devoiced - Due to spam
by eggy
01/02/09 07:25 PM
Recent Pics
Xchat
mIRC on Linux
mIRC on Linux???
Who's Online
1 registered (1 invisible), 6 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
usrbingeek 510
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.