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.
Eternal Bliss
Voice
Posts: 20 Joined: Wed Jun 18, 2003 12:01 pm
Post
by Eternal Bliss » Tue Jul 15, 2003 1:37 am
I tried making a script that will give op to a user when he pm's the egg with a password... and it keeps giving him bad password.
the nick always starts with '^`' and the channel is always with '^`' in the start.
this is the code i wrote, what seems to be wrong?
I don't mind NOT having the nick auth checking, as long as the password will work.
Code: Select all
set password "test"
set users "^`"
set chan "#^`lqjre"
bind msgm - * premsg
proc premsg {nick host hand text} {
global password users chan
set first [lindex $text 0]
set second [lindex $text 1]
if {$password == "$second"} {
if {![string match -nocase "*$first*" $users]} { return 0 } else {
putlog "-V- User $nick is being opped @ $chan"
putserv "mode $chan +o $nick"
putserv "NOTICE $nick :You're now opped on $chan!"
}
} else {
putlog "-Error- user: $nick typed WRONG password ($second)"
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Wed Jul 16, 2003 6:26 am
close the brace } at the end of the code.
Eternal Bliss
Voice
Posts: 20 Joined: Wed Jun 18, 2003 12:01 pm
Post
by Eternal Bliss » Thu Jul 17, 2003 1:58 am
Sorry, forgot to paste that
Code: Select all
set password "test"
set users "^`"
set chan "#^`lqjre"
bind msgm - * premsg
proc premsg {nick host hand text} {
global password users chan
set first [lindex $text 0]
set second [lindex $text 1]
if {$password == "$second"} {
if {![string match -nocase "*$first*" $users]} { return 0 } else {
putlog "-V- User $nick is being opped @ $chan"
putserv "mode $chan +o $nick"
putserv "NOTICE $nick :You're now opped on $chan!"
}
} else {
putlog "-Error- user: $nick typed WRONG password ($second)"
}
}
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Thu Jul 17, 2003 8:36 am
try this:
Code: Select all
set password "test"
set users "^`"
set chan "#^`lqjre"
bind msgm - * premsg
proc premsg {nick host hand text} {
global password users chan
set first [lindex $text 0]
set second [lindex $text 1]
if {$second == $password} {
if {![string match -nocase "*$first*" $users]} { return 0 }
putlog "-V- User $nick is being opped @ $chan"
putserv "mode $chan +o $nick"
putserv "NOTICE $nick :You're now opped on $chan!"
}
else {
putlog "-Error- user: $nick typed WRONG password ($second)"
}
}
Eternal Bliss
Voice
Posts: 20 Joined: Wed Jun 18, 2003 12:01 pm
Post
by Eternal Bliss » Thu Jul 17, 2003 11:05 am
[18:04] Tcl error [premsg]: invalid command name "else"
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Jul 17, 2003 11:13 am
Instead of this:
make it:
Once the game is over, the king and the pawn go back in the same box.
Eternal Bliss
Voice
Posts: 20 Joined: Wed Jun 18, 2003 12:01 pm
Post
by Eternal Bliss » Thu Jul 17, 2003 12:48 pm
that is my problem ;/
i changed the vars to this:
Code: Select all
set password "test"
set users "EB"
set chan "#^`lqjre"
spock
Master
Posts: 319 Joined: Thu Dec 12, 2002 8:40 pm
Post
by spock » Thu Jul 17, 2003 1:13 pm
you are only msg'ing the bot "test".
try "EB test"
also, you should split text to prevent lindex confusion
photon?
Eternal Bliss
Voice
Posts: 20 Joined: Wed Jun 18, 2003 12:01 pm
Post
by Eternal Bliss » Fri Jul 18, 2003 12:03 pm
Another problem
those are the vars set:
Code: Select all
set password "test"
set users "^`bj"
set chan "#^`lqjre"
How can i change the code so it will check the nickname and not the first letter?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Jul 18, 2003 1:52 pm
try this:
Code: Select all
set password "test"
set users "^`bj"
set chan "#^`lqjre"
bind msgm - * premsg
proc premsg {nick host hand text} {
global password users chan
set first [lindex $text 0]
if {$first == $password} {
if {![string match -nocase $nick "$users*"]} {return 0}
putlog "-V- User $nick is being opped @ $chan"
putserv "mode $chan +o $nick"
putserv "NOTICE $nick :You're now opped on $chan!"
} else {
putlog "-Error- user: $nick typed WRONG password ($first)"
}
}
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Jul 18, 2003 4:50 pm
beats me
Eternal Bliss
Voice
Posts: 20 Joined: Wed Jun 18, 2003 12:01 pm
Post
by Eternal Bliss » Fri Jul 18, 2003 5:00 pm
Umm, maybe if the bot will check if the password is found in the PM then op him?
this way he will ignore anything else...
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Fri Jul 18, 2003 5:35 pm
Where are those extra chars coming from? ßΘ Obviously those are screwing up the password check heh. Do you have some script that adds goofy chars like that when you type something?