Project

General

Profile

Auto rejoin to regain ops?

Added by NE Naim 12 months ago

Whats the possibility to auto rejoin channel when no ops detected?

My scripting seems to fail.

I know its a stupidly short post, but that's what is needed.. :)


Replies (4)

RE: Auto rejoin to regain ops? - Added by Per Amundsen 12 months ago

There is not enough information to determine what you want.

If you want to check if a channel has a op, you can use $nick(#, 0, o).

RE: Auto rejoin to regain ops? - Added by NE Naim 12 months ago

Example, overnight, when I or a pal hold a channel.. sometimes there is a disconnect,
not a part or split.. and the user loses ops. the remaining individual sits there
in a non-op'd condition.

What I am looking for is a detect that condition, and auto re-join to regain ops.

It's silly, it's a feature in BitchX which I'd like to use here.

Thanks for reading!

RE: Auto rejoin to regain ops? - Added by Per Amundsen 12 months ago

Doesn't really make sense, if you are disconnected, you can just ask for op on reconnect/rejoin.

Anyways, try this, replace #channel with the channel to check:

on *:START:{
  ; check every 5 minute if the channel has an op
  timer 300 0 /checkops
}

alias checkops {
  ; if no ops is in the channel
  if (!$nick(#channel, 0, o)) {
    /part #channel
    /join #channel
  }
}

if you only want to check if yourself is op, replace the alias with this:

alias checkops {
  ; if I am not opped in the channel
  if (!$nick(#channel, $me, o)) {
    /part #channel
    /join #channel
  }
}

Note this only works on the first server opened at the start, if you are on multiple servers, you can change the timer to execute on all servers like this:

on *:START:{
  ; check every 5 minute if the channel has an op
  timer 300 0 scon -a /checkops
}

If it needs to run on a specific server, let me know, it's a little more tricky to make sure the timer is started and associated with the correct server.

RE: Auto rejoin to regain ops? - Added by NE Naim 11 months ago

THAT is the solution for the problem.

It handled the situation perfectly.

No, i does not need to be specific, it will be on a single server.

Thank you so much.

    (1-4/4)