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.
Old posts that have not been replied to for several years.
ProXy
Op
Posts: 126 Joined: Sun Aug 11, 2002 3:09 pm
Post
by ProXy » Mon Sep 09, 2002 12:21 pm
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...
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Mon Sep 09, 2002 1:42 pm
The problem is [lindex $arg 0]. Change it to [lindex [split $arg] 0]. You should not use list operations on strings.
ProXy
Op
Posts: 126 Joined: Sun Aug 11, 2002 3:09 pm
Post
by ProXy » Mon Sep 09, 2002 10:44 pm
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"
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Mon Sep 09, 2002 11:02 pm
Try lsearch -exact
ProXy
Op
Posts: 126 Joined: Sun Aug 11, 2002 3:09 pm
Post
by ProXy » Tue Sep 10, 2002 6:48 am
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!
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Tue Sep 10, 2002 1:24 pm
Because your timer is all wrong. Quite a few problems in this script lol.
To set a timer, use this syntax: utimer 2
ProXy
Op
Posts: 126 Joined: Sun Aug 11, 2002 3:09 pm
Post
by ProXy » Tue Sep 10, 2002 3:30 pm
Uh, sorry but i don`t get want u wanted to say
Can you give me an example?
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Tue Sep 10, 2002 3:53 pm
using your script
Code: Select all
utimer 2 [list putkick $channel [lindex [split $arg] 0] "banned for $bantime minutes"]
ProXy
Op
Posts: 126 Joined: Sun Aug 11, 2002 3:09 pm
Post
by ProXy » Tue Sep 10, 2002 4:43 pm
Okay Thanks a lot. I got it now