mIRC Home    About    Download    Register    News    Help

Print Thread
Wrapping text around keyboard #198047 19/04/08 07:45 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
I know that sounds a little weird, so I'll try to explain.

Let's say you wanted to say "Want a cookie?"
You'd move the letters over by one on the keyboard, saying "Qlbr l xiijuw?"

This has no real purpose, but I thought it would be cool to script, and I figured I might learn a little more about mIRC scripting.

So basically, would there be a way to have mIRC encode and decode this? I don't think that the $asc is in sequential order, so I don't think $calc($asc($1)+ 1)) would work. Ideas?

Re: Wrapping text around keyboard [Re: Mpot] #198048 19/04/08 08:06 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You could have the 3 keyboard rows in separate strings, then use $mid, $pos and other related identifiers.

In order to implement the wrapping effect you could either check for boundaries (if <letter position> == 1 then wrap) or use the mod operator % with $calc, eg $calc(10 % 3).

You may also need the isletter /if operator.

You'll need to look all these up in the help file. Start by typing /help text and number identifiers. Happy scripting!


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Wrapping text around keyboard [Re: qwerty] #198049 19/04/08 08:09 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Wow, that looks like a project. x_x

Re: Wrapping text around keyboard [Re: Mpot] #198055 19/04/08 10:03 PM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Basically, you are only working on the non-special characters, so a simple "replace" may suffice:

replace $1- a,s; s, d; d,f ; f, g; g, h; h, j; j,k; k,l; l,a

etc.

Don't have mIRC running at the moment, so I can't check on the syntax of replace/replace cs.

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
Re: Wrapping text around keyboard [Re: Darwin_Koala] #198059 19/04/08 11:00 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Where's the fun in that smile

Note to the OP: if you follow the replace approach, make sure you use $replacexcs().


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Wrapping text around keyboard [Re: Mpot] #198062 19/04/08 11:37 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As long as you're only doing that to letters, they are in sequential order. If you want to do it for other characters, such as puntuation, you'll have to manually set it up.


Invision Support
#Invision on irc.irchighway.net
Re: Wrapping text around keyboard [Re: Riamus2] #198072 20/04/08 01:34 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Thanks for the input, everyone.