mIRC Homepage
Posted By: flex setting variables backwards [Needs Help] - 15/12/02 06:00 PM
Hello, I use a script to set variables backwards. For example i use this command: /vb somevar hello this is a test

This appairs my variable using the script like: %somevar tset a si siht olleh. I actually want to have the variable set like: %somevar olleh siht si a tset. So not the words to get backwarded, but just only letters. Here is my script, maybe you can help me. Somelike with another alias. Tnx!

; backwards talker to change variables
bw2 { var %text = $replace($1,$chr(32),$chr(1)), %text2
while (%text) { %text2 = $mid(%text,1,1) $+ %text2 | %text = $mid(%text,2) }
return $replace(%text2,$chr(1),$chr(32)) }
; variable backwards change alias
vb set $+(%,$1) $bw2($2-)
Posted By: watcher Re: setting variables backwards [Needs Help] - 15/12/02 06:17 PM
alias vb {
unset % [ $+ [ $1 ] ]
var %i 1,%x,%r
while %i <= $numtok($2-,32) {
%x = $len($gettok($2-,%i,32))
while %x { %r = %r $+ $mid($gettok($2-,%i,32),%x,1) | dec %x }
set % [ $+ [ $1 ] ] % [ $+ [ $1 ] ] %r
%r = ""
inc %i
}
}
usage: /vb [var without %] [word(s) smile]
Posted By: Merlin Re: setting variables backwards [Needs Help] - 15/12/02 06:29 PM
Note: This goes in REMOTES not in aliases. Another hint: try useing $+(...) instead of [ ... ] - Its less confusing and easier to read. cool
Posted By: flex Re: setting variables backwards [Needs Help] - 15/12/02 06:53 PM
Thanks! just saw your reply watcher, could it be possible to add some extra functions on that? Like for an example: /vb <-sometopion here> <varhere> <text here> first word go's backwarded, second word go's not backwarded etc etc ? It would be nice to keep the normal way too smile

Thanks!
Posted By: theRat Re: setting variables backwards [Needs Help] - 15/12/02 07:13 PM
C'mon flex, we can't give you everything ready, try scripting on your own.
© mIRC Discussion Forums