mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2013
Posts: 19
K
KeiroD Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Mar 2013
Posts: 19
Hi.

So I was asked to write a script that did 2 things:

1. Check to see if the user's voiced or not.
2. If not voiced, notice/message them on join with a sufficiently long-enough timer to ensure people who hadn't id'd to Services, id and not get the message.

I'm pretty sure I got this right with my testing of the script, but the person that asked me about this seems to be still messaging users.

So, here's the script in question:

Code:
; Alright. First, this script is meant to go into the Remotes tab for the Script Editor. If you already have the first two portions of this script, disregard, you only need to add the messager section.
; Step 1: To load the script up, press ALT+R in mIRC. Make sure you're on the Remotes tab.
; Step 2: Hit File -> New. Paste this text into that new script screen.
; Step 3: File -> Save as, call it messager.mrc, ensure the extension is set to No Selection. Paste the content from on *:voice:derpchan: { to the two }}s before the message stating the opmeinvite needs to go into Aliases.
; Step 4: Paste the Alias section into the alias tab in the Script editor.
; Step 5: Enjoy the awesomeness.
on *:voice:#derpchan: {
  opmeinvite $vnick
}
 
on *:op:#derpchan: {
  opmeinvite $opnick
}
; This is the messager script. Obviously, this messages non-voiced users only and guides them through the steps of getting voiced to join the Lounge. Put this BELOW the op and voice scripts as indicated above.
on *:join:#: {
  if ($nick != $me) {
    if ($me isop #Derpchan) {
      .timer 1 3 if ($nick isvoice #Derp) { goto end }
      else { goto give }
      :give
      notice $nick $+ , welcome to Derp! To get approved for voice, please message one of the ops after reading the Rules/FAQ.
      :end
    }
  }
}
; This is meant to go into the Aliases section.
opmeinvite {
  if $me isop #Derpchan2 {
    if $1 !ison #Derpchan {
      invite $1 #Derpchan2
    }
  }
}

Last edited by KeiroD; 08/04/14 03:36 AM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Your requirements can be satisfied with a single line.

Code:
on @*:join:#:.timer 1 3 if ( $nick !isvoice # ) notice $nick $nick $+ , welcome to Derp! To get approved for voice, please message one of the ops after reading the Rules/FAQ.


$nick will not be evaluated in the timer because it's touching the opening parenthesis. You can't use the goto statement like that in the timer. Your else statement is not after the if statement. It is not appropriate to use a goto statement in this, and you should probably not be using them ever.

Is your intention to invite all users to #chan2 when they're oped/voiced on #chan1? Because your if statement is using the wrong channel (they will never be invited). This behavior seems unnecessary anyway.

There's no reason to require it to be put into aliases. Keep the script together.

Joined: Mar 2013
Posts: 19
K
KeiroD Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: Mar 2013
Posts: 19
Originally Posted By: Loki12583
Your requirements can be satisfied with a single line.

Code:
on @*:join:#:.timer 1 3 if ( $nick !isvoice # ) notice $nick $nick $+ , welcome to Derp! To get approved for voice, please message one of the ops after reading the Rules/FAQ.


$nick will not be evaluated in the timer because it's touching the opening parenthesis. You can't use the goto statement like that in the timer. Your else statement is not after the if statement. It is not appropriate to use a goto statement in this, and you should probably not be using them ever.

Is your intention to invite all users to #chan2 when they're oped/voiced on #chan1? Because your if statement is using the wrong channel (they will never be invited). This behavior seems unnecessary anyway.

There's no reason to require it to be put into aliases. Keep the script together.


Gotcha. The fact that I was writing this shortly after I woke up probably didn't help.

Also... your one-line didn't work, unfortunately. However, editing it to this:

Code:
on *:join:#derp:.timer 1 3 if ( $nick !isvoice # ) notice $nick $nick $+ , welcome to Derp! To get approved for voice, please message one of the ops after reading the Rules/FAQ. }


... makes the code work properly.

Last edited by KeiroD; 08/04/14 04:27 AM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Well are you an op on the channel?


Link Copied to Clipboard