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.

Probs with "Non standard Nicks"

Old posts that have not been replied to for several years.
Locked
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Probs with "Non standard Nicks"

Post by ProXy »

Hi,

I wrote a script that provides all user to kick another user. This script is started by !lamer <nick> [time]"! When i enter a nick without "[" or "]" then all works fine. But today i wanted to kick a user called [censored]. My script checks if the user is in the channel, and if he is, then is will kick him. The user [censored] wasn`t found in my channel...but he was there!

I use this source to check if a user is in the channel:

Code: Select all

{[lsearch [string tolower [chanlist $channel]] [string tolower [lindex $arg 0]]]==-1} {
putserv "PRIVMSG $channel :Error: \"[lindex $arg 0]\" ist nicht in diesem Channel! $usage"
}
I tried to enter the nick \[censored\] but that also didn`t work...
Could anyone please help me...
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

The problem is [lindex $arg 0]. Change it to [lindex [split $arg] 0]. You should not use list operations on strings.
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Post by ProXy »

i just changed this in the whole script not only in that line - the same problem again!

Code: Select all

	} elseif {[lsearch [string tolower [chanlist $channel]] [string tolower [lindex [split $arg] 0]]]==-1} {
		putserv "PRIVMSG $channel :Error: \"[lindex [split $arg] 0]\" ist nicht in diesem Channel! $usage"
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Try lsearch -exact
P
ProXy
Op
Posts: 126
Joined: Sun Aug 11, 2002 3:09 pm

Post by ProXy »

Now the script is able to find [pat] in the room and bans him. But is doesn`t kick him:
[12:41:06] <(Hack|The|Planet> [12:45] Tcl error in script for 'timer298':
[12:41:06] <(Hack|The|Planet> [12:45] invalid command name "pat"
The user I wanted to kick was named [pat]...

Code: Select all

putserv "MODE $channel +b [lindex [split $arg] 0]!$host"
		utimer 2 "putkick $channel [lindex [split $arg] 0] \"banned for $bantime minutes\"" 
		timer $bantime "putserv \"MODE $channel -b [lindex [split $arg] 0]!$host\""
#


So the ban is working, but there is no kick!
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Because your timer is all wrong. Quite a few problems in this script lol.

To set a timer, use this syntax: utimer 2
    P
    ProXy
    Op
    Posts: 126
    Joined: Sun Aug 11, 2002 3:09 pm

    Post by ProXy »

    Uh, sorry but i don`t get want u wanted to say :(

    Can you give me an example?
    p
    ppslim
    Revered One
    Posts: 3914
    Joined: Sun Sep 23, 2001 8:00 pm
    Location: Liverpool, England

    Post by ppslim »

    using your script

    Code: Select all

    utimer 2 [list putkick $channel [lindex [split $arg] 0] "banned for $bantime minutes"]
    
    P
    ProXy
    Op
    Posts: 126
    Joined: Sun Aug 11, 2002 3:09 pm

    Post by ProXy »

    Okay Thanks a lot. I got it now :)
    Locked