OpMe v3 With AOP Added

By MaxEvans on Nov 21, 2011

I'm making a comeback with a script I wrote a while back, but never posted. This is the third version of this script that I wrote. The first being the simple opme command for a bot, the second having adding and deleting nicks that can use the feature and third adding aop, vop, hop.

This script is specifically for a bot.

Right click in status or chat window, or use the menu at the top.
Click on the owner and channel options to set.

Here are the commands to use this script.

!addopme [Nick]
!addhopme [Nick]
!addvoiceme [Nick]

Those commands add the specified Nick to the Opme, Hopme, and Voiceme lists.

To use those commands tell the people you add to the lists to type:

!opme
!hopme
!voiceme

And of course to deop, dehop, or devoice use:

!deopme
!dehopme
!devoiceme

To remove someone from the list just type:

!delopme [Nick]
!delhopme [Nick]
!delvoiceme [Nick]


AOP Script Commands.

This version of the script (still v3) includes the AOP script. Basically Auto ops, hops, and voices specified Nicks. To use these commands just type:

!addaop [Nick]
!addhop [Nick]
!addvop [Nick]

And to remove someone from the auto lists type:

!delaop [Nick]
!delhop [Nick]
!delvop [Nick]

on 1:text:!addopme *:%chan:{
  if ($nick == %admin) { writeini opme.ini $2 opme $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to Opme List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!addhopme *:%chan:{
  if ($nick == %admin) { writeini hopme.ini $2 hopme $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to Hopme List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!addvoiceme *:%chan:{
  if ($nick == %admin) { writeini voiceme.ini $2 voiceme $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to Voiceme List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!addaop *:%chan:{
  if ($nick == %admin) { writeini autoop.ini $2 autoop $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to AutoOp List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!addhop *:%chan:{
  if ($nick == %admin) { writeini autohop.ini $2 autohop $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to AutoHop List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!addvop *:%chan:{
  if ($nick == %admin) { writeini autovoice.ini $2 autovoice $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to AutoVoice List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on *:text:!opme:%chan: {

  if ($readini(opme.ini,$nick,opme) == $address($nick,2)) { mode $chan +o $nick }
  else { msg $chan 15,2Sorry, only trusted people can use this feature. }
}

on *:text:!hopme:%chan: {

  if ($readini(hopme.ini,$nick,hopme) == $address($nick,2)) { mode $chan +h $nick }
  else { msg $chan 15,2Sorry, only trusted people can use this feature. }
}

on *:text:!voiceme:%chan: {

  if ($readini(voiceme.ini,$nick,voiceme) == $address($nick,2)) { mode $chan +v $nick }
  else { msg $chan 15,2Sorry, only trusted people can use this feature. }
}

on *:join:%chan: {

  if ($readini(autoop.ini,$nick,autoop) == $address($nick,2)) { mode $chan +o $nick }
  if ($readini(autohop.ini,$nick,autohop) == $address($nick,2)) { mode $chan +h $nick }
  if ($readini(autovoice.ini,$nick,autovoice) == $address($nick,2)) { mode $chan +v $nick }
}

On @*:text:!deopme:%chan: {
  mode $chan -o $nick

}

On @*:text:!dehopme:%chan: {
  mode $chan -h $nick

}

On @*:text:!devoiceme:%chan: {
  mode $chan -v $nick

}

on 1:text:!delopme *:%chan:{
  if ($nick == %admin) { remini opme.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 From Opme List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!delhopme *:%chan:{
  if ($nick == %admin) { remini hopme.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 From Hopme List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!delvoiceme *:%chan:{
  if ($nick == %admin) { remini voiceme.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 From Voiceme List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!delaop *:%chan:{
  if ($nick == %admin) { remini autoop.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 from AutoOp List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!delhop *:%chan:{
  if ($nick == %admin) { remini autohop.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 from AutoHop List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

on 1:text:!delvop *:%chan:{
  if ($nick == %admin) { remini autovoice.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 from AutoVoice List }
  else { msg $chan 15,2Command Ignored (Must be Admin) }
}

menu nicklist,menubar,channel {
  .Opme_v3 set up
  ..Set Opme_v3 Admin: { set %admin $?="What Nick Would You Like As Opme_v3 Admin?" | echo -a 15,2Opme_v3 Admin Is Now Set As %admin }
  ..Set Opme_v3 Channel: { set %chan $?="What Channel Would You Like Set For Opme_v3?" | echo -a 15,2Opme_v3 Channel Is Now Set As %chan }
}

Comments

Sign in to comment.
MaxEvans   -  Dec 10, 2011

I removed the on load event. I had that on there because I had it in an mrc file I was going to put on my site as a download. But haven't gotten around to doing that yet. And just copied and pasted the code from the mrc file. That's why it had it in there. I also fixed the menu part.

 Respond  
MaxEvans   -  Nov 22, 2011

I would like to create a dialog version of this script though, eventually. And have the nicknames stored the same way, but have a dialog for adding and removing them. But that's something I'll have to work on when I get the time.

 Respond  
MaxEvans   -  Nov 22, 2011

Okay. I use ini files for most of my stuff, and like you I don't add anyone with retarded characters in their nicks. I just wrote this particular script with ini files. I figured if anyone wanted to use it seriously, they could have non-stupid characters in their nicks or find another way to store nicks themselves. After all, the script is open source and can be changed to meet the needs of others. =)

 Respond  
blackvenomm666   -  Nov 22, 2011

you could always do txt files or variables i haven't really gone into it myself for my bot it uses ini i just don't add anyone that use the retarded characters in their nicknames. it was just a forewarning in case you ran into the problem

 Respond  
MaxEvans   -  Nov 21, 2011

I haven't had much time to learn an alternative to storing nicks rather than ini files. What would be a better way to store them than ini files?

 Respond  
blackvenomm666   -  Nov 21, 2011

i did not know that haha

 Respond  
Jethro   -  Nov 21, 2011

jaytea once said that having an individual text event for each operation is actually faster than placing them all together under one text event. :p

 Respond  
blackvenomm666   -  Nov 21, 2011

ok slight edit of your coding did some grouping and changed your menu <<<< using menu can interfere with other scripts and therefore is not suggested. also i didnt remove it but your on load event is pretty much useless because people are going to be just copying and pasting right into mirc scripts editor therefore it will not be activated they would have to put it in a txt file then load it manually which would take them longer so i don't see people doing it that way. another thing to keep in mind is that ini's are not the best thing to use for nicks because of the fact that an ini doesnt read certain characters properly like []'s it will turn those into `'s and so on and so forth

on *:load:{
  if ($version > 6.0) { echo -a 15,2Opme_v3 (With AOP Added) by 2,7Max Evans15,2 was successfully loaded. | echo -a 15,2Check the menubar for owner and channel set options. }
  else { echo -a 8,1Sorry. This addon requires mIRC 6.0+. Please download the latest version from www.mirc.com | .unload -rs " $+ $script $+ " } 
}
on *:text:*:%chan:{
  if ($1 == !addopme) {
    if ($nick == %admin) { writeini opme.ini $2 opme $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to Opme List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  elseif ($1 == !addhopme) {
    if ($nick == %admin) { writeini hopme.ini $2 hopme $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to Hopme List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  elseif ($1 == !addvoiceme) {
    if ($nick == %admin) { writeini voiceme.ini $2 voiceme $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to Voiceme List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  elseif ($1 == !addaop) {
    if ($nick == %admin) { writeini autoop.ini $2 autoop $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to AutoOp List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  elseif ($1 == !addhop) {
    if ($nick == %admin) { writeini autohop.ini $2 autohop $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to AutoHop List }
    else { msg $chan 15,2Command Ignored (Must be Admin) 
    }
  }
  elseif ($1 == !addvop) {
    if ($nick == %admin) { writeini autovoice.ini $2 autovoice $address($2,2) | msg $chan 15,2Added 2,15 $2 15,2 to AutoVoice List }
    else { msg $chan 15,2Command Ignored (Must be Admin) 
    }
  }
  elseif ($1 == !opme) {
    if ($readini(opme.ini,$nick,opme) == $address($nick,2)) { mode $chan +o $nick }
    else { msg $chan 15,2Sorry, only trusted people can use this feature.
    }
  }
  elseif ($1 == !hopme) {
    if ($readini(hopme.ini,$nick,hopme) == $address($nick,2)) { mode $chan +h $nick }
    else { msg $chan 15,2Sorry, only trusted people can use this feature. 
    }
  }
  elseif ($1 == !voiceme) {
    if ($readini(voiceme.ini,$nick,voiceme) == $address($nick,2)) { mode $chan +v $nick }
    else { msg $chan 15,2Sorry, only trusted people can use this feature. 
    }
  }
  elseif ($1 == !delopme) {
    if ($nick == %admin) { remini opme.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 From Opme List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  elseif ($1 == !delhopme) {
    if ($nick == %admin) { remini hopme.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 From Hopme List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  elseif ($1 == !delvoiceme) {
    if ($nick == %admin) { remini voiceme.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 From Voiceme List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  on elseif ($1 == !delaop) {
    if ($nick == %admin) { remini autoop.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 from AutoOp List }
    else { msg $chan 15,2Command Ignored (Must be Admin) 
    }
  }
  elseif ($1 == !delhop) {
    if ($nick == %admin) { remini autohop.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 from AutoHop List }
    else { msg $chan 15,2Command Ignored (Must be Admin)
    }
  }
  on elseif ($1 == !delvop) {
    if ($nick == %admin) { remini autovoice.ini $2 | msg $chan 15,2Removed 2,15 $2 15,2 from AutoVoice List }
    else { msg $chan 15,2Command Ignored (Must be Admin) 
    }
  }
}

on *:join:%chan: {
  if ($readini(autoop.ini,$nick,autoop) == $address($nick,2)) { mode $chan +o $nick }
  if ($readini(autohop.ini,$nick,autohop) == $address($nick,2)) { mode $chan +h $nick }
  if ($readini(autovoice.ini,$nick,autovoice) == $address($nick,2)) { mode $chan +v $nick }
}
On @*:text:*:%chan: {
  if ($1 == !deopme) {
    mode $chan -o $nick
  }
  elseif ($1 == !dehopme) {
    mode $chan -h $nick
  }
  elseif ($1 == !devoiceme) {
    mode $chan -v $nick
  }
}

menu nicklist,menubar,channel {
  .Opme_v3 set up
  ..Set Opme_v3 Admin: { set %admin $?="What Nick Would You Like As Opme_v3 Admin?" | echo -a 15,2Opme_v3 Admin Is Now Set As %admin }
  ..Set Opme_v3 Channel: { set %chan $?="What Channel Would You Like Set For Opme_v3?" | echo -a 15,2Opme_v3 Channel Is Now Set As %chan }
}
 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.