mIRC Home    About    Download    Register    News    Help

Print Thread
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-)

Joined: Dec 2002
Posts: 18
W
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
Joined: Dec 2002
Posts: 164
M
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
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!

Joined: Dec 2002
Posts: 774
T
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

Link Copied to Clipboard