mIRC Home    About    Download    Register    News    Help

Print Thread
#197848 15/04/08 08:55 AM
Joined: Apr 2008
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Apr 2008
Posts: 4
Can you help me with this script.

I want on connect to (irc)server bot to identify with channel password, when enter the chan he will have +oa and then to deop himself and get +h, i need bot to check idle time of ops and halfops and after certain amount of time (30 min.) to deop them and dehalfop, true chanserv /cs deop #chan nick , i also want to deop and dehalfop them when they set away.


Last edited by pobunjeni; 15/04/08 08:56 AM.
pobunjeni #197880 16/04/08 03:04 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I'm going to split your request into two.
Quote:
I want on connect to (irc)server bot to identify with channel password, when enter the chan he will have +oa and then to deop himself and get +h, i need bot to check idle time of ops and halfops and after certain amount of time (30 min.) to deop them and dehalfop, true chanserv /cs deop #chan nick
This should work for that part. You'll have to do some specific modification regarding the network name(s), channel name, password(s), etc.
Code:
on *:connect:{
  if $istok(list of network names space separated,$network,32) {
    .msg nickserv identify <password>
    .msg chanserv identify <channel> <password>
    .join <channel>
  }
}
on me:*:join:#channel:{
  set $+(%,$chan,.,$network) $true
}
raw 366:*:{
  if $($+(%,$1,.,$network),2) {
    unset $+(%,$1,.,$network)
    var %a = 1, %b = $nick($1,oh,0)
    while %a <= %b {
      check_idle $1 $nick($1,oh,%a) %a
      inc %a
    }
  }
}
alias -l check_idle {
  if $nick($1,oh,$3).idle > 1800 {    .msg chanserv $+(de,$iif($nick($1,h,$3),half),op) $2  }
  else {
    if !$timer(auto-deop,.,$network,.,$1,.,$2) {
    $+(.timer,auto-deop,.,$network,.,$1,.,$2) -m 0 500 check_idle $1 $2 $3  }
  }
}

Now for the 2nd part of your request
Quote:
i also want to deop and dehalfop them when they set away.
There's no way to monitor this state on a regular basis using mIRC. The closest you can get is to perform a /whois on the nick and check if raw 301 is returned. If it is, then they are away, but issuing a lot of /whois commands can flood the server with response messages, especially if done quickly.

RusselB #197891 16/04/08 05:33 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
At least on unreal, the token $7 in who reply (raw 352) contains a H ('here') or G ('gone'). Anyway, it's natural to idle if marked away, thus... smile

Last edited by Horstl; 16/04/08 05:41 AM.
Horstl #197943 17/04/08 09:48 AM
Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
The following won't tell you if they are away, but it does say how long they have been idle in channel.

Code:
%i = 1
while %i <= $nick((channame),0) {
if $nick((channame), %i).idle > 1800 { do stuff }
inc %i
}

Last edited by Thrull; 17/04/08 09:49 AM.

Yar
Thrull #198207 23/04/08 01:19 PM
Joined: Apr 2008
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Apr 2008
Posts: 4
hey thanks, i just have one more question what should be here?

Code:
if $istok(list of network names space separated,$network,32) {


thanks again

RusselB #198212 23/04/08 02:55 PM
Joined: Jul 2006
Posts: 4,157
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,157
Just a minor, minor thing, $network can return $null whereas $server can't (if you're connected)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #198213 23/04/08 05:23 PM
Joined: Apr 2008
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Apr 2008
Posts: 4
ok i understand that, but what to put in here

Code:
(list of network names space separated,$network,32)

pobunjeni #198214 23/04/08 05:29 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Put what it says to put, your network names separated by spaces...

$istok(Undernet DALnet Efnet,$network,32)

Use your own network names of course.

RoCk #198219 23/04/08 07:39 PM
Joined: Apr 2008
Posts: 4
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Apr 2008
Posts: 4
ok i done that, and nothing happen, when i remove this part of code, it join the channel and identify, but it's not deoping people


Link Copied to Clipboard