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/)
-   TCL Scriptler (https://www.ircforumlari.net/tcl-scriptler/)
-   -   tcl yardım (https://www.ircforumlari.net/tcl-scriptler/765724-tcl-yardim.html)

amonhutep 25 Aralık 2016 17:57

tcl yardım
 
arkadaşlar bi tcl dosyası oluşturup 40 adet txt dosyasını komut ile bu tcl ye okutmak istiyorum yardımcı olur musunuz?aşağıdaki buluduğum kodlar doğru mu veya eklenecek değişecek kodlar var mı?


set oku "x.txt"
set kanal "#kanal"

bind pub - !kural pub:kuralmsg
proc pub:kuralmsg { nick host hand chan text} {
global oku kanal
if {[file exists $oku]} {
set kuralfile [open $oku r]
while {![eof $kuralfile]} {
catch {set kuraltext [gets $kuralfile]}
putserv "PRIVMSG $kanal :$kuraltext"
}
catch {close $kuralfile}
}
}
-
proc fread {dosya kime} {
if {![file exists $dosya]} {
putlog "$dosya adinda bir belge bulunamadi"
return
}
set cikti [open $dosya r]
set satir [split [read $cikti] \n]
catch {close $cikti}
set say 0
foreach satir $satir {
if {$satir != ""} {
puthelp "PRIVMSG $kime :$satir"
incr say
}
}
if {$say == 0} {
puthelp "PRIVMSG $kime :Mevcut dosya icinde bilgi bulunamadi"
return
} else {
puthelp "PRIVMSG $kime :Liste sonu!"
}
}
-
bind pub - !kural kural

proc kural {nick uhost hand chan text} {
fread scripts/kural.txt $chan
}

amonhutep 26 Aralık 2016 01:17

Cevap: tcl yardım
 
Toplam 1 Eklenti bulunuyor.
veya aşağıdaki şiir.txt olarak yolladığım tcl dosyasını 40 txt dosya okuyacak ve örneğin !oku1 dediğimde 1 nolu txt dosyayı !oku2 dediğimde 2 inci txt yani !okudosyanumarası şekilde düzenleme yapabilecek arkadaşlarımız var mı?

rascoLn 27 Aralık 2016 19:11

Cevap: tcl yardım
 
txt uzantılı dosyaların bulunduğu klasorün ismini yaz , kanal adını gir

Kullanacağın komut : !oku(numara) Örn :!oku1 , !oku2

PHP- Kodu:

# txt dosyalarının bulunduğu klasor yolu"
set klasor "klasoryolu"

# Komutun kullanılacağı kanal
set kanal "#kanaladı"

bind pubm "*%!oku*" okut

proc okut 
{n u h c a}  {
set readnumber [string range $a 4 end]
if {[
string is digit $readnumber] & [exec ls -$::klasor wc -l] >= $readnumber & [string match -nocase $c $::kanal]} {
set txt [lsort [strlwr [glob $::klasor/*.txt]]]
set x 1
foreach yazdir $txt {
if { $x eq  $readnumber}  { 
set dosya [open $yazdir r]
set oku [split [read $dosya] \n]
close $dosya
foreach dokuman $oku {
putquick "privmsg $c :$dokuman"
}
};incr x
}
} else { putquick "privmsg $c :Numara girmediniz veya yanlış numara girdiniz.."}



amonhutep 27 Aralık 2016 20:53

Cevap: tcl yardım
 
Toplam 1 Eklenti bulunuyor.
çok teşekkür ederim rasclon kardeşim

--IRCForumlari.NET ; Flood Engellendi -->-> Yeni yazılan mesaj 20:53 -->-> Daha önceki mesaj 20:43 --

[20:54]¿j¿ 10Giriş: 10hikayeci 10(
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
)
[20:54]15,15. &2 Mode: 4 ChanServ  Mode Değiştirdi:4 +h hikayeci 
[20:54] <04iBRaHiM> !oku1

dediğimde okumuyor rasclon kardeşim acaba bi yerde hatalı bişey mi yaptım tcl yi bu şekilde uyarladım.

amonhutep 28 Aralık 2016 20:00

Cevap: tcl yardım
 
Alıntı:

rascoLn Nickli Üyeden Alıntı (Mesaj 1041831629)
txt uzantılı dosyaların bulunduğu klasorün ismini yaz , kanal adını gir

Kullanacağın komut : !oku(numara) Örn :!oku1 , !oku2

PHP- Kodu:

# txt dosyalarının bulunduğu klasor yolu"
set klasor "klasoryolu"

# Komutun kullanılacağı kanal
set kanal "#kanaladı"

bind pubm "*%!oku*" okut

proc okut 
{n u h c a}  {
set readnumber [string range $a 4 end]
if {[
string is digit $readnumber] & [exec ls -$::klasor wc -l] >= $readnumber & [string match -nocase $c $::kanal]} {
set txt [lsort [strlwr [glob $::klasor/*.txt]]]
set x 1
foreach yazdir $txt {
if { $x eq  $readnumber}  { 
set dosya [open $yazdir r]
set oku [split [read $dosya] \n]
close $dosya
foreach dokuman $oku {
putquick "privmsg $c :$dokuman"
}
};incr x
}
} else { putquick "privmsg $c :Numara girmediniz veya yanlış numara girdiniz.."}




Bu yukarda verdiğini yaptım ama hatalar aldım aldığım hatalar aşşağıda

Not: botu ./eggdrop -nm dosya.conf şeklinde çalıştırdım ve aşşağıdaki mesajlar çıktı.

Kod:

[19:51] Tcl error [okut]: invalid command name "strlwr"
[19:51] <iBRaHiM> !oku1
[19:51] Tcl error [okut]: invalid command name "strlwr"
[19:51] <iBRaHiM> !oku
[19:52] <iBRaHiM> !oku*
[19:52] <iBRaHiM> !oku*1
[19:52] Tcl error [okut]: invalid command name "strlwr"
[19:52] <iBRaHiM> !oku12

İlgi ve alakanıza şimdiden teşekkürler....

Heartbroken 29 Aralık 2016 05:49

Cevap: tcl yardım
 
strlwr ; string tolower Komutunun
Kısaltılmışı Olarak ,
Alltools.tcl İle Kullanılabilir.

Alltools.tcl Eggdrop İle Birlikte
Gelen, Öntanımlı Scriptlerden Biridir.

Ya Yukarıda Kullanmaya Çalıştığınız,
Koddaki Tüm strlwr'ları string tolower
Olarak Değişmeli Yada
Bu Scriptten Evvel Yüklenecek Şekilde,
.conf'ta Daha Üst Satırdan
Alltools.tcl'yi:
source scripts/alltools.tcl
Yüklemesini Sağlamalısınız.

Not:
Eğer Bota Kendinizi Tanıtmışsanız,
Bot Bir ...user "Kullanıcı" Dosyası
Halihazırda Oluşturmuşsa,
Botu -m İle Başlatmanızın Bir
Anlamı/Etkisi Yoktur.

-m Kullanıcı Dosyası Oluşturmak
İçin İlk Kurulumda İş Gören Bir
-Seçenektir.

rascoLn 29 Aralık 2016 09:12

Cevap: tcl yardım
 
Arkadaşın dediği gibi strlwr kullanımı conf dosyanızda eğer alltools.tcl source edilmişse çalışacaktır.

Eğer alltools.tcl source edilmemişse veya silinmiş elinizde bulunmuyorsa

Şu komutu :

Kod:

set txt [lsort [strlwr [glob $::klasor/*.txt]]]
Şu şekilde değiş

Kod:

set txt [lsort [string tolower [glob $::klasor/*.txt]]]
sorunun çözülmüş olucaktır..

amonhutep 29 Aralık 2016 22:07

Cevap: tcl yardım
 
botun conf dosyası
Alıntı:

###### Bilgi Satiri #####
set mod-path "modules/"
set help-path "help/"
set text-path "text/"
loadmodule dns
loadmodule channels
loadmodule server
loadmodule ctcp
loadmodule irc
loadmodule notes
loadmodule console
checkmodule blowfish

##### Bilgi Satiri #####
##### Bot bilgileri #####
set nick "hikayeci"
set realname "2hikayeci1"

#Bu opsiyonel su an kapalidir. Eger botunuz herhangi bir nedenden oturu size ctcp acmiyorsa
#Bu satira botun barindirilmis oldugu host'un ip adresini yazmaniz yeterli olacaktir.

#set my-ip "192.168.198.147"

set init-server {
putserv "oper socket 22558899"
putserv "PRIVMSG nickserv identify 22558899"
}
set servers { 192.168.198.147:6667 }
channel add #cinsellik { chanmode "lik" idle-kick 0 stopnethack-mode 0 }
set net-type 5

channel add #eggdrop { chanmode "lik" idle-kick 0 stopnethack-mode 0 }
set net-type 5
set owner iBRaHiM

##### Dosyalar ve Dizinler #####
##### Bilgi Satiri #####
set userfile "bots.user"
set chanfile "bots.chan"
set temp-path "/tmp"
logfile msbxco * "logs/bots.log"
logfile jpk #cinsellik "logs/#cinsellik.log"
set console "mkcobxs"

##### SCRIPTLER #####
source scripts/userinfo.tcl
source scripts/action.fix.tcl
source scripts/alltools.tcl
#source scripts/cinsell/rasclon.tcl
################################
loadhelp userinfo.help

# EndOf
alltools.tcl
Alıntı:

#
# All-Tools TCL, includes toolbox.tcl, toolkit.tcl and moretools.tcl
# toolbox was originally authored by cmwagner <
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
>
# toolkit was originally authored by Robey Pointer
# moretools was originally authored by David Sesno <
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
>
# modified for 1.3.0 bots by TG
#
# Copyright (C) 1999, 2003 - 2011 Eggheads Development Team
#
# Tothwolf 02May1999: rewritten and updated
# guppy 02May1999: updated even more
# Tothwolf 02May1999: fixed what guppy broke and updated again
# Tothwolf 24/25May1999: more changes
# rtc 20Sep1999: added isnumber, changes
# dw 20Sep1999: use regexp for isnumber checking
# Tothwolf 06Oct1999: optimized completely
# krbb 09Jun2000: added missing return to randstring
# Tothwolf 18Jun2000: added ispermowner
# Sup 02Apr2001: added matchbotattr
# Tothwolf 13Jun2001: updated/modified several commands
# Hanno 28Sep2001: fixed testip
# guppy 03Mar2002: optimized
# Souperman 05Nov2002: added ordnumber
# Tothwolf 27Dec2003: added matchbotattrany, optimized ordnumber,
# more minor changes
#
# $Id: alltools.tcl,v 1.24 2011/02/13 14:19:33 simple Exp $
#
########################################
#
# Descriptions of available commands:
#
##
## (toolkit):
##
#
# putmsg <nick/chan> <text>
# send a privmsg to the given nick or channel
#
# putchan <nick/chan> <text>
# send a privmsg to the given nick or channel
# (for compat only, this is the same as 'putmsg' above)
#
# putnotc <nick/chan> <text>
# send a notice to the given nick or channel
#
# putact <nick/chan> <text>
# send an action to the given nick or channel
#
#
##
## (toolbox):
##
#
# strlwr <string>
# string tolower
#
# strupr <string>
# string toupper
#
# strcmp <string1> <string2>
# string compare
#
# stricmp <string1> <string2>
# string compare (case insensitive)
#
# strlen <string>
# string length
#
# stridx <string> <index>
# string index
#
# iscommand <command>
# if the given command exists, return 1
# else return 0
#
# timerexists <command>
# if the given command is scheduled by a timer, return its timer id
# else return empty string
#
# utimerexists <command>
# if the given command is scheduled by a utimer, return its utimer id
# else return empty string
#
# inchain <bot>
# if the given bot is connected to the botnet, return 1
# else return 0
# (for compat only, same as 'islinked')
#
# randstring <length>
# returns a random string of the given length
#
# putdccall <text>
# send the given text to all dcc users
#
# putdccbut <idx> <text>
# send the given text to all dcc users except for the given idx
#
# killdccall
# kill all dcc user connections
#
# killdccbut <idx>
# kill all dcc user connections except for the given idx
#
#
##
## (moretools):
##
#
# iso <nick> <channel>
# if the given nick has +o access on the given channel, return 1
# else return 0
#
# realtime [format]
# 'time' returns the current time in 24 hour format '14:15'
# 'date' returns the current date in the format '21 Dec 1994'
# not specifying any format will return the current time in
# 12 hour format '1:15 am'
#
# testip <ip>
# if the given ip is valid, return 1
# else return 0
#
# number_to_number <number>
# if the given number is between 1 and 15, return its text representation
# else return the number given
#
#
##
## (other commands):
##
#
# isnumber <string>
# if the given string is a valid number, return 1
# else return 0
#
# ispermowner <handle>
# if the given handle is a permanent owner, return 1
# else return 0
#
# matchbotattr <bot> <flags>
# if the given bot has all the given flags, return 1
# else return 0
#
# matchbotattrany <bot> <flags>
# if the given bot has any the given flags, return 1
# else return 0
#
# ordnumber <string>
# if the given string is a number, returns the
# "ordinal" version of that number, i.e. 1 -> "1st",
# 2 -> "2nd", 3 -> "3rd", 4 -> "4th", etc.
# else return <string>
#
########################################

# So scripts can see if allt is loaded.
set alltools_loaded 1
set allt_version 206

# For backward compatibility.
set toolbox_revision 1007
set toolbox_loaded 1
set toolkit_loaded 1

#
# toolbox:
#

proc putmsg {dest text} {
puthelp "PRIVMSG $dest :$text"
}

proc putchan {dest text} {
puthelp "PRIVMSG $dest :$text"
}

proc putnotc {dest text} {
puthelp "NOTICE $dest :$text"
}

proc putact {dest text} {
puthelp "PRIVMSG $dest :\001ACTION $text\001"
}

#
# toolkit:
#

proc strlwr {string} {
string tolower $string
}

proc strupr {string} {
string toupper $string
}

proc strcmp {string1 string2} {
string compare $string1 $string2
}

proc stricmp {string1 string2} {
string compare [string tolower $string1] [string tolower $string2]
}

proc strlen {string} {
string length $string
}

proc stridx {string index} {
string index $string $index
}

proc iscommand {command} {
if {[string compare "" [info commands $command]]} then {
return 1
}
return 0
}

proc timerexists {command} {
foreach i [timers] {
if {![string compare $command [lindex $i 1]]} then {
return [lindex $i 2]
}
}
return
}

proc utimerexists {command} {
foreach i [utimers] {
if {![string compare $command [lindex $i 1]]} then {
return [lindex $i 2]
}
}
return
}

proc inchain {bot} {
islinked $bot
}

proc randstring {length {chars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX YZ0123456789}} {
if {([string compare "" $length]) && \
(![regexp \[^0-9\] $length])} then {
set count [string length $chars]
if {$count} then {
for {set index 0} {$index < $length} {incr index} {
append result [string index $chars [rand $count]]
}
} else {
error "empty character string"
}
} else {
error "invalid random string length"
}
return $result
}

proc putdccall {text} {
foreach i [dcclist CHAT] {
putdcc [lindex $i 0] $text
}
}

proc putdccbut {idx text} {
foreach i [dcclist CHAT] {
set j [lindex $i 0]
if {$j != $idx} then {
putdcc $j $text
}
}
}

proc killdccall {} {
foreach i [dcclist CHAT] {
killdcc [lindex $i 0]
}
}

proc killdccbut {idx} {
foreach i [dcclist CHAT] {
set j [lindex $i 0]
if {$j != $idx} then {
killdcc $j
}
}
}

#
# moretools:
#

proc iso {nick chan} {
matchattr [nick2hand $nick $chan] o|o $chan
}

proc realtime {args} {
switch -exact -- [lindex $args 0] {
time {
return [strftime %H:%M]
}
date {
return [strftime "%d %b %Y"]
}
default {
return [strftime "%I:%M %P"]
}
}
}

proc testip {ip} {
set tmp [split $ip .]
if {[llength $tmp] != 4} then {
return 0
}
set index 0
foreach i $tmp {
if {(([regexp \[^0-9\] $i]) || ([string length $i] > 3) || \
(($index == 3) && (($i > 254) || ($i < 1))) || \
(($index <= 2) && (($i > 255) || ($i < 0))))} then {
return 0
}
incr index
}
return 1
}

proc number_to_number {number} {
switch -exact -- $number {
0 {
return Zero
}
1 {
return One
}
2 {
return Two
}
3 {
return Three
}
4 {
return Four
}
5 {
return Five
}
6 {
return Six
}
7 {
return Seven
}
8 {
return Eight
}
9 {
return Nine
}
10 {
return Ten
}
11 {
return Eleven
}
12 {
return Twelve
}
13 {
return Thirteen
}
14 {
return Fourteen
}
15 {
return Fifteen
}
default {
return $number
}
}
}

#
# other commands:
#

proc isnumber {string} {
if {([string compare "" $string]) && \
(![regexp \[^0-9\] $string])} then {
return 1
}
return 0
}

proc ispermowner {hand} {
global owner

if {([matchattr $hand n]) && \
([lsearch -exact [split [string tolower $owner] ", "] \
[string tolower $hand]] != -1)} then {
return 1
}
return 0
}

proc matchbotattr {bot flags} {
foreach flag [split $flags ""] {
if {[lsearch -exact [split [botattr $bot] ""] $flag] == -1} then {
return 0
}
}
return 1
}

proc matchbotattrany {bot flags} {
foreach flag [split $flags ""] {
if {[string first $flag [botattr $bot]] != -1} then {
return 1
}
}
return 0
}

proc ordnumber {string} {
if {[isnumber $string]} then {
set last [string index $string end]
if {[string index $string [expr [string length $string] - 2]] != 1} then {
if {$last == 1} then {
return ${string}st
} elseif {$last == 2} then {
return ${string}nd
} elseif {$last == 3} then {
return ${string}rd
}
}
return ${string}th
}
return $string
}
sizin yolladığınız tcl
Alıntı:

# txt dosyalarının bulunduğu klasor yolu"
set klasor "klasoryolu"

# Komutun kullanılacağı kanal
set kanal "#kanaladı"

bind pubm - "*%!oku*" okut

proc okut {n u h c a} {
set readnumber [string range $a 4 end]
if {[string is digit $readnumber] & [exec ls -1 $::klasor | wc -l] >= $readnumber & [string match -nocase $c $::kanal]} {
set txt [lsort [strlwr [glob $::klasor/*.txt]]]
set x 1
foreach yazdir $txt {
if { $x eq $readnumber} {
set dosya [open $yazdir r]
set oku [split [read $dosya] \n]
close $dosya
foreach dokuman $oku {
putquick "privmsg $c :$dokuman"
}
};incr x
}
} else { putquick "privmsg $c :Numara girmediniz veya yanlış numara girdiniz.."}
}
dosyayı söylediğiniz gibi düzenledim ancak komutu uyguladığımda her hangi bi cevap vermedi alltools.tcl y source ettim ve gösterdiğiniz iki yoluda denedim. ./eggdrop -nm dosya.conf dediğimde kanala geldi bot ve aşağıdaki komutlara daha önce cevap veren bot şimdi cevap dahi vermedi.


[22:02] <iBRaHiM> !okut
[22:02] <iBRaHiM> !oku
[22:02] hikayeci joined #eggdrop.
[22:02] <iBRaHiM> !oku1
[22:02] <iBRaHiM> !okut1


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

Powered by vBulletin® Version 3.8.8 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2024 IRCForumlari.Net