mIRC Home    About    Download    Register    News    Help

Print Thread
#100314 11/10/04 08:33 PM
Joined: Sep 2004
Posts: 200
I
IR_n00b Offline OP
Fjord artisan
OP Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
im trying to make so that if someone says somthing i will say it
reversed so if someone says hello?
i will say ?olleh
and so on in private messages.

#100315 11/10/04 11:19 PM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Code:
alias reverse {
  var %a = 1
  While (%a <= $Numtok($1-,32)) {
    var %b = 1
    While (%b <= $Len($Gettok($1-,%a,32))) {
      var %c = $+($Mid($Gettok($1-,%a,32),%b,1),$iif(%b == 1,$Chr(32)),%c)
      inc %b
    }
    inc %a
  }
  return %c
}
On *:TEXT:*:?: { msg $Nick $Reverse($1-) }

This should work, but be cautioned, this can flood you out easily.


- Relinsquish
#100316 13/10/04 06:59 AM
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
Here is one I have been using for a while:

/back {
/set %mystring $1-
/set %newstr
/set %blank _ _
%mylen = $len(%mystring)
;****************************************************************
:loopstart
%pos = %mylen
/set %newchar $mid( %mystring, %pos,1)
if ($asc(%newchar) == 32) /set %newchar %blank
set %newstr %newstr $+ %newchar
/dec %mylen
if %mylen > 0 goto loopstart
;****************************************************************
/say $replace(%newstr,%blank,$chr(32) )

}

The %blank variable was needed to handle blank spaces

NOte: I had this in my aliases, so the comand is /back. To put it in your Remote file, you wuld need:
alias back { [...]

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
#100317 13/10/04 11:06 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
You could have very simply used the search feature to already locate some examples of this effect and modified (if at all) according to your requirements, i.e. this one.

menu query {
.Reverse text
..$style($groupState(#revtext,2,0)) On: .enable #revtext
..$style($groupState(#revtext,0,2)) Off: .disable #revtext
}

alias groupState if $group($1) == on { return $2 } | return $3

alias reverse {
var %i = 1, %len = $len($1-), %text
while %i <= %len {
%text = $mid($1-,%i,1) $+ %text
inc %i
}
$iif($isid,return,say) %text
}

#revtext off
On *:text:*:?:{
msg $target $reverse($1-)
}
#revtext end

Includes menu option to enable/disable.

Eamonn.

#100318 13/10/04 06:52 PM
Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
It's nice how %text = $mid($1-,%i,1) $+ %text works for $chr(32) (blank)!
I used:
%text = %text $+ $mid( %input , $calc( $len( %input ) - %i ) , 1 )
which quite naturally didn't work for blanks. (I had them replaced with $chr(160) then replaced back to $chr(32) before returned)

Cool


Maybe I wake up one day to notice that all my life was just a dream!

Link Copied to Clipboard