mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2014
Posts: 2
U
Bowl of petunias
OP Offline
Bowl of petunias
U
Joined: Feb 2014
Posts: 2
Hi there

I'm new to scripting in mirc, but it seems to be a lot of fun smile

Well I started with an easy script, just giving a reply to a bot in the channel. That worked fine.
Now the bot is programmed to give me a string, and I want to take this string and message it back. No Problem.

Here my script so far:
on *:TEXT:*:?: { msg BOT $3 }

But the problem is, the string he sends me looks like 'xxxxx' and I have to send back the same string but without ''.
Can anyone tell me how I get these two ' away?

Kind Regards

Last edited by UltimaRatio; 06/02/14 07:43 PM.
Joined: Feb 2014
Posts: 3
Y
Self-satisified door
Offline
Self-satisified door
Y
Joined: Feb 2014
Posts: 3
Hiya!

Well, you can use the $remove function along with $chr.

Example: $remove('asda',$chr(39)) will return: asda

So you're looking for:
on *:TEXT:*:?: { msg BOT $remove($3,$chr(39)) }


Last edited by yrrrep; 06/02/14 09:01 PM.
Joined: Feb 2014
Posts: 2
U
Bowl of petunias
OP Offline
Bowl of petunias
U
Joined: Feb 2014
Posts: 2
Hi

Thanks for your reply, I will try this as soon as I'm home.

But just to know, what does $chr(39) do?
Can I find some informations about commands or any tutorials online? Didn't found anything till now...

Joined: Feb 2014
Posts: 3
Y
Self-satisified door
Offline
Self-satisified door
Y
Joined: Feb 2014
Posts: 3
Hiya,

$chr(39) = '

The character you want to remove from the text, you can see it using: //echo -a This is character: $chr(39)

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I made this so you can see all $chr() in a custom window.
Code:
Put this in your remote (ALT + R in mirc).
Type /ascii in any window and press enter.

alias ascii {
  if (!$window(@ascii)) { window -aClk0 @ascii 637 300 603 322 Verdana 11 }
  var %x = 225
  while (%x) {
    aline @ascii $eval($chr(%x),0) => $chr(%x)
    dec %x
  }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard