mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I will try explain what i want to get help with, i trying to break down one %var to two.

%var-i-try-break-down 111.22.333.4<SPACE>5555
(It's an IP with a port at the end after the <SPACE>)

i want to set %var1 111.22.333.4

and then set %var2 5555

how would i do this? i guess i cant use $replace, cos i dosent have anything to add to it, since i cant know every IP number that will be added in advance, same goes for the last 4 numbers. and i dont know if i can use $remove since i never know how long the first line can/will be, so ideas pls..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Code:
var %A = 111.22.333.4 5555
  var %var1 = $gettok(%A,1,32)
  var %var2 = $gettok(%A,2,32)

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Thnx.. how do you know what numbers to use? like you used:

1,32
2,32

anywhere you can read about it? cos in mirc.hlp it dosent say much about it..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
Look at /help Token Identifiers. I just learned tokens and they're very helpful. I'll try to explain a little. My line was
Code:
$gettok(%a,1,32)


$gettok means you want to pull a specific token out of a line of text. %a in this case is that line. 1 means you want the first token. 32 is the ASCII number for a space. You're saying that spaces are your token separators. Try making a test alias with that and play around with it. Get an ASCII chart for quick reference. Hope that helps.

Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
thnx, i look at it smile


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard