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.

Chatspace Identifier {Help Me}

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

*bump*?
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

It's not that long, but can be tweaked a little bit.

Code: Select all

set password ""

bind raw - NOTICE notice_bnc

proc notice_bnc {from keyword arg} {
 global password
 if {[lindex [split [set arg [string tolower $arg]]] 0] == "auth" ||
[string tolower $from] == "my.server.here"} {
  set bnc_notice [join [lrange [split $arg] 1 end]]
  if {[string match "*type /pass password*" $bnc_notice]} {
    putserv "PASS $password"
  }
 }
}
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

thanks :)

i was hoping to use the raw for this though.
now, im a 100% newb at tcl, and haven't even tried to code with it before now.
but i made a naive attempt
i dont have the ability to test it atm though
think this will work?

Code: Select all

set nickpass "password"

bind raw - 512 identify:nick

proc identify:nick {from key arg} {
 putserv "PASS $nickpass"
}
i dont want to take any other factors into account, not nickname, server, etc
just in all cases, when the bot gets raw 512, do /pass password
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I don't see why it shouldn't work, gets raw 512 and identifies. You can do some tests by adding a line:

Code: Select all

putlog "$from :: $key :: $arg"
to know what id being sent and match upon that (if you want to take anything into consideration).
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

ok i tested that, it actually sent the nickpass, but i got an error with it

Code: Select all

[13:57] chat.wiredreality.net :: 512 :: ChatBot :Authorization required to use Registered Nickname ChatBot
[13:57] Tcl error [identify:nick]: can't read "nickpass": no such variable

set errorInfo
Currently: can't read "nickpass": no such variable
Currently: while executing
Currently: "putserv "PASS $nickpass""
Currently: (procedure "identify:nick" line 2)
Currently: invoked from within
Currently: "identify:nick $_raw1 $_raw2 $_raw3"
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

That because nickpass is not global in the proc. Either add

Code: Select all

global nickpass
in the proc or use $::nickpass instead of $nickpass.
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

thanks :D
works perfect
Post Reply