Code: Select all
set prtt [ ini_read nfo.ini $hand foba ]
Code: Select all
set prtt { ini_read nfo.ini $hand foba }
What do he want to do? -> I want to set the value of foba (from nfo.ini) into the var "prtt" but it doesnt work :(
Code: Select all
set prtt [ ini_read nfo.ini $hand foba ]
Code: Select all
set prtt { ini_read nfo.ini $hand foba }
Code: Select all
set prtt [ini_read nfo.ini $hand foba]
Code: Select all
bind pubm - ti.test* ini_las
proc ini_las {nick uhost hand chan arg} {
set prtt [ini_read nfo.ini $hand foba]
puthelp "privmsg $chan :nfo is $prtt"
}
INI files are formatted likeitem1=value1
item2=value2
You are passing the value of the $hand variable as the topic (I presume, i have not looked at the ini parser yet). Are you sure this is what you should be passing.[topic1]
item1=value1
item2=value2
[topic2]
item1=value1
item2=value2
Code: Select all
bind pubm - ti.test* ini_las
proc ini_las {nick uhost hand chan arg} {
set prtt [ini_read nfo.ini $hand foba]
puthelp "privmsg $chan :nfo is $prtt"
}
Code: Select all
bind dcc z nfo dcc:nfo
proc dcc:nfo {hand text} {
putlog "stage - done"
}
But I need handle and text... Why do I get this error?Tcl error [dcc:nfo]: called "dcc:nfo" with too many arguments
Code: Select all
bind dcc z ftp dcc:ftp
proc dcc:ftp {handle idx text} {
putlog "stage 0 - done"
if {[string tolower [lindex $text 1]] == "update"} {
putlog "stage 1 - done"
if {[string tolower [lindex $text 2]] == ""}
putlog "stage 2 - done"
puthelp "putdcc $idx Usage of update => .ftp update <ip/user/pass/port>"
} elseif {[string tolower [lindex $text 2]] == ""} {
putlog "stage 3 - done"
if {[string tolower [lindex $text 3]] == ""} {
putlog "stage 4 - done"
puthelp "putdcc $idx Usage of update ip => .ftp update ip <the.new.ip>"
} elseif {[string tolower [lindex $text 3]] == "ip"} {
putlog "stage 5 - done"
ini_write ftpnfo.ini $hand ip [string tolower [lindex $text 3]]
} elseif {[string tolower [lindex $text 2]] == "user"} {
putlog "stage 6 - done"
ini_write ftpnfo.ini $hand user [string tolower [lindex $text 3]]
} elseif {[string tolower [lindex $text 2]] == "pass"} {
putlog "stage 7 - done"
ini_write ftpnfo.ini $hand pass [string tolower [lindex $text 3]]
} elseif {[string tolower [lindex $text 2]] == "port"} {
putlog "stage 8 - done"
ini_write ftpnfo.ini $hand port [string tolower [lindex $text 3]]
}
putlog "stage 9 - done"
}
putlog "stage 10 - done"
}
So I really cant find out whats wrong...[14:38] Tcl error [dcc:ftp]: wrong # args: no script following "{[string tolower [li" argument
Code: Select all
bind dcc z ftp dcc:ftp
proc dcc:ftp {handle idx text} {
putlog "stage 0 - done"
if {[string tolower [lindex $text 1]] == "update"} {
putlog "stage 1 - done"
if {[string tolower [lindex $text 2]] == ""}
putlog "stage 2 - done"
puthelp "putdcc $idx Usage of update => .ftp update <ip/user/pass/port>"
} elseif {[string tolower [lindex $text 2]] == ""} {
putlog "stage 3 - done"
if {[string tolower [lindex $text 3]] == ""} {
putlog "stage 4 - done"
puthelp "putdcc $idx Usage of update ip => .ftp update ip <the.new.ip>"
} elseif {[string tolower [lindex $text 3]] == "ip"} {
putlog "stage 5 - done"
ini_write ftpnfo.ini $hand ip [string tolower [lindex $text 3]]
} elseif {[string tolower [lindex $text 2]] == "user"} {
putlog "stage 6 - done"
ini_write ftpnfo.ini $hand user [string tolower [lindex $text 3]]
} elseif {[string tolower [lindex $text 2]] == "pass"} {
putlog "stage 7 - done"
ini_write ftpnfo.ini $hand pass [string tolower [lindex $text 3]]
} elseif {[string tolower [lindex $text 2]] == "port"} {
putlog "stage 8 - done"
ini_write ftpnfo.ini $hand port [string tolower [lindex $text 3]]
}
putlog "stage 9 - done"
}
putlog "stage 10 - done"
}
Code: Select all
if {[string tolower [lindex $text 2]] == ""}
Code: Select all
bind dcc z ftp dcc:ftp
proc dcc:ftp {handle idx text} {
putlog "stage 0 - done"
if {[string tolower [lindex $text 1]] == ""} {
putlog "stage 2 - done"
puthelp "putdcc $idx Usage of ftp => ftp <ip/user/pass/port> <value>"
} elseif {[string tolower [lindex $text 1]] == "ip"} {
if {[string tolower {lindex $text 2]] == ""} {
puthelp "putdcc $idx Usage of .ftp => .ftp ip <the.new.ip>"
} else {
putlog "stage 5 - done"
ini_write ftpnfo.ini $hand ip [string tolower [lindex $text 3]]
}
} elseif {[string tolower [lindex $text 1]] == "user"} {
if {[string tolower {lindex $text 2]] == ""} {
puthelp "putdcc $idx Usage of .ftp => .ftp user <the.new.username>"
} else {
putlog "stage 6 - done"
ini_write ftpnfo.ini $hand user [string tolower [lindex $text 3]]
}
} elseif {[string tolower [lindex $text 1]] == "pass"} {
if {[string tolower [lindex $text 2]] == ""} {
puthelp "putdcc $idx Usage of .ftp => .ftp pass <the.new.password>"
} else {
putlog "stage 7 - done"
ini_write ftpnfo.ini $hand pass [string tolower [lindex $text 3]]
}
} elseif {[string tolower [lindex $text 1]] == "port"} {
if {[string tolower [lindex $text 2]] == ""} {
puthelp "putdcc $idx Usage of .ftp => .ftp port <the.new.portnumber>"
} else {
putlog "stage 8 - done"
ini_write ftpnfo.ini $hand port [string tolower [lindex $text 3]]
}
}
}
Thanx for help[16:04] missing close-brace
while executing
"proc dcc:ftp {handle idx text}"
(file "scripts/save.tcl" line 3)
invoked from within
"source scripts/save.tcl
"
Code: Select all
if {[string tolower {lindex $text 2]] == ""} {