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.

Op with password script not working

Old posts that have not been replied to for several years.
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

those are chars in Hebrew, my clients use a web client that transforms nicks into hebrew nicks, so it turns like that.
the first word of the PM is the real nickname,
hope you understood.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

But as you can see, there's no space between the "real" nick name and the word "test": (ßΘ:átest. So how is the script supposed to tell between the nickname and the password? Does it always end in á or something?

The confusing thing is that you've shown several different ways, and they seem to be totally random. First you had:

[19:48] [EB!eternal-bl@7029B6E.EA98ECBE.69A161A6.IP] test

which is normal. Then you had:

[15:57] [^`bj!my@7029B6E.EA98ECBE.69A161A6.IP] בי: test

which makes a bit of sense -- the hebrew "real" nick is the first word, and then there's a space, then the word "test".

Now the last one is:

[21:37] [^`bj!my@7029B6E.EA98ECBE.69A161A6.IP] ßΘ:átest

which has no space at all. What is it *supposed* to be like?
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

[15:57] [^`bj!my@7029B6E.EA98ECBE.69A161A6.IP] בי: test
I took this from the log.
[21:37] [^`bj!my@7029B6E.EA98ECBE.69A161A6.IP] ßΘ:átest
I took this from the console.
I bet that if I will go into the logs it will have a space.
Question is, if there is a way that the eggy will search the PM for the word test, doesn't matter if it's like 'blhasudhastest' or just 'test'.
if the word is there, op him.
that way it doesn't matter if there is a space or not.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

place test between two *
for example : set password "*test*"
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

[16:33] -Error- user: ^`bj typed WRONG password (ßΘ:átest)
[16:33] [^`bj!my@7029B6E.EA98ECBE.69A161A6.IP] ßΘ:átest
same ;/
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Change if {$first == $password} to if {[string match $password $first} (still putting the * * there)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Actually, change it to if {[string match $password $text]} instead.
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

[19:17] [^`bj!my@7029B6E.EA98ECBE.69A161A6.IP] ßΘ:átest
nothing more, aint getting a bad password in the console.
This is the changed code:

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 {[string match $password $text]}  {
                         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)"
                                                         }
                                                         }
all good?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

This line is causing the problem:

if {![string match -nocase $nick "$users*"]} {return 0}

Try this instead:

if {[lsearch -exact $users [string tolower $nick]] == -1} {
putlog "User $nick not found in $users"
return 0
}

Make sure your $users variable is all lowercase where you set it.
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

weeeeeeeeeeee!
it works.
thank you SO MUCH, i owe you big time!.
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

Found another problem :(
If I want to put multiple chans(meaning, i put the script in 4 files, each file has diff users and chan).
It just gives an error about premsg...
Is there a way to fix it?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

change the procname and variables used.
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

Code: Select all

set passwords "*test*"
set userss "^`bhfye\amsqjp ^`aqj-fma-ahy{ ^`bj"
set chans "#^`zmfzjn\aumfr"

bind msgm - * premsgs

proc premsgs {nick host hand text} {
  global passwords userss chans

        set first [lindex $text 0]
                      if {[string match $passwords $text]}  {
                   if {[lsearch -exact $userss [string tolower $nick]] == -1} {
                putlog "User $nick not found in $userss"
                                 return 0
                          }
                               putlog "-V- User $nick is being opped @ $chans"
                                    putserv "mode $chans +o $nick"
                                             putserv "NOTICE $nick :You're now opped on $chans!"
                                                      } else {
                                                   putlog "-Error- user: $nick typed WRONG password ($first)"
                                                }
                                 }
is this ok?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try it
E
Eternal Bliss
Voice
Posts: 20
Joined: Wed Jun 18, 2003 12:01 pm

Post by Eternal Bliss »

Tells me that it ops me, and a line after that there is a wrong password.
but no op is given ;/
Locked