SpiKe^^ wrote:Understood that the whole time.....
Your if statements are tied to your mysql database!
You are either using the wrong sql commands, or may be it's as easy as just typing the nick in the Exact same Case as it is in the sql database.
I'm betting it's just the search is Cese Sensitive, but as I said, I know nothing about mysql or the tcl code needed to work it. I'm just basing that on the fact you can remove yourself when you don't have to type the nick, and it's provided to the script as $nick as one of the procs arguments:)
Either way, I'm Done With This String, GoodLuck.
okay it's not because of mysql
I have tested it again properly!
how it works:
[Sat, 22/Dec/2012] (03:36:13) (test) !test reg
[Sat, 22/Dec/2012] (03:36:13) (@EggDrop) [Test_Tcl] okay
[Sat, 22/Dec/2012] (03:36:16) (Diamond85) !test reg
[Sat, 22/Dec/2012] (03:36:17) (@EggDrop) [Test_Tcl] okay
[Sat, 22/Dec/2012] (03:36:31) (Diamond85) !del
[Sat, 22/Dec/2012] (03:36:31) (@EggDrop) I deleted you from the list
[Sat, 22/Dec/2012] (03:36:33) (Diamond85) !del
[Sat, 22/Dec/2012] (03:36:33) (@EggDrop) you're not in my list
[Sat, 22/Dec/2012] (03:36:50) (Diamond85) !del test
[Sat, 22/Dec/2012] (03:36:50) (@EggDrop) Diamond85 I deleted test from the list
[Sat, 22/Dec/2012] (03:36:55) (Diamond85) !del test
[Sat, 22/Dec/2012] (03:36:55) (@EggDrop) Diamond85 test is not in my list
[Sat, 22/Dec/2012] (03:38:23) (test) !del
[Sat, 22/Dec/2012] (03:38:23) (@EggDrop) I deleted you from the list
[Sat, 22/Dec/2012] (03:38:54) (test) !del
[Sat, 22/Dec/2012] (03:38:54) (@EggDrop) you're not in my list
It is because:
Code: Select all
set arg [split $arg]
switch -exact -- [lindex $arg 0] {
default {
Code: Select all
if {[channel get $chan $T_T::S_I::si_name]} {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {$arg == ""} {
Code: Select all
namespace eval S_A {
#############################################################################
# Start_Action #
#############################################################################
proc sa_action {nick host hand chan arg} {
set arg [split $arg]
switch -exact -- [lindex $arg 0] {
default {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {![channel get $chan $T_T::S_I::si_name]} {
putnow "PRIVMSG $chan :\003\[\00304$T_T::S_I::si_name\003\] \00314ist \00304Deaktiviert\003! \00314Benutze Bitte \003$T_T::G_S::gs_char\00309$T_T::G_S::gs_bind \003(\00307On\003)"
}
}
if {[channel get $chan $T_T::S_I::si_name]} {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {$arg == ""} {
if {[T_T::M_A::ma_query "SELECT Count FROM $T_T::M_S::ms_table WHERE Nick = '[mysqlescape $nick]'"] == ""} {
putnow "PRIVMSG $chan :you're not in my list"
} else {
T_T::M_A::ma_query "DELETE FROM `$T_T::M_S::ms_table` WHERE `Nick` = '[mysqlescape $nick]';"
putnow "PRIVMSG $chan : I deleted you from the list"
}
} else {
if {[T_T::M_A::ma_query "SELECT Count FROM $T_T::M_S::ms_table WHERE Nick = '[mysqlescape $arg]'"] == ""} {
putnow "PRIVMSG $chan :$nick $arg is not in my list"
} else {
T_T::M_A::ma_query "DELETE FROM `$T_T::M_S::ms_table` WHERE `Nick` = '[mysqlescape $arg]';"
putnow "PRIVMSG $chan :$nick I deleted $arg from the list"
}
}
} else {
if {[T_T::M_A::ma_query "SELECT Count FROM $T_T::M_S::ms_table WHERE Nick = '[mysqlescape $nick]'"] == ""} {
putnow "PRIVMSG $chan :you're not in my list "
} else {
T_T::M_A::ma_query "DELETE FROM `$T_T::M_S::ms_table` WHERE `Nick` = '[mysqlescape $nick]';"
putnow "PRIVMSG $chan : I deleted you from the list"
}
}
}
}
}
}
}
it does not work.
[Sat, 22/Dec/2012] (03:40:23) (Diamond85) !test reg
[Sat, 22/Dec/2012] (03:40:24) (@EggDrop) [Test_Tcl] okay
[Sat, 22/Dec/2012] (03:40:28) (test) !test reg
[Sat, 22/Dec/2012] (03:40:28) (@EggDrop) [Test_Tcl] okay
[Sat, 22/Dec/2012] (03:40:33) (Diamond85) !del
[Sat, 22/Dec/2012] (03:40:45) (Diamond85) !del del
[Sat, 22/Dec/2012] (03:40:45) (@EggDrop) Diamond85 del is not in my list
[Sat, 22/Dec/2012] (03:41:02) (Diamond85) !del del test
[Sat, 22/Dec/2012] (03:41:02) (@EggDrop) Diamond85 del test is not in my list
it does not work because:
Code: Select all
set arg [split $arg]
switch -exact -- [lindex $arg 0] {
"del" {
Code: Select all
if {[channel get $chan $T_T::S_I::si_name]} {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {$arg == ""} {
Code: Select all
namespace eval S_A {
#############################################################################
# Start_Action #
#############################################################################
proc sa_action {nick host hand chan arg} {
set arg [split $arg]
switch -exact -- [lindex $arg 0] {
"del" {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {![channel get $chan $T_T::S_I::si_name]} {
putnow "PRIVMSG $chan :\003\[\00304$T_T::S_I::si_name\003\] \00314ist \00304Deaktiviert\003! \00314Benutze Bitte \003$T_T::G_S::gs_char\00309$T_T::G_S::gs_bind \003(\00307On\003)"
}
}
if {[channel get $chan $T_T::S_I::si_name]} {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {$arg == ""} {
if {[T_T::M_A::ma_query "SELECT Count FROM $T_T::M_S::ms_table WHERE Nick = '[mysqlescape $nick]'"] == ""} {
putnow "PRIVMSG $chan :you're not in my list"
} else {
T_T::M_A::ma_query "DELETE FROM `$T_T::M_S::ms_table` WHERE `Nick` = '[mysqlescape $nick]';"
putnow "PRIVMSG $chan : I deleted you from the list"
}
} else {
if {[T_T::M_A::ma_query "SELECT Count FROM $T_T::M_S::ms_table WHERE Nick = '[mysqlescape $arg]'"] == ""} {
putnow "PRIVMSG $chan :$nick $arg is not in my list"
} else {
T_T::M_A::ma_query "DELETE FROM `$T_T::M_S::ms_table` WHERE `Nick` = '[mysqlescape $arg]';"
putnow "PRIVMSG $chan :$nick I deleted $arg from the list"
}
}
} else {
if {[T_T::M_A::ma_query "SELECT Count FROM $T_T::M_S::ms_table WHERE Nick = '[mysqlescape $nick]'"] == ""} {
putnow "PRIVMSG $chan :you're not in my list "
} else {
T_T::M_A::ma_query "DELETE FROM `$T_T::M_S::ms_table` WHERE `Nick` = '[mysqlescape $nick]';"
putnow "PRIVMSG $chan : I deleted you from the list"
}
}
}
}
default {
if {[matchattr $hand $T_T::G_S::gs_flags]} {
if {![channel get $chan $T_T::S_I::si_name]} {
putnow "PRIVMSG $chan :\003\[\00304$T_T::S_I::si_name\003\] \00314ist \00304Deaktiviert\003! \00314Benutze Bitte \003$T_T::G_S::gs_char\00309$T_T::G_S::gs_bind \003(\00307On\003)"
}
}
}
}
}
}