This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
S0nnY
Voice
Posts: 8 Joined: Tue Sep 07, 2004 9:52 am
Location: Germany
Post
by S0nnY » Mon Dec 19, 2005 12:43 am
Hello,
I have a small problem. I want to create an "global ignore function" for a game script.
All my code works fine but i want to add hosts in the database containing a wildcard "*!*@Test*.org" for example.
But when the bots connects to the database an gets the informations the check the user host the * isn't a wildcard anymore also "test!
test@Test.users.quakenet.org " is not matched.
How can I convert the sign * back to a wildcard ?
greetz
S0nnY
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Dec 19, 2005 2:29 am
post code & log
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
S0nnY
Voice
Posts: 8 Joined: Tue Sep 07, 2004 9:52 am
Location: Germany
Post
by S0nnY » Mon Dec 19, 2005 3:05 am
Ok here is a split of the ignore check code
$host ==>
examp@example.users.quakenet.org
Code: Select all
set ign(hosts) "[hosts:get]" <== returns all added hosts in the database ("examp@*.org" "*@test.users.quakenet.org" for example)
foreach h0st $ign(hosts) {
if {[string match -nocase "$h0st" $host]} {
return 1
} else {
return 0
}
}
proc hosts:get { } {
global ign
set sqlhand [mysqlconnect -host $ign(ip) -user $ign(user) -password $ign(pass)]
mysqluse $sqlhand $ign(tab)
set return "[mysqlsel $sqlhand "SELECT host FROM $ign(ignoredb)" -list]"
mysqlclose $sqlhand
return $return
}
the * is not recognized as wildcard
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Mon Dec 19, 2005 3:58 am
so what's the problem, you don't get *'s back from db? what did you put there and what did you get back using [hosts:get]?
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use
S0nnY
Voice
Posts: 8 Joined: Tue Sep 07, 2004 9:52 am
Location: Germany
Post
by S0nnY » Mon Dec 19, 2005 5:07 am
"[hosts:get]" <== returns all added hosts in the database ("examp@*.org" "*@test.users.quakenet.org"
a * which is returned from the mysqdatabase is "marked" as "normal" sign and not as wildcard. this is my problem
greenbear
Owner
Posts: 733 Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway
Post
by greenbear » Mon Dec 19, 2005 12:50 pm
mysql use % as wildcard, not *
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Tue Dec 20, 2005 12:02 am
what do you care about mySQL's interpretation of *? you don't have WHERE clause anyway
if *'s come back to you as you saved them, I fail to see the problem here
connection, sharing, dcc problems? click
<here>
before asking for scripting help, read
<this>
use