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.

Adding auto identify to existing autoop.tcl script! (Solved)

Help for those learning Tcl or writing their own scripts.
Post Reply
c
chadrt
Voice
Posts: 33
Joined: Sun Mar 19, 2006 4:37 pm

Adding auto identify to existing autoop.tcl script! (Solved)

Post by chadrt »

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: Select all

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: Select all

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]
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You didn't say what the problem actually is; is your bot not identifying or what?
c
chadrt
Voice
Posts: 33
Joined: Sun Mar 19, 2006 4:37 pm

Post by chadrt »

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...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
Post Reply