mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2014
Posts: 54
O
Orobas Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Oct 2014
Posts: 54
We're running a version on join help script and we're looking to stop it replying if an op joins.

my first script was basic and version'd all

Code
on *:JOIN:#help: {
  set %.ch $chan
  CTCP $nick VERSION
}
on 1:CTCPREPLY:VERSION*:/onotice #help $nick is using IRC client: $2-


that works fine..

I then edited it to ...

Code
on *:JOIN:#help: {
  set %.ch $chan
  if ($nick isop $chan) { halt }
  else if ($nick !isop $chan)
  .timer 1 3 CTCP $nick VERSION
}
on 1:CTCPREPLY:VERSION*:/onotice #help $nick is using IRC client: $2- 


now on join .. i get the following error

Quote
-
* /if: insufficient parameters (line 4, script6)
-


could i have a fix please. I'm pretty sure this "used" to work on a lower series mirc.. but it will not work on my 7.57

Last edited by Orobas; 24/04/20 08:58 PM.
Joined: Jul 2006
Posts: 3,960
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,960
You are you using "else if" which is error prone, and you have no command after it.

Also, when someone joins a channel, they have no mode, they are not op, they are opped after they join the channel, isop on $nick always fail.

You probably tried to use a timer to get around this problem, which can be a solution, but with any kind of lag, it could fail.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 2,028
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,028
Your error is because it's "elseif", not "else if". No user has OP status when they join a channel, OP status is given after joining the channel. You could call an alias to check their status before version.

Code
on *:JOIN:#help: {
  $+(.timerVersion.,$nick) 1 5 CheckVersion $nick #
}

alias CheckVersion {
  if ($1 !isop $2) ctcp $1 version
]

Joined: Jan 2004
Posts: 1,944
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,944
When clients join a channel, nobody has any status.
Do you mean that someone on the channel access list as an @op joins, and you don't want to do this because they will be given @ in the future? Or do you mean someone who already has @op in one of the other channels you already share with them?
Are there really that many ops doing that much joining that this would be a problem?

Joined: Oct 2014
Posts: 54
O
Orobas Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Oct 2014
Posts: 54
Many thanks RoCk .. that fix worked. much appreciated and thanks for the pm.

@maroon... yes that was the idea. to only version users coming in that did not have op status in the help channel. We have a few ops that "personally" do not like being version'd and have mentioned in the past they would put the bot on ignore, so was just working with them to keep the peace with a simple edit smile i can imagine the next reply on this lol... but each to their own opinion i guess smile

Last edited by Orobas; 25/04/20 08:43 AM.

Link Copied to Clipboard