mIRC Home    About    Download    Register    News    Help

Print Thread
trying to remove ops from a ctcp version error #267231 24/04/20 08:18 PM
Joined: Oct 2014
Posts: 34
O
Orobas Offline OP
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Oct 2014
Posts: 34
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.
Re: trying to remove ops from a ctcp version error [Re: Orobas] #267233 24/04/20 09:02 PM
Joined: Jul 2006
Posts: 3,697
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,697
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: trying to remove ops from a ctcp version error [Re: Orobas] #267234 24/04/20 09:03 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021
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
]

Re: trying to remove ops from a ctcp version error [Re: Orobas] #267235 24/04/20 09:40 PM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
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?

Re: trying to remove ops from a ctcp version error [Re: RoCk] #267238 25/04/20 08:39 AM
Joined: Oct 2014
Posts: 34
O
Orobas Offline OP
Ameglian cow
OP Offline
Ameglian cow
O
Joined: Oct 2014
Posts: 34
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.