יוצר: Sniper
תיאור: קוד שמראה את מזג האוויר בכל הארץ באמצעות דיאלוג
הפעלה: שמים את הקוד ברימוט (Alt+R) ואת התמונה המצורפת בתיקייה של המירק, לוחצים מקש ימיני בכל ערוץ ו Weather Check
תמונה:
קוד: בחר הכל
menu channel {
Weather Check: { /iw }
}
alias iw { sockopen iw www.israelweather.co.il 80 | set %iw.date $iif($1,$1,$date) }
on *:sockopen:iw:{
if (!$sockerr) {
var %s = sockwrite -tn $sockname
%s GET /3w.asp?month_t= [ $+ [ $gettok(%iw.date,2,47) ] $+ ] &day_t= [ $+ [ $gettok(%iw.date,1,47) ] $+ ] &year_t= [ $+ [ $gettok(%iw.date,3,47) ] ] HTTP/1.1
%s Host: www.israelweather.co.il
%s Accept: */*
%s Connection: Close
%s
if (!$window(@weather)) { window -dw0k0pBd +d @Weather 50 50 450 480 }
drawpic -s @weather 0 0 450 480 bgiw.jpg
drawrect @weather 01 2 0 0 450 576
drawrect -f @weather 01 2 0 0 450 20
drawrect @weather 00 1 430 3 15 15
drawrect @weather 00 1 410 3 15 15
drawtext @weather 00 Webdings 10 433 2 r
drawline @weather 00 1 413 15 422 15
drawtext @weather 00 tahoma 13 17 3 Weather Forecast
drawtext @weather 00 tahoma 10 20 25 %iw.date
drawline @weather 01 2 300 0 300 700
drawline @weather 01 2 150 0 150 700
drawtext -o @weather 01 tahoma 15 60 50 :טמפרטורה
drawtext -o @weather 01 tahoma 15 210 50 :מזג אוויר
drawtext -o @weather 01 tahoma 15 400 50 :עיר
var %x = 80 | while (%x <= 700) { drawline @weather 01 2 0 %x 500 %x | inc %x 20 }
set %iw.c 83
}
}
on *:sockread:iw:{
var %iw
sockread %iw
if ($regex(%iw,/<font class.*>(.*)<\/td>/) && $regml(1)) {
set %iw2 $addtok(%iw2,$regml(1),44)
if ($numtok(%iw2,44) >= 3) {
drawtext @weather 00 tahoma 12 40 %iw.c $gettok(%iw2,2,44) $+ $chr(176)
drawtext @weather 00 tahoma 12 $calc(280 - $width($gettok(%iw2,1,44) ,Tahoma,12)) %iw.c $gettok(%iw2,1,44)
drawtext @weather 00 tahoma 12 $calc(430 - $width($gettok(%iw2,3,44) ,Tahoma,12)) %iw.c $gettok(%iw2,3,44)
inc %iw.c 20
unset %iw2
}
}
}
menu @weather {
sclick:{
if ($inrect($mouse.x,$mouse.y,430,3,15,15)) {
window -c @weather
}
elseif ($inrect($mouse.x,$mouse.y,410,3,15,15)) {
window -n @weather
}
}
mouse:{
if ($mouse.key & 1) {
move.win @weather $calc($mouse.dx - $window(@weather).x) $calc($mouse.dy - $window(@weather).y)
}
}
}
alias move.win {
if ($window($1)) {
if ($mouse.key & 1) {
window $1 $calc($mouse.dx - $2) $calc($mouse.dy - $3)
.timer -o 1 0 move.win $1-
}
}
}
תהנו!!