Kod: Kodu kopyalamak için üzerine çift tıklayın!
alias rotabul { $iif(!$dialog(rota),dialog -m rota rota) | dialog -a rota rota }
alias -l rota { sockclose *rota* | echo -a Lütfen Bekleyin... | $iif($file(rt.txt),.remove rt.txt) | $iif($file(rt2.txt),.remove rt2.txt) | set %rt.basla $urlencode($1) | set %rt.bitis $urlencode($2) | set %rt.kriter $urlencode($3) | sockopen $+(Srota,$r(1,9999999)) mercedes.infotech.com.tr 80 }
alias -l rt.toparla {
var %i 1
while (%i <= $lines(rt.txt)) {
if ($read(rt.txt,%i) isupper) { write $+(-l,$calc(%i -1)) $shortfn(rt.txt) $read(rt.txt,$calc(%i -1)) $+ $read(rt.txt,%i) | write $+(-dl,%i) $shortfn(rt.txt) }
if ($read(rt.txt,%i) islower) { write $+(-l,$calc(%i +1)) $shortfn(rt.txt) $read(rt.txt,%i) $+ $read(rt.txt,$calc(%i +1)) | write $+(-dl,%i) $shortfn(rt.txt) }
inc %i
}
var %i 1
while (%i <= $lines(rt2.txt)) {
if ($read(rt2.txt,%i) isupper) { write $+(-l,$calc(%i -1)) $shortfn(rt2.txt) $read(rt2.txt,$calc(%i -1)) $+ $read(rt2.txt,%i) | write $+(-dl,%i) $shortfn(rt2.txt) }
if ($read(rt2.txt,%i) islower) { write $+(-l,$calc(%i +1)) $shortfn(rt2.txt) $read(rt2.txt,%i) $+ $read(rt2.txt,$calc(%i +1)) | write $+(-dl,%i) $shortfn(rt2.txt) }
inc %i
}
dialog -m rt.fazla rt.fazla
}
alias -l rotacek { sockopen $+(Jrota,$r(1,99999999)) mercedes.infotech.com.tr 80 }
alias -l urlencode { return $regsubex($1-,/\G(.)/g,$iif(\t !isalnum && !$prop,$chr(37) $+ $base($asc(\t),10,16),\t)) }
alias -l rota2 { sockopen $+(1rota,$r(1,999999)) mercedes.infotech.com.tr 80 }
on *:SockOpen:Srota*:{
if ($sockerr) { echo -a Bağlantı Hatası! | return }
var %s sockwrite -n $sockname
%s GET $+(/rlist.asp?Departure=,%rt.basla,&Arrival=,%rt.bitis,&Route=STANDART&Criteria=,%rt.kriter,&Petrol=&Fuel=) HTTP/1.1
%s Host: mercedes.infotech.com.tr
%s User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
%s Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
%s Accept-Language: tr-TR,tr;q=0.8,en-us;q=0.5,en;q=0.3
%s Accept-Encoding: gzip,deflate
%s Accept-Charset: ISO-8859-9,utf-8;q=0.7,*;q=0.7
%s Keep-Alive: 300
%s Connection: keep-alive
if (%rt.cerez) { %s Cookie: %rt.cerez }
%s $crlf
}
on *:SockOpen:Jrota*:{
if ($sockerr) { echo -a Bağlantı Hatası! | return }
var %s sockwrite -n $sockname
%s GET %resim.url HTTP/1.1
%s host: mercedes.infotech.com.tr
if (%rt.cerez) { %s Cookie: %rt.cerez }
%s $crlf
}
on *:SockRead:Jrota*:{
var %a
sockread %a
$iif(Length: isin %a,set %rt.length $gettok(%a,2,32))
if (* !iswm %a) { write -c jan.gif | set %rt.size $sock($sockname).rcvd | sockrename $sockname $+(nrota,$r(1,999999)) }
}
on *:Sockread:nrota*:{
sockread &b
bwrite jan.gif -1 -1 &b
var %yuz = $round($calc(100 * ($sock($sockname).rcvd - %rt.size) / %rt.length),1)
if (%yuz >= 100) {
set %pw $pic($shortfn(jan.gif)).width
set %ph $pic($shortfn(jan.gif)).height
window -pk[0] @rota 0 0 %pw %ph
window -a @rota
drawrect -rf @rota $rgb(245,245,245) 1 0 0 %pw %ph
drawpic @rota 0 0 $shortfn(jan.gif)
drawrect -r @rota $rgb(0,0,0) 1 0 0 %pw %ph
drawrect -r @rota $rgb(0,0,0) 1 0 $calc(%ph - 30) 1 1
.remove $shortfn(jan.gif)
unset %rt.* %resim.url
}
}
on *:SockOpen:1rota*:{
if ($sockerr) { echo -a Bağlantı Hatası! | return }
var %s sockwrite -n $sockname
%s GET $+(/,%rt.location) HTTP/1.1
%s Host: mercedes.infotech.com.tr
%s User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
%s Accept: application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
%s Accept-Language: tr-TR,tr;q=0.8,en-us;q=0.5,en;q=0.3
%s Accept-Encoding: gzip,deflate
%s Accept-Charset: ISO-8859-9,utf-8;q=0.7,*;q=0.7
%s Keep-Alive: 300
%s Connection: keep-alive
if (%rt.cerez) { %s Cookie: %rt.cerez }
%s $crlf
}
on *:SockRead:Srota*:{
var %a
sockread %a
if (NAME=departure isin %a) { set %rt.rota 1 }
if (NAME=arrival isin %a) { set %rt.rota 2 }
if (*<OPTION*value=* iswm %a) {
var %i 1,%t $replace(%a,<OPTION,¿)
while (%i <= $numtok(%t,191)) {
write $iif(%rt.rota == 1,rt.txt,rt2.txt) $remove($gettok(%t,%i,191),SELECTED,$chr(32),<O,<OP,<OPT,<OPTI,<OPTIO)
inc %i
}
}
if (</HTML> isin %a) { rt.toparla }
if (Location: isin %a) { set %rt.location $gettok(%a,2-,32) | rota2 | sockclose $sockname | return }
if (Set-Cookie: isin %a) { set %rt.cerez $gettok($gettok(%a,2-,32),1,$asc(;)) }
}
on *:SockRead:1rota*:{
var %a
sockread %a
if (Arama kriterlerinden isin %a) {
echo -a Aradığınız Kriterde Sonuç Bulunamadı Lütfen Tekrar Deneyin
rotabul
sockclose *
}
if (Set-Cookie: isin %a) { set %rt.cerez $gettok($gettok(%a,2-,32),1,$asc(;)) }
if ("/temp/ isin %a) { set %resim.url $gettok(%a,2,$asc(")) | rotacek }
}
dialog rt.fazla {
title "Yol Rota Bulucu"
size -1 -1 208 126
option dbu
list 1, 5 29 90 76, size vsbar
list 2, 108 29 90 76, size vsbar
button "Tamam", 3, 82 111 37 12
text "Başlangıç", 4, 5 17 25 8
text "Bitiş", 5, 108 17 25 8
text "Aradığınız isimle birden fazla il, ilçe veya semt bulundu. Listeden uygun olanı seçiniz.", 6, 3 3 202 11
}
on *:dialog:rt.fazla:*:*:{
if ($devent == init) {
var %i 1
while (%i <= $lines(rt.txt)) {
did -a $dname 1 $gettok($read(rt.txt,%i),2,$asc(>))
inc %i
}
var %i 1
while (%i <= $lines(rt2.txt)) {
did -a $dname 2 $gettok($read(rt2.txt,%i),2,$asc(>))
inc %i
}
}
if ($devent == sclick) {
if $did(1).sel && $did(2).sel {
if ($did == 3) {
set %rt.location $+(rcalc.asp?departure=,$gettok($gettok($read(rt.txt,$did(1).sel),2,$asc(=)),1,$asc(>)),&arrival=,$gettok($gettok($read(rt2.txt,$did(2).sel),2,$asc(=)),1,$asc(>)),&route=STANDARD&criteria=SHORT&petrol=&fuel=)
rota2
echo -a Lütfen Bekleyin...
dialog -x $dname $dname
}
}
}
}
dialog rota {
title "Yol Rota Bulucu"
size -1 -1 183 76
option dbu
button "Başla!", 3, 69 61 37 12
edit "", 1, 30 33 50 10
text "Başlangıç", 2, 31 23 25 8
text "Başlangıç ve bitiş için il, ilçe veya semt adı giriniz. İsmin başlangıcını girip tamamlamadan bırakabilirsiniz. Bu durumda bulunanlar listelenecektir.", 4, 2 3 176 16
text "Bitiş", 5, 99 23 25 8
edit "", 6, 98 32 50 10
radio "En Kısa Süre", 7, 30 48 50 10
text "Kriter", 8, 3 49 25 8
radio "En Az Mesafe", 9, 98 48 50 10
}
on *:dialog:rota:*:*:{
if ($devent == sclick) {
if ($did == 3) {
if ($did(1) && $did(6)) && ($did(7).state || $did(9).state) {
rota $did(1) $did(6) $iif($did(7).state,FAST,SHORT)
}
else { echo -a Lütfen Alanları Tam Olarak Doldurunuz }
}
}
}