mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2007
Posts: 4
T
The_D Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Feb 2007
Posts: 4
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?

Joined: Oct 2006
Posts: 37
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2006
Posts: 37
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?


while ($noob = $true) { .stfu }
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
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
}


-Kurdish_Assass1n
Joined: Feb 2007
Posts: 4
T
The_D Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Feb 2007
Posts: 4
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.

Last edited by The_D; 08/02/07 08:54 PM.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
on *:INPUT:#: {
privmsg $chan $1-
echo -t $chan  $+ $cnick($nick).color $+ $nick $+  > $1-
haltdef
}

maybe this will work for you.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You could just use /msg instead of /privmsg for that.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
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.

Last edited by Kardafol; 08/02/07 10:38 PM.

Those who can, cannot. Those who cannot, can.
Joined: Feb 2007
Posts: 4
T
The_D Offline OP
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Feb 2007
Posts: 4
Many thanks guys, that worked smile Now how would I do it with actions? :P

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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


Those who fail history are doomed to repeat it
Joined: Apr 2006
Posts: 400
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Apr 2006
Posts: 400
wow, I didn't put msg $chan in there
* Kurdish_Assass1n hides in shame :|


-Kurdish_Assass1n
Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
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.

Last edited by Kardafol; 09/02/07 09:13 PM.

Those who can, cannot. Those who cannot, can.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
No, the ^ isn't used with on INPUT events. They will halt fine without it.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard