mIRC Home    About    Download    Register    News    Help

Print Thread
#153123 11/07/06 03:30 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
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.

#153124 11/07/06 04:45 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
$1-

/help on ctcpreply

Last edited by billythekid; 11/07/06 04:47 PM.

billythekid
#153125 11/07/06 07:19 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
blush

#153126 11/07/06 07:33 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
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..

#153127 11/07/06 07:39 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Well,

cs unabn #

Is obviously spelled incorrectly, but I guess thats not where you get stuck...

#153128 11/07/06 07:40 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
The problem is when I ctcp version the user they do have UPP in the reply but it keeps going to the else

#153129 11/07/06 07:45 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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.

#153130 11/07/06 07:48 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
It didn't work..

#153131 11/07/06 07:52 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
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 }
  }
}

Last edited by OrionsBelt; 11/07/06 07:55 PM.
#153132 11/07/06 07:54 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
nope =/

#153133 11/07/06 10:44 PM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
Is the aswer to make the if statement an alias?

#153134 11/07/06 10:52 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

#153135 11/07/06 10:56 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
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]

Last edited by billythekid; 11/07/06 10:57 PM.
#153136 12/07/06 12:06 AM
Joined: Jun 2006
Posts: 58
S
sas22 Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jun 2006
Posts: 58
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


Link Copied to Clipboard