|
Joined: Apr 2008
Posts: 4
Self-satisified door
|
OP
Self-satisified door
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.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I'm going to split your request into two. 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. 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 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.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
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...
Last edited by Horstl; 16/04/08 05:41 AM.
|
|
|
|
Joined: Aug 2006
Posts: 183
Vogon poet
|
Vogon poet
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. %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
|
|
|
|
Joined: Apr 2008
Posts: 4
Self-satisified door
|
OP
Self-satisified door
Joined: Apr 2008
Posts: 4 |
hey thanks, i just have one more question what should be here? if $istok(list of network names space separated,$network,32) { thanks again
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
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
|
|
|
|
Joined: Apr 2008
Posts: 4
Self-satisified door
|
OP
Self-satisified door
Joined: Apr 2008
Posts: 4 |
ok i understand that, but what to put in here (list of network names space separated,$network,32)
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
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.
|
|
|
|
Joined: Apr 2008
Posts: 4
Self-satisified door
|
OP
Self-satisified door
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
|
|
|
|
|