IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   mIRC Scripting Sorunları (https://www.ircforumlari.net/mirc-scripting-sorunlari/)
-   -   txt kayıt ve okuma ile ilgili sorun... (https://www.ircforumlari.net/mirc-scripting-sorunlari/198036-txt-kayit-ve-okuma-ile-ilgili-sorun.html)

XcLusive 16 Nisan 2009 14:33

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
Kod:

if $1 == !top10 { aktar }
ve top10 listesini çıkartacak kod;

Kod:

alias aktar {
  if $hget(toplist) { .hfree -sw toplist }
  var %x = 1,%t = $lines(dosya.txt)
  if !$hget(toplist) { hmake toplist }
  while (%x <= %t) {
    .hadd toplist $gettok($read(dosya.txt,%x),1,32) $gettok($read(dosya.txt,%x),2,32)
    inc %x 1
  }
  msg #kanal $toplist
}
alias toplist {
  hsave -o toplist $qt($+($mdir,toplist.data))
  .hfree -sw toplist | hmake toplist | hload toplist $qt($+($mdir,toplist.data))
  if (!$hget(top10puan)) { hmake top10puan }
  var %xc = $hget(toplist,0).data
  while %xc {
    set %top10puan $addtok(%top10puan,$hget(toplist,%xc).data,46)
    dec %xc
  }
  var %sira = $sorttok(%top10puan,46,nr)
  var %1 = 1,%2 = 1,%3 = 1,%4 = 1,%5 = 1,%6 = 1,%7 = 1,%8 = 1,%9 = 1,%10 = 1
  %1 = 0,10 $+ $fazlaise($gettok(%sira,1,46)) 0,6 $gettok(%sira,1,46)
  %2 = 0,10 $+ $fazlaise($gettok(%sira,2,46)) 0,6 $gettok(%sira,2,46)
  %3 = 0,10 $+ $fazlaise($gettok(%sira,3,46)) 0,6 $gettok(%sira,3,46)
  %4 = 0,10 $+ $fazlaise($gettok(%sira,4,46)) 0,6 $gettok(%sira,4,46)
  %5 = 0,10 $+ $fazlaise($gettok(%sira,5,46)) 0,6 $gettok(%sira,5,46)
  %6 = 0,10 $+ $fazlaise($gettok(%sira,6,46)) 0,6 $gettok(%sira,6,46)
  %7 = 0,10 $+ $fazlaise($gettok(%sira,7,46)) 0,6 $gettok(%sira,7,46)
  %8 = 0,10 $+ $fazlaise($gettok(%sira,8,46)) 0,6 $gettok(%sira,8,46)
  %9 = 0,10 $+ $fazlaise($gettok(%sira,9,46)) 0,6 $gettok(%sira,9,46)
  %10 = 0,10 $+ $fazlaise($gettok(%sira,10,46)) 0,6 $gettok(%sira,10,46)
  return 0,10Top10 Puan $+(0,$chr(44),4,#10,$chr(44),10,$chr(32),%1) $+(0,$chr(44),4,#20,$chr(44),10,$chr(32),%2) $+(0,$chr(44),4,#30,$chr(44),10,$chr(32),%3) $+(0,$chr(44),4,#40,$chr(44),10,$chr(32),%4) $+(0,$chr(44),4,#50,$chr(44),10,$chr(32),%5) $+(0,$chr(44),4,#60,$chr(44),10,$chr(32),%6) $+(0,$chr(44),4,#70,$chr(44),10,$chr(32),%7) $+(0,$chr(44),4,#80,$chr(44),10,$chr(32),%8) $+(0,$chr(44),4,#90,$chr(44),10,$chr(32),%9) $+(0,$chr(44),4,#100,$chr(44),10,$chr(32),%10)
}
alias -l fazlaise {
  unset %y | unset %w
  var %i = $hfind(toplist,$1,0,w).data
  while (%i) {
    %y = $hfind(toplist,$1,%i,w).data
    %w = %y %w
    dec %i
  }
  return $replace($sorttok(%w,32,a),$chr(32),$chr(44))
}


lefkefb 16 Nisan 2009 16:11

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
buda tmm hocam elinize sağlık birşey daha lazım oldu
şöyle anlatayım txt içerisindeki

madrak 500
murat 600
lefkefb 799

olan değerleri !sifirla dediğimde bütün satırlardaki 2. değerleri 100 yapmasını istiyorum nasıl yapabiliriz?
!sifirla yapıldığında
madrak 100
murat 100
lefkefb 100
gibi olmasını istiyorum yani bütün satırların.

lefkefb 17 Nisan 2009 14:14

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
güncel

XcLusive 17 Nisan 2009 14:57

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
Kod:

if $1 == !sıfırla { sıfırla }
Kod:

alias sıfırla {
  var %x = 1,%t = $lines(dosya.txt)
  while (%x <= %t) {
    hadd -m aaa $gettok($read(dosya.txt,%x),1,32) 100
    inc %x 1
  }
  write -c dosya.txt
  var %x = 1,%t = $hget(aaa,0).data
  while (%x <= %t) {
    write dosya.txt $hget(aaa,%x).item $hget(aaa,%x).data
    inc %x 1
  }
  .hfree -sw aaa
  msg #kanal data sıfırlandı
}

bide şu isteklerinizi taksit taksit söylemeseniz çok güzel olacak.

lefkefb 17 Nisan 2009 21:55

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
Alıntı:

XcLusive Nickli Üyeden Alıntı (Mesaj 689370)
Kod:

if $1 == !top10 { aktar }
ve top10 listesini çıkartacak kod;

Kod:

alias aktar {
  if $hget(toplist) { .hfree -sw toplist }
  var %x = 1,%t = $lines(dosya.txt)
  if !$hget(toplist) { hmake toplist }
  while (%x <= %t) {
    .hadd toplist $gettok($read(dosya.txt,%x),1,32) $gettok($read(dosya.txt,%x),2,32)
    inc %x 1
  }
  msg #kanal $toplist
}
alias toplist {
  hsave -o toplist $qt($+($mdir,toplist.data))
  .hfree -sw toplist | hmake toplist | hload toplist $qt($+($mdir,toplist.data))
  if (!$hget(top10puan)) { hmake top10puan }
  var %xc = $hget(toplist,0).data
  while %xc {
    set %top10puan $addtok(%top10puan,$hget(toplist,%xc).data,46)
    dec %xc
  }
  var %sira = $sorttok(%top10puan,46,nr)
  var %1 = 1,%2 = 1,%3 = 1,%4 = 1,%5 = 1,%6 = 1,%7 = 1,%8 = 1,%9 = 1,%10 = 1
  %1 = 0,10 $+ $fazlaise($gettok(%sira,1,46)) 0,6 $gettok(%sira,1,46)
  %2 = 0,10 $+ $fazlaise($gettok(%sira,2,46)) 0,6 $gettok(%sira,2,46)
  %3 = 0,10 $+ $fazlaise($gettok(%sira,3,46)) 0,6 $gettok(%sira,3,46)
  %4 = 0,10 $+ $fazlaise($gettok(%sira,4,46)) 0,6 $gettok(%sira,4,46)
  %5 = 0,10 $+ $fazlaise($gettok(%sira,5,46)) 0,6 $gettok(%sira,5,46)
  %6 = 0,10 $+ $fazlaise($gettok(%sira,6,46)) 0,6 $gettok(%sira,6,46)
  %7 = 0,10 $+ $fazlaise($gettok(%sira,7,46)) 0,6 $gettok(%sira,7,46)
  %8 = 0,10 $+ $fazlaise($gettok(%sira,8,46)) 0,6 $gettok(%sira,8,46)
  %9 = 0,10 $+ $fazlaise($gettok(%sira,9,46)) 0,6 $gettok(%sira,9,46)
  %10 = 0,10 $+ $fazlaise($gettok(%sira,10,46)) 0,6 $gettok(%sira,10,46)
  return 0,10Top10 Puan $+(0,$chr(44),4,#10,$chr(44),10,$chr(32),%1) $+(0,$chr(44),4,#20,$chr(44),10,$chr(32),%2) $+(0,$chr(44),4,#30,$chr(44),10,$chr(32),%3) $+(0,$chr(44),4,#40,$chr(44),10,$chr(32),%4) $+(0,$chr(44),4,#50,$chr(44),10,$chr(32),%5) $+(0,$chr(44),4,#60,$chr(44),10,$chr(32),%6) $+(0,$chr(44),4,#70,$chr(44),10,$chr(32),%7) $+(0,$chr(44),4,#80,$chr(44),10,$chr(32),%8) $+(0,$chr(44),4,#90,$chr(44),10,$chr(32),%9) $+(0,$chr(44),4,#100,$chr(44),10,$chr(32),%10)
}
alias -l fazlaise {
  unset %y | unset %w
  var %i = $hfind(toplist,$1,0,w).data
  while (%i) {
    %y = $hfind(toplist,$1,%i,w).data
    %w = %y %w
    dec %i
  }
  return $replace($sorttok(%w,32,a),$chr(32),$chr(44))
}



hocam çok yük oldum sizede ama ilerleyerek yaptığımdan parça parça sormak zorunda kalıyorum kusuruma bakmayın bu sistem çalışıyor fakat birşey oldu ben ayrıyetten kisi.txt içerisinde
murat
madrak
lefkefb
ali

gibi terimler var !top10 dediğimizde kisi.txt içerisinde bulunan kişilerin dosya.txt içerisindeki değerlerini alsın ve listelesin şeklinde değiştirmemiz mümkünmü
yani şöyle dosya.txt içerisinde
fatma 166
var ama kisi.txt de
fatma
yok ise
dosya.txt den fatma nın değerini almasın ve top10 da listelemesin

sniper 17 Nisan 2009 23:32

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
vay be XcLusive ben senin gibi yetenekli olsaydım bukadar uğraşırmıydım diye kendime soruyorum da açıkçası :D uğraşmazdım galiba ee buda senin farkın. eline sağlık hocam.

XcLusive 18 Nisan 2009 20:02

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
alias aktar {

kod vs..

}

kısmını

Kod:

alias aktar {
  if $hget(toplist) { .hfree -sw toplist }
  var %x = 1,%t = $lines(dosya.txt)
  if !$hget(toplist) { hmake toplist }
  while (%x <= %t) {
    if ($read(kisi.txt,w,$+(*,$gettok($read(dosya.txt,%x),1,32),*)) { .hadd toplist $gettok($read(dosya.txt,%x),1,32) $gettok($read(dosya.txt,%x),2,32) }
    inc %x 1
  }
  msg #kanal $toplist
}

şeklinde değiştir

lefkefb 18 Nisan 2009 23:57

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
hocam
if ($read(kisi.txt,w,$+(*,$gettok($read(dosya.txt,%x) ,1,32),*)) { .hadd toplist $gettok($read(dosya.txt,%x),1,32) $gettok($read(dosya.txt,%x),2,32) }

bu satırda hata alıyorum kendi başıma çözemedim birkezdaha yardımcı olurmusun sadece kisi.txt içerisinde bulunan isimleri top10 listesinde listelesin istiyorum yanlış anlaşılmıyım o yüzden tekrar belirteyim istedim

XcLusive 19 Nisan 2009 00:05

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
Kod:

if ($read(kisi.txt,w,$+(*,$gettok($read(dosya.txt,%x) ,1,32),*))) { .hadd toplist $gettok($read(dosya.txt,%x),1,32) $gettok($read(dosya.txt,%x),2,32) }
1 tane parantez unutmuşum kapatmak için :)

lefkefb 19 Nisan 2009 00:18

Cevap: txt kayıt ve okuma ile ilgili sorun...
 
Allah razı olsun efendim çok teşekkür edeiyorum


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 18:05.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk