mIRC Homepage
Posted By: sas22 A on ctcpreply question - 11/07/06 03:30 PM
Is this possible
Code:
on *:ctcpreply:VERSION:if (mirc isin (I need an identifier for the reply)) { .echo $nick is safe from channel floods }

Eh I hope you all get the idea of it just to identify what IRC client someone is using so that it will be safe for a code I'm writing.
Posted By: billythekid Re: A on ctcpreply question - 11/07/06 04:45 PM
$1-

/help on ctcpreply
Posted By: sas22 Re: A on ctcpreply question - 11/07/06 07:19 PM
blush
Posted By: sas22 Re: A on ctcpreply question - 11/07/06 07:33 PM
Nows heres the code
Code:
on !*:deop:#:{ if ($opnick == $me) && ($nick isop #) && ($nick != Chanserv) { 
    .ctcp $nick version 
    if (upp isin $1-) { cs deop # $nick | cs ban # $nick You should have thought twice | cs unban # | .timer 1 1 join # } else 
    .timer -h 1 0 .cs op # $me 
  }
}

It isn't working..
Posted By: OrionsBelt Re: A on ctcpreply question - 11/07/06 07:39 PM
Well,

cs unabn #

Is obviously spelled incorrectly, but I guess thats not where you get stuck...
Posted By: sas22 Re: A on ctcpreply question - 11/07/06 07:40 PM
The problem is when I ctcp version the user they do have UPP in the reply but it keeps going to the else
Posted By: OrionsBelt Re: A on ctcpreply question - 11/07/06 07:45 PM
Try modifying to:

Code:
   if (upp isin $1-) { cs deop # $nick | cs ban # $nick You should have thought twice | cs unban # | .timer 1 1 join # }
   else { .timer -h 1 0 .cs op # $me }
  }
}


Notice the { ... } around the else statement.
Posted By: sas22 Re: A on ctcpreply question - 11/07/06 07:48 PM
It didn't work..
Posted By: OrionsBelt Re: A on ctcpreply question - 11/07/06 07:52 PM
Perhaps wildmatching then?

if (upp* iswm $1-) {
or
if (upp* isin $1-) {
or
if (*upp* iswm $1-) {

And otherwise I wouldn't know... :tongue:


EDIT:
Or Adding the halt command at the end of the if statement.

Code:
   if (upp isin $1-) { cs deop # $nick | cs ban # $nick You should have thought twice | cs unban # | .timer 1 1 join # | halt }
   else { .timer -h 1 0 .cs op # $me | halt }
  }
}
Posted By: sas22 Re: A on ctcpreply question - 11/07/06 07:54 PM
nope =/
Posted By: sas22 Re: A on ctcpreply question - 11/07/06 10:44 PM
Is the aswer to make the if statement an alias?
Posted By: DaveC Re: A on ctcpreply question - 11/07/06 10:52 PM
You cant issue a ctcp $nick version and then test the return of it on the next line in your script, you can only test its returned value in the CTCPREPLY even, like you began with.
Posted By: billythekid Re: A on ctcpreply question - 11/07/06 10:56 PM
you havent got a versionreply yet in that code.

heres the pseudocode

on deop check for version

on versionreply if upp isin $1- kickban nick

btk

[edit] DaveC got there first! lol, isn't that always the way... cool [/edit]
Posted By: sas22 Re: A on ctcpreply question - 12/07/06 12:06 AM
Code:
on !*:deop:#:{ if ($opnick == $me) && ($nick isop #) && ($nick != Chanserv) {
    set %uppc #
    set %UPPn $nick 
    .ctcp $nick version
  }
}
on *:ctcpreply:VERSION*:{ 
  if ($nick == $UPP);$UPP = alias UPP /return %UPPn ; && (upp isin $1-) { 
    cs deop %uppc $nick | cs ban %uppc $nick You should have thought twice | cs unban %uppc | .timer 1 1 join %uppc | unset %uppn | unset %uppc
    else { .timer -h 1 0 .cs op # $me 
    }
  }
}
This is what Im using now
© mIRC Discussion Forums