mIRC Home    About    Download    Register    News    Help

Print Thread
#152849 07/07/06 01:41 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344

Why does this not work?
Code:
on *:chat:*:{
 if (.op == $strip($1)) {
    if (!$2) || (!$3) { msg =$nick Use .op #chan nick | halt }
    if ($me ison $2) && ($3 ison $2) { mode $2 +o $3 | msg =$nick Added to OP $3 in $2 $+ . }
    halt
  } }

it set op when the command is used correct but it does not give the msg when you use the command incorrect.

#152850 07/07/06 02:03 PM
Joined: Feb 2006
Posts: 181
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
on *:chat:*:{
if (.op == $strip($1)) {
if (!$2) || (!$3) { msg $nick Use .op #chan nick | halt }
if ($me ison $2) && ($3 ison $2) { mode $2 +o $3 | msg $nick Added to OP $3 in $2 $+ . }
halt
} }


------------------
Regards,
Crinul

#152851 07/07/06 02:52 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
if you waana send a msg back to someone in dcc chat the += has to be infront of the nick Crinul

#152852 07/07/06 03:15 PM
Joined: Feb 2006
Posts: 181
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
on *:chat:*:{
if (.op == $strip($1)) {
if (!$2) || (!$3) { msg =$nick Use .op #chan nick | halt }
if ($me ison $2) && ($3 ison $2) { mode $2 +o $3 | msg =$nick Added to OP $3 in $2 $+ . }
halt
} }


Works just fine :P on mIRC 6.16 grin

#152853 07/07/06 03:24 PM
Joined: Nov 2005
Posts: 24
K
Ameglian cow
Offline
Ameglian cow
K
Joined: Nov 2005
Posts: 24
Code:
on *:chat:*:{
 if (.op == $strip($1)) {
    if (!$3) msg =$nick Use .op #chan nick
    elseif ($me isop $2) && ($3 ison $2) { 
           mode $2 +o $3 
           msg =$nick Added to OP $3 in $2 $+ .
           }
    }
 }

I did nothing, but removed the pipes and shortened the code. This should work.

#152854 07/07/06 03:30 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
well not on 6.17 frown

#152855 07/07/06 04:37 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
Got it working !!!!!
My god so simple........
Here is what needed to be changed in red:
Code:
if (.op == $strip($1)) {
    if [color:red]([/color](!$2) || (!$3)[color:red])[/color] { msg $+(=,$nick) Use .op #chan nick | halt }
    if ($me ison $2) && ($3 ison $2) { mode $2 +o $3 | msg $+(=,$nick) Added to OP $3 in $2 $+ . }
    halt
  } 
  

Those 2 small things.

Well a other problem solved on my way to the next one.

Greetzz

#152856 07/07/06 08:36 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
ok, Im curious, (and glad you got your help)..... is it possible in mirc to do $!2-3 and have it mean "if string2 through 3 is null"?

I KNOW this isnt part of your question, but am quite curious smile


Those who fail history are doomed to repeat it
#152857 07/07/06 10:57 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In 6.17, yes, not sure about earlier versions though

#152858 07/07/06 11:15 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
kewl, was wondering about that smile


Those who fail history are doomed to repeat it
#152859 08/07/06 02:23 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
$!2-3 would be delayed evaluation of $2-3 so thats not the format.

This is the simple format
IF (!$2-3) { or just IF (!$2) { since if there is $2 then there wont be a $3 (however please read below)

This of course holds for most peoples scripts, but if u passed parameters as part of an $identifer, then you can well have a $null in $2 or $3, so you would think that !$2-3 is the answer, but they are actually handled slightly differently if passed as /command vs $identifier, when testing $2-3 as passed to a command (when they dont exist) the result value is $null, but when passed as $identifer such as $blah(a,,,d) then $2-3 result in 1 character a space becuase its $null<space>$null

if (!$numtok($2-3,32)) { <-- thats pretty close and would be enough for 99% of functions

However it does fail if $2 was actually passed as a space charcter, that is then eaten up in the gettok.

The only thing i can think that well exactly match would be if ($len($2-3) <= $calc(3 - 2)) {
I used $calc(3 - 2) becuase I assume your meaning his for more than just $2-3 maybe $5-19 if ($len($5-19) <= $calc(19 - 5)) and the 5 and 19 may even be in variables etc.

I guess it comes down to if u know your IF well never be in a $identifier then its easy, if not then its starts getting harder, doubly so if u cant know the possable contents of parameters.


Link Copied to Clipboard