mIRC Home    About    Download    Register    News    Help

Print Thread
#28518 07/06/03 04:01 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
When someone types a message to either Nickserv, Chanserv, or Memoserv to send a command, using "/msg" I want force that command to only come from a custom window instead of the channel, status, or querys...any ideas how I can do this?

Thanks in advance

Last edited by The_Game; 07/06/03 04:07 AM.
#28519 07/06/03 04:51 AM
Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
I suppose you could use on input to catch it.
Code:
on *:input:*: {
  ; this will catch and stop someone from accidently doing something like msg instead of /msg in a channel window
  ; which i assume is the purpose of the request.  Change/Add IF's to make it more or less strict.
  if ((msg isin $1) && (serv isin $2)) {
    if ($active != @YourCustomWindow) {
      echo $color(info) -eati * You must enter services commands in the dedicated window!
      HALT
    }
  }
}


#28520 07/06/03 05:12 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
Ok that works but what I forgot to mention was I have custom windows made:

@ChanServ
@NickServ
@MemoServ

If this makes sense I want any commands sent by "/msg" from either the status, channel , or query windows to instead be forced to come from their designated windows

Example:

If a user types any commands to chanserv from any window a message saying "to send commands to chanserv must come from the @chanserv window" and it wont send unless it comes from the @chanserv window

same thing goes for the others...

I apologize if this seems confusing

#28521 07/06/03 05:18 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Code:
on 1:INPUT:*: {
  if (/msg* iswm $1-) && (*serv iswm $2) && ($active != $+(@,$2)) { /echo -a Wrong Window! Type in the $+(@,$2) Window!) | halt }
  else if (/*serv* iswm $1-) && ($active != $+(@,$right($2, -1)) { /echo -a Wrong Window! Type in the $+(@,$right($2, -1) Window! | /halt }
}


-KingTomato
#28522 07/06/03 05:26 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
Bingo! Thanks

#28523 07/06/03 06:00 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well that sorta has numerous flaws.

For example, DALnet requires /msg chanserv@services.dal.net, since you check if (*serv iswm $2) it won't match.
Also:
//echo -a $iif(*serv iswm #serv,$true,$false)
So /msg #serv hey!
Will cause it to output an error.

Additionally (/*serv* iswm $1-) is wrong:

//echo -a $iif(/*serv* iswm /server,$true,$false)
//echo -a $iif(/*serv* iswm /join #serv,$true,$false)

Also why use /msg* iswm $1- ? Should it trigger if I do /msgops? Or any other custom alias beginning with /msg?

#28524 07/06/03 09:28 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
rather than critique someone, why not write a better version yourself. It wasn't meant to be bullet proof, but a solution for the time. Something he could later build apon.


-KingTomato
#28525 07/06/03 11:18 AM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
Hey it works for me so no complaints...anyways I got another question. I can't remember if this was posted before but say user A is on Network 1 and wants to send a message to user B on Network 2, how can I do this?

#28526 07/06/03 01:38 PM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
also an alias or something that will allow me to change the backgrounds of the button bar and the channel tab bar...I have been reading the help file but it doesnt help (LOL go figure )

#28527 07/06/03 05:26 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well because I saw the problem in my mind, not the solution. Therefore I could write what the problems were with out giving it any real thought, to actually fix the problems I'd have to take more time and look at it, and frankly, I really didn't feel like it.

#28528 07/06/03 07:22 PM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
Scratch that alias for the backgrounds out I figured it out for the most part and it worked so i'm not complaining. All I need now for the time being is for user A on network 1 to be able to send a message to user B on network 2 and I should be all set for now. Thanks for the help so far everyone...

#28529 08/06/03 12:06 PM
Joined: Dec 2002
Posts: 1,237
T
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 1,237
So im assuming thats not possible then? ah well

#28530 08/06/03 01:53 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
/help /scon


Code:
//if ( khaled isgod ) echo yes | else echo no
#28531 08/06/03 07:32 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
This will send to all other networks:

Code:
[color:green]; no parameters sent, give them the syntax[/color]
on 1:TEXT:!x-network:#: {
  /msg $chan Invalid Parameters: !x-network [channel] <message> (Note: Channel parameter is optional, and can be left out to send to all channels)
}

[color:green]; they have some parameres[/color] 
on 1:TEXT:!x-network *:#: {
  [color:green]; if they specify a channel, we need to look for one more parameter before we're satisfied.[/color] 
  if (($chr(35 isin $2) && ($4 != $null)) || ($3 != $null) {
   [color:green]; this will clear up whether it's a global message, or a channel-specific message[/color] 
    if ($chr(35) isin $2) /x-network $2 $cid $nick $1-
    else /x-network all $cid $nick $1-
  }
  [color:green]; not enough information[/color] 
  else /msg $chan Invalid or missing parameters. Type !x-network for more information
}

[color:green]; Syntax: /x-network <#channel|all> <cid> <nick> <message>[/color] 
alias x-network {
  [color:green]; go through all network connections[/color] 
  /set -u0 %network 1
  while (%network <= $scid(0)) {
    [color:green]; send to the specific channel or all channels of the connection id doesn't match[/color] 
    [color:green]; the one that sent the message[/color] 
    if (%network != $2) /scid %network $iif($1 == all, /amsg, /msg $1) $+(<,$3,>) $4-
    /inc -u0 %network
  }
}


-KingTomato

Link Copied to Clipboard