mIRC Home    About    Download    Register    News    Help

Print Thread
setting variables backwards [Needs Help] #1936 15/12/02 06:00 PM
Joined: Dec 2002
Posts: 2
F
flex Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Dec 2002
Posts: 2
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-)

Re: setting variables backwards [Needs Help] #1937 15/12/02 06:17 PM
Joined: Dec 2002
Posts: 18
W
watcher Offline
Pikka bird
Offline
Pikka bird
W
Joined: Dec 2002
Posts: 18
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]

Last edited by watcher; 15/12/02 06:23 PM.

-watcher
Re: setting variables backwards [Needs Help] #1938 15/12/02 06:29 PM
Joined: Dec 2002
Posts: 164
M
Merlin Offline
Vogon poet
Offline
Vogon poet
M
Joined: Dec 2002
Posts: 164
Note: This goes in REMOTES not in aliases. Another hint: try useing $+(...) instead of [ ... ] - Its less confusing and easier to read. cool


DALnet: #HelpDesk, #mIRC, #MISHScript - Undernet: #mIRC, #mIRC-Scripts
Re: setting variables backwards [Needs Help] #1939 15/12/02 06:53 PM
Joined: Dec 2002
Posts: 2
F
flex Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Dec 2002
Posts: 2
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!

Re: setting variables backwards [Needs Help] #1940 15/12/02 07:13 PM
Joined: Dec 2002
Posts: 774
T
theRat Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
C'mon flex, we can't give you everything ready, try scripting on your own.


Code:
//if ( khaled isgod ) echo yes | else echo no