mIRC Home    About    Download    Register    News    Help

Print Thread
#243939 12/01/14 02:32 PM
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
Hello, first of all I would like to thank all the people that help here, without you guys/gals a lot of us would be fumbling around in the dark without a clue.
My question this time is..in the following little remote script..how would I write it so that the script checks to see if it's an op @ typing it and not a regular user before responding?
Basically, the bot in the channel gives id#'s for bans it sets and I want the ops to be able to see the reasons if someone asks without giving them access to the bot. Oh...also, there are many id#'s so there would also be many "on *:TEXT:" command lines

on *:TEXT:id1100:#channel:/msg $nick User joins various Blacklisted Channels

Thanks in advance for any help

Last edited by EasyObserver; 12/01/14 02:35 PM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Not quite sure I understood exactly what you meant in here. But what comes to mind is that you could just create a .txt file which inputs all your ban ids that can be accessed by all the ops. (File could be accessed by a dropbox share, google drive, stuff like that.

For that you'd just add this code to your ban script.

write banlist.txt random text which can contain variables etc.



Other than that, you asked if you could make sure only ops can use commands. That done by adding this code to your commands.

if ($nick isop #) {


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
Here's where I sit right now with this script/snippet. It works, however, my main issue is, I have to add it every time for each separate id#..is there a way to make a text list and have the script call the id# from that list along with the reason?

on *:TEXT:id911:#channel: {
if ($nick isop $chan) { .msg $nick Permanent Ban, joins various blacklisted channels such as #SEXE #cybersex | halt }
else | halt
}
on *:TEXT:id729:#channel: {
if ($nick isop $chan) { .msg $nick Blacklisted Channel #*pedo* | halt }
else | halt
}

Last edited by EasyObserver; 12/01/14 06:25 PM.
Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
How about this?

To use it you need to make the IDS see commands below

!AddID <ID Number> <Reason>
!DelID <ID Number>
!ShowID <ID Number>

This ensures that only ops can use the commands.

Code:
on *:Text:*:#CHANNEL: {
  if ($1 == !AddID) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !AddID <ID Number> <Reason> | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick you must be opped to use this commands | halt }
      if ($readini(IDList.ini, $2, Reason) !== $null) { .notice $nick ID Number $2 has already created with reason  $readini(IDList.ini, $2, Reason). | halt }
      else { 
        writeini -n IDList.ini $2 ID $2 
        writeini -n IDList.ini $2 Reason $3-
        .notice $nick Added $2 - $3- 
      }
    }
  }
  if ($1 == !DelID) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: DelID <ID Number>. | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick you must be opped to use this commands | halt }
      if ($readini(IDList.ini, $2, ID) == $null) { .notice $nick ID $2 is not in the ID list | halt }
      else {
        .remini IDList.ini $2
        .notice $nick ID $2 has been removed from the ID list.

      }
    }
  }
  if ($1 == !ShowID) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !ShowID <ID Number>.  | halt }
    if ($2 !== $null) {
      if ($readini(IDList.ini, $2, ID) == $null) { .notice $nick $2 is not in the ID list. | halt }
      if ($readini(IDList.ini, $2, ID) !== $null) { .notice $nick ID $2 - $readini(IDList.ini, $2, Reason) | halt }
    }
  }
}


Last edited by jaystew; 12/01/14 06:31 PM.

Regards

JayStew
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
Awesome JayStew..thanks very much, works like a charm smile

Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Brilliant, Glad I could help. smile


Regards

JayStew
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
one little question jaystew, if I only want myself to be able to add or del..can I just sub the !isop with $me ? Also noticed that anyone can use the !showid, only wanted ops to be able to use that, but I'll figure that one out smile

Last edited by EasyObserver; 12/01/14 07:33 PM.
Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Hi

Updated for what you need.

Where it says NICKNAME change this to your IRC nickname and it will only let you use the commands. The only worry with this is that if you leave the network someone can then change there nick to the nick you use and will have access.

I can make it so it will read your name and hostmark but I would need to add another feature to the script if you want me too?

I have made it so only ops can use the !showid command

Code:
on *:Text:*:#CHANNEL: {
  if ($1 == !AddID) && ($nick == NICKNAME) {
     if ($2 == $null) { .notice $nick Command incomplete. Syntax: !AddID <ID Number> <Reason> | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick you must be opped to use this commands | halt }
      if ($readini(IDList.ini, $2, Reason) !== $null) { .notice $nick ID Number $2 has already created with reason  $readini(IDList.ini, $2, Reason). | halt }
      else { 
        writeini -n IDList.ini $2 ID $2 
        writeini -n IDList.ini $2 Reason $3-
        .notice $nick Added $2 - $3- 
      }
    }
  }
  if ($1 == !DelID) && ($nick == NICKNAME) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: DelID <ID Number>. | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick you must be opped to use this commands | halt }
      if ($readini(IDList.ini, $2, ID) == $null) { .notice $nick ID $2 is not in the ID list | halt }
      else {
        .remini IDList.ini $2
        .notice $nick ID $2 has been removed from the ID list.

      }
    }
  }
  if ($1 == !ShowID) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !ShowID <ID Number>.  | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick you must be opped to use this commands | halt }
      if ($readini(IDList.ini, $2, ID) == $null) { .notice $nick ID $2 is not in the ID list | halt }
      if ($readini(IDList.ini, $2, ID) !== $null) { .notice $nick ID $2 - $readini(IDList.ini, $2, Reason) | halt }
    }
  }
}


Regards

JayStew
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
Thanks jaystew..that would be very much appreciated. I was wondering though, instead of you going through the hassle of adding another feature for hostmask, and since I am running this on my client, can I just change ($nick == NICKNAME) to ($nick == $me)? That way it wouldn't matter what nick I was using as long as the script identified it as me.

Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
Just came across a problem with it. It appears that I can not add or del id's. I didn't realize this with the original script you entered as I was testing with another client to make sure they could or could not..didn't even think to test it on myself wink Anyway, with the original script, ops can do everything, but I can only ShowID. ??

Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Hello

Sorry I didn't reply straight away but I was creating the new script...... I didn't realise that this would be going into your mIRC client and just thought it would be going into a bots client.

The difference being on a bot you yourself can use !addID but if you place it in your mIRC then doing !addID will not trigger the event (you cant trigger your own scripts like that)

So now I have changed this so it will work for you, please see new commands and now as it is going into you mIRC on the /add and /del you don't need ($nick == isop) as no one else can trigger it.

Commands

/addID <ID NUMBER> <Reason>
/DelID <ID NUMBER>
/ShowID <ID NUMBER>
!ShowID <ID NUMBER>

All the / commands are for you and the ! commands are for everyone else. To use !ShowID the user must be opped.

Code:
alias AddID {
  if ($1 == $null) { .echo Command incomplete. Syntax: /AddID <ID Number> <Reason> | halt }
  if ($1 !== $null) {
    if ($readini(IDList.ini, $1, Reason) !== $null) { .echo ID Number $1 has already created with reason " $readini(IDList.ini, $1, Reason) " | halt }
    else { 
      writeini -n IDList.ini $1 ID $1 
      writeini -n IDList.ini $1 Reason $2-
      .echo You have added ID number $1 - $2- 
    }
  }
}
alias DelID {
  if ($1 == $null) { .notice $nick Command incomplete. Syntax: /DelID <ID Number>. | halt }
  if ($1 !== $null) {
    if ($readini(IDList.ini, $1, ID) == $null) { .echo There is no ID Number $1 to delete! | halt }
    else {
      .remini IDList.ini $1
      .echo  You have deleted ID number $1 
    }
  }
}
alias ShowID {
  if ($1 == $null) { .notice $nick Command incomplete. Syntax: /ShowID <ID Number>.  | halt }
  if ($1 !== $null) {
    if ($readini(IDList.ini, $1, ID) == $null) { .echo Sorry but there is no ID $1 to show | halt }
    if ($readini(IDList.ini, $1, ID) !== $null) { .echo ID number $1 - $readini(IDList.ini, $1, Reason)  | halt }
  }
}
on *:Text:*:#: {
  if ($1 == !ShowID) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !ShowID <ID Number>.  | halt }
    if ($2 !== $null) {
      if ($nick !isop $chan) { .notice $nick You must be opped to use this commands | halt }
      if ($readini(IDList.ini, $2, ID) == $null) { .notice $nick Sorry but there is no ID $1 to show | halt }
      if ($readini(IDList.ini, $2, ID) !== $null) { .notice $nick ID number $2 - $readini(IDList.ini, $2, Reason) | halt }
    }
  }
}


Sorry for the delay / confusion, This should of been my first question to whom's client it was going in.

Last edited by jaystew; 12/01/14 09:06 PM.

Regards

JayStew
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
No need to apologize jaystew, I should have mentioned it was going into my client at the beginning, so my apologies. I'll give this a test run in a little bit, but before I do..and here I show my true noobieness..this goes in Aliases or Remote? I was running the last ones in Remote.

Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Yep place it in remotes - Hope it runs ok for you smile


Regards

JayStew
Joined: Jul 2013
Posts: 24
E
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Jul 2013
Posts: 24
Hey jaystew...just wanted to let you know that this is exactly what I was looking for and it works perfectly. Thanks very much for your patience and help...well..not really help, you wrote the darn thing..so..thanks very much for writing the script for me, I appreciate it very much smile

Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Fantastic, Glad its what you are looking for and that its working spot on for you smile


Regards

JayStew

Link Copied to Clipboard