mIRC Homepage
Posted By: The_D Replacing standard responses - for self - 08/02/07 08:14 PM
I did a search on this and didn't turn up anything, so...

I want to write a script that'll replace text in the channel. I've gotten it working for other people, but not for any test I've input myself.

I want the output to look like this:

Me > My message

This is the code I have for other users (nothing too complicated, I'm still learning... haven't touched mIRC scripting for a few years :S):

Code:
on *:TEXT:*:#:{
  echo $chan  $+ $cnick($nick).color $+ $nick $+  > $1-
  haltdef
}


Any ideas?
Posted By: RieDeLL Re: Replacing standard responses - for self - 08/02/07 08:41 PM
be more specific. do you want it to respond to someone or yourself?
ex. Person: "hey The_D"
You: Auto Response "HEY!"
like if someone type your name?
ok, for the code you made, it needs to be:
Code:
on ^*:TEXT:*:#:{
  echo -t $chan  $+ $cnick($nick).color $+ $nick $+  > $1-
  haltdef
}


the "-t" parameter is to add a timestamp, if you would like, you can take it out.
If you want it to work for you, you need to use on input.
Code:
on *:INPUT:#: {
  echo -t $chan  $+ $cnick($nick).color $+ $nick $+  > $1-
  haltdef
}
Posted By: The_D Re: Replacing standard responses - for self - 08/02/07 08:47 PM
Originally Posted By: Kurdish_Assass1n
If you want it to work for you, you need to use on input.
Code:
on *:INPUT:#: {
  echo -t $chan  $+ $cnick($nick).color $+ $nick $+  > $1-
  haltdef
}


Would that also relay the text I sent to the channel in question? That's the problem I'm having.

Edit: Just used that, it's echoing fine for me but it's not sending it to the channel.
Posted By: DJ_Sol Re: Replacing standard responses - for self - 08/02/07 10:19 PM
on *:INPUT:#: {
privmsg $chan $1-
echo -t $chan  $+ $cnick($nick).color $+ $nick $+  > $1-
haltdef
}

maybe this will work for you.
Posted By: Riamus2 Re: Replacing standard responses - for self - 08/02/07 10:30 PM
You could just use /msg instead of /privmsg for that.
Posted By: Kardafol Re: Replacing standard responses - for self - 08/02/07 10:36 PM
Code:
on *:INPUT:#: {
  if ($+($readini($mircini,text,commandchar),*) iswm $1-) return
  .msg $chan $1-
  echo -t $chan  $+ $cnick($me).color $+ $me $+  > $1-
  haltdef
}

Untested, but should work.
Posted By: The_D Re: Replacing standard responses - for self - 08/02/07 10:38 PM
Many thanks guys, that worked smile Now how would I do it with actions? :P
on text and on action work exactly the same, but instead of it being ON TEXT blah blah it's ON ACTION blah blah. The format is exactly the same smile
wow, I didn't put msg $chan in there
* Kurdish_Assass1n hides in shame :|
Posted By: Kardafol Re: Replacing standard responses - for self - 09/02/07 09:11 PM
Code:
; Others:
on ^*:TEXT:*:*:{
  echo -t $iif($chan,$chan,$nick)  $+ $cnick($nick).color $+ $nick $+  > $1-
  haltdef
}
on ^*:ACTION:*:*:{
  echo -t $iif($chan,$chan,$nick)  $+ $cnick($nick).color $+ $nick $+  > $1-
  haltdef
}
; Self:
on ^*:INPUT:*: {
  if ($istok($+($readini($mircini,text,commandchar),me,$chr(10),$+($readini($mircini,text,commandchar),action),$1,10)) {
    .action $iif($mid($1,2) == me,$active) $2-
    echo -t $iif($mid($1,2) == me,$active,$2) $+(,$nick($me).color,$me, >) $iif($mid($1,2) == me,$2-,$3-)
  }
  elseif ($+($readini($mircini,text,commandchar),*) !iswm $1-) {
    .msg $active $1-
    echo -t $active $+(,$nick($me).color,$me, >) $1-
    haltdef
  }
}

Note that im not sure if the ^ is required for the on INPUT event, if you're having any problems, try removing it.
Posted By: Riamus2 Re: Replacing standard responses - for self - 09/02/07 10:20 PM
No, the ^ isn't used with on INPUT events. They will halt fine without it.
© mIRC Discussion Forums