| View previous topic :: View next topic |
| Author |
Message |
adamSs Voice
Joined: 01 Feb 2013 Posts: 2
|
Posted: Fri Feb 01, 2013 1:32 am Post subject: Short Script Not sure what is wrong. |
|
|
Is there anything blatantly wrong with this? This is the entire script. It is supposed to op me when I join my channel. I'm just getting my feet wet with bot scripting. Thanks in advance!
-Adam
| Code: |
putlog "Op loaded"
bind join o adamSs@hellagood.org join:me
proc join:me { chan nick } {
if { [isop $chan $botnick] == 1 } { pushmode $chan +o $nick }
}
|
|
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Feb 01, 2013 2:05 am Post subject: |
|
|
Not sure how good an idea this script is, but...
The bind mask for join is matched against "#channel nick!user@host"
So we'll assume your username is: adamSs
The proc associated with a bind trigger, takes 4 arguments, like...
procname <nick> <user@host> <handle> <channel>
$botnick is a global variable that would require either a global tag
or using like $::botnick for it to be used in a proc.
Correct format for the isop command is: isop <nickname> [channel]
but i wouldn't use that command at all, and would use: botisop [channel]
and we won't need the global botnick line at all:)
Other than that, it's perfect.
Why not just add yourself to the bot's user file with +ao if that's all you want to do?
For security reasons, neither of these plans is really a good idea,
but this script may do what you want, if you have a global +o flag in the bot's user file.
| Code: | putlog "Op loaded"
bind join o "*!adamSs@hellagood.org" join:me
proc join:me {nick uh hand chan} {
if {[botisop $chan]} { pushmode $chan +o $nick }
} |
Note: If adamSs is your nick, and not your username, change that bind mask to something more like: "* adamSs!*@hellagood.org" _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Last edited by SpiKe^^ on Fri Feb 01, 2013 2:09 am; edited 1 time in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Feb 01, 2013 2:09 am Post subject: |
|
|
According to TCL manual:
| Quote: |
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>
Description: triggered by someone joining the channel. The mask in
the bind is matched against "#channel nick!user@host" and can contain wildcards.
Module: irc
|
so..
| Code: |
bind join o "% *!adamSs@hellagood.org" join:me
proc join:me {nick uhost hand chan} {
if {[botisop $chan]} {
pushmode $chan +o $nick
}
}
|
adjust the hostmask if needed. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
|
| Back to top |
|
 |
adamSs Voice
Joined: 01 Feb 2013 Posts: 2
|
Posted: Fri Feb 01, 2013 2:44 pm Post subject: |
|
|
Thanks a lot for all of the replies! Also, Thanks for the documentation links! I appreciate it folks.
-Adam |
|
| Back to top |
|
 |
|