| View previous topic :: View next topic |
| Author |
Message |
chadrt Voice
Joined: 19 Mar 2006 Posts: 33
|
Posted: Fri Jan 26, 2007 10:26 pm Post subject: Adding auto identify to existing autoop.tcl script! (Solved) |
|
|
This is my first time doing anything with TCL I have been reading and I thought I would do something simple so I am modifying someone else's script to add a function to the main script.
Below is my code then I will post my problem and hopefully someone can help. (This is only a partial I am leaving out the credits and other junk so I dont fill the page.)
| Code: | set idnick "NickServ"
set idpass "NickServPasswordHere"
set servicenick "ChanServ"
set punish "3"
set deopkickreason "12{Anti Deop Protection} 5Kindly Dont Deop Me Next Time"
bind mode - "*-*o*" RanaUsman:autoreop
proc RanaUsman:autoreop {nick uhost hand chan mode target} {
global botnick servicenick punish deopkickreason
if {($target == $botnick) && ($nick != $botnick)} {
if {($nick == "X") || ($nick == "Q") || ($nick == "L") || ($nick == "chanserv")} { return 0 }
putlog "\002BOT DEOPED ON $chan by $nick"
putlog "\002REOPING BOT ON $chan"
putserv "PRIVMSG $servicenick :op $chan $botnick"
putlog "\002REOP SUCCESSFULL"
utimer 2 [list RanaUsman:punish $nick $uhost $chan]
}
}
proc RanaUsman:punish {nick uhost chan} {
global punish deopkickreason
if {($punish == 0)} { return 0 }
if {($punish == 1)} {
if {($nick == "X") || ($nick == "Q") || ($nick == "L") || ($nick == "chanserv")} { return 0 }
putquick "KICK $chan $nick :$deopkickreason"
putlog "\002$nick Kicked from $chan for Deoping me on $chan "
}
if {($punish == 2)} {
if {($nick == "X") || ($nick == "Q") || ($nick == "L") || ($nick == "chanserv")} { return 0 }
putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
putquick "KICK $chan $nick :$deopkickreason"
putlog "\002 $nick BAN N KICKED FROM $chan FOR DEOPING ME ON $chan"
}
if {($punish == 3)} {
putquick "MODE $chan -o $nick"
putlog "\002$nick DEOPED FOR DEOPING ME ON $chan"
}
}
proc evnt:init-server {type} {
global idnick idpass
putquick "PRIVMSG $idnick :IDENTIFY $idpass"
}
putlog "=- \002DEOP PROTECTION BY RANA USMAN (www.ranausman.tk) LOADED SUCCESSFULLY \002 -="
|
(Edit: I have changed my code to the above and hopefully it is a little closer to what should be! But now the script loads but wont perform the function required of it.)
My addition to the base code is:
| Code: | proc evnt:init-server {type} {
global idnick idpass
putquick "PRIVMSG $idnick :IDENTIFY $idpass"
} |
I also added the two set's idnick and idpass hoping to make it so that you can set those variables from the top in configuration.
I am so new to this code stuff that I am hoping that I even have the brackets in the right place Thank you and please dont flame me here I have racked my brain for hours on this one, and I am just hoping to take some knowledge away from this experience. Thanks again...[/quote] |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jan 27, 2007 8:31 am Post subject: |
|
|
You didn't say what the problem actually is; is your bot not identifying or what? _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
chadrt Voice
Joined: 19 Mar 2006 Posts: 33
|
Posted: Sun Jan 28, 2007 11:31 am Post subject: |
|
|
| No it would not identify and it would shoot errors like cannot read $variable and the like. I got frustrated enough to leave it alone for awhile and use a different method. I still need to get the script working though, if you can help that would be great! Thanks a bunch... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Jan 28, 2007 11:33 am Post subject: |
|
|
Why not just use a different Tcl, there are a lot of Tcl scripts that auto identify your bot and more. I can suggest Chanservneed.tcl by De Kus. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|