Auto OP (+@) In Specific Channels

By [85] on Dec 10, 2011

Screenshots

https://ircdnevnik.wordpress.com /server -m irc.dbase.in.rs:6667 -j #IRC

http://DBase.in.rs

alias autoop {
  dialog -m autoop autoop
}
dialog autoop { 
  title "Auto Op" 
  size -1 -1 199 111 
  option dbu  
  check "turn on", 2, 15 84 26 10 
  box "set channels", 3, 104 1 90 85 
  text "channel  :", 4, 108 14 23 8 
  text "channel  :", 5, 108 29 22 8 
  text "channel  :", 6, 108 44 22 8 
  text "channel  :", 7, 108 59 23 8 
  text "channel  :", 8, 108 74 23 8 
  edit %aokanal1, 9, 135 13 56 10,autohs center 
  edit %aokanal2, 10, 135 28 55 10,autohs center 
  edit %aokanal3, 11, 136 43 54 10,autohs center 
  edit %aokanal4, 12, 136 57 54 10,autohs center 
  edit %aokanal5, 13, 136 71 54 10,autohs center 
  button "set on", 14, 23 30 37 12,ok 
  box "main settings", 16, 19 1 58 50 
}
On 1:Dialog:autoop:sclick:14: { 
  set %aokanal1 $did(autoop,9).text 
  set %aokanal2 $did(autoop,10).text 
  set %aokanal3 $did(autoop,11).text 
  set %aokanal4 $did(autoop,12).text 
  set %aokanal5 $did(autoop,13).text 
} 
on 1:dialog:autoop:init:*: { 
  if (%autoop != $null) { did -c $dname 2 } 
} 
on 1:dialog:autoop:sclick:2: { 
  if ($did($dname, 2).state == 0) { unset %autoop } 
  if ($did($dname, 2).state == 1) { set %autoop on } 
} 
on *:join:%aokanal1: { 
  if ($nick == $me) { halt } { 
    if (%autoop = on) { /mode $chan +o $nick } 
  } 
} 
on *:join:%aokanal2: { 
  if ($nick == $me) { halt } { 
    if (%autoop = on) { /mode $chan +o $nick } 
  } 
} 
on *:join:%aokanal3: { 
  if ($nick == $me) { halt } { 
    if (%autoop = on) { /mode $chan +o $nick } 
  } 
} 
on *:join:%aokanal4: { 
  if ($nick == $me) { halt } { 
    if (%autoop = on) { /mode $chan +o $nick } 
  } 
} 
on *:join:%aokanal5: { 
  if ($nick == $me) { halt } { 
    if (%autoop = on) { /mode $chan +o $nick } 
  } 
}

Comments

Sign in to comment.
[85]   -  Dec 10, 2011

Thank you very much for yours advices.

 Respond  
IllogicTC   -  Dec 10, 2011

An advancement to this would be to replace the editboxes with a listbox, so it can support many more channels. Also, what if I joined #cookies on two different networks, one where I have ops and the other where I don't? It would trip for both, and one would work correctly, but the other would give me an error message which could get annoying. How about checking for $network $+ $chr(58) $+ $chan ? Then, when entering data for auto-op, you'd just structure it like this:

TheOpNetwork:#cookies would give me ops if I put the entry in the list.
TheNonOpNetwork:#cookies would not even try giving me ops unless I put that in the list, too.

 Respond  
Jethro   -  Dec 10, 2011

You can combine all of your join events into this:

on !*:join:#:{ 
  if (%autoop == on) { 
    var %x = 1
    while ($var(%aokana*,%x).value) {
      if ($chan == $v1) {
        mode $v1 +o $nick
      }
      inc %x
    }
  }
}

The ! exclamation mark prefixed to the join event tells mIRC not to respond to $nick == $me, and this bit of the dialog code to:

on *:dialog:autoop:sclick:14:{
  var %i = 1, %a = 9
  while (%i <= 5) && (%a <= 13) {
    set $+(%,aokana,%i) $did(autoop,%a).text 
    inc %i 
    inc %a
  }
}

This saves you some bytes and repetitions.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.