Simple AutoVoice using ini's

By [M]ike on Jul 17, 2007

The code allows you to control autovoice options for multiple channels. Pretty simple, posted mainly as an example to learn from.

on *:TEXT:!Autovoice*:#: {
  if ($2 == $null) {
    notice $nick Please enter a setting for the autovoice e.g !Autovoice [On|Off]
  }
  elseif ($nick !isop $chan) {
    notice $nick You must be an op to set the autovoice settings for #
  }
  elseif ($2 == $readini(autovoice.ini, $chan, setting)) {
    notice $nick Your setting is already set to $readini(autovoice.ini, $chan $+ , setting)
  }
  elseif ($2 == on) {
    /writeini autovoice.ini $chan setting $2
    notice $nick Autovoice settings for $chan set to: $2
  }
  elseif ($2 == off) {
    /writeini -n autovoice.ini $chan setting $2
    notice $nick Autovoice settings for $chan set to: $2
  }
}
on *:join:#: {
  if ($readini(autovoice.ini, $chan, setting) == on) && ($me isop $chan) {
    /mode $chan +v $nick
  }
  elseif ($readini(autovoice.ini, $chan, setting) == on) && ($me ishop $chan) {
    /mode $chan +v $nick
  }
}

Comments

Sign in to comment.
guest598594   -  Jul 17, 2007

why not just
on :text:!autovoice:#:{
if ($nick isop $chan) || ($nick ishop $chan) {
avoice $2
msg $chan $2 has been added to the Auto-Voice list for $chan by $nick $+ .
}
}

 Respond  
RusselB   -  Jul 17, 2007

Nicely written script, although not really useful considering mIRC\'s /avoice command

 Respond  
[M]ike   -  Jul 17, 2007

Yeah, but if you read the description I\'m posting it as an example.

 Respond  
Lindrian   -  Jul 17, 2007

I dont know rly if a ini is needed here. A dynamic variable would do the same acually :P

 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.