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.

Need help with tcl to make bot reop himself (stuck)

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Need help with tcl to make bot reop himself (stuck)

Post by Gothic-Angel »

Code: Select all

set chan "#blah"

proc autoreop {nick uhost hand chan deop deopd} {
if {botisop $chan == 0}
putserv "ChanServ op $chan $botnick"
}
Ok, this loads into the bot without it dying, however the bot won't reop himself.

From my understanding of the tcl-commands.doc botisop chan if returns 0, meaning not opped he should have chanserv op him in $chan.

I used the line proc autoreop {nick uhost hand chan deop deopd} { from WCC's services tcl.

Im thinking maybe Im missing something like an "else" command so If botisop == 1 then else then have him op himself.

I'd use WCC's services but it floods chanserv if its lagged on dal.net causing the bot to op himself like 5096859685 times when they come around. I want him to do it just once, once I figure out the proc I can bind it to a time say every hour or so. Binding shouldn't be a problem Its just the making him reop himself.
User avatar
mcdarby
Halfop
Posts: 69
Joined: Tue Jul 16, 2002 7:46 pm
Location: Bangor, Pennsylvania
Contact:

Re: Need help with tcl to make bot reop himself (stuck)

Post by mcdarby »

Gothic-Angel wrote:

Code: Select all

set chan "#blah"

proc autoreop {nick uhost hand chan deop deopd} {
if {botisop $chan == 0}
putserv "ChanServ op $chan $botnick"
}
Ok, this loads into the bot without it dying, however the bot won't reop himself.

From my understanding of the tcl-commands.doc botisop chan if returns 0, meaning not opped he should have chanserv op him in $chan.

I used the line proc autoreop {nick uhost hand chan deop deopd} { from WCC's services tcl.

Im thinking maybe Im missing something like an "else" command so If botisop == 1 then else then have him op himself.

I'd use WCC's services but it floods chanserv if its lagged on dal.net causing the bot to op himself like 5096859685 times when they come around. I want him to do it just once, once I figure out the proc I can bind it to a time say every hour or so. Binding shouldn't be a problem Its just the making him reop himself.
Well, if this bot's nick is registered and identified properly with NickServ and that the bot is atleast on the AOP list of the ChanServ registered (+r) channel that it sits on, there is one way of resolving this. Delete the script and use the following command in "need-op"

.chanset #Chan need-op putserv "PRIVMSG ChanServ :OP #Chan"

Where #Chan is the name of the channel you have the bot sitting on.

HTH :)

--
Erik McDarby
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

See the problem with that is the bot will still end up flooding services which I dont want. I want it to only do it once when its deoped. If it doesnt go through the services are either A: lagging and will catch up or B: down

So when services come out of the lag all the times he opped himself will happen and it does it like 500 times.
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

What you want to do is fairly simple.
- Set a variable did_identify to 0 when the bot connects
- Set this variable to 1 when the bot identifies
- Use a timer to unset this variable x minutes later, depending on your needs.
- Everytime the bot is asked to identify, check if the variable is 0 before doing it.

Code: Select all

set did_identify 0

<your proc starts here>
  if {$did_identify == 0} {
    putserv "PRIVMSG ChanServ :OP $chan"
    set did_identify 1
    timer 5 { set did_identify 0 }
  }
<your proc ends here>
Fiddle with the timer interval to make it suit your needs.
Hope this helps.

z_one
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

See I want him to identify to chanserv only when he's deoped though. Make him check once every 30 mins lets say and if he is deoped send the op command to chanserv.

I dont want him to ask for ops when he identify's to nickserv or anything like that.
Locked