|
Joined: Oct 2007
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2007
Posts: 214 |
Hello,
I'm just wondering how I could just get the chan out of this link: [ rm=%#A\bDungeon\bA\bDare\bEnter ]
http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter
Thanks in advance
Cheers
- J
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
What is the channel out of there lol? #A??
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Jan 2007
Posts: 1,156
Hoopy frood
|
Hoopy frood
Joined: Jan 2007
Posts: 1,156 |
$gettok(URL,1,37)
EX: $gettok(http://www.buzzen.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,1,37)
|
|
|
|
Joined: Oct 2007
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2007
Posts: 214 |
no good mate,
your $gettok just gives me the link itself, I need the get the chan from that:
%#A\bDungeon\bA\bDare\bEnter
But thanks for the attempt
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
You can make it as easy as you want it to be from $remove to $regsubex //echo -a $remove(http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,http://www.internet.net/chatui.aspx?rm=) $regsubex( $identifier,( %.+),) I used in the following script %.+ to scan for % in text then give me the following string till end.
//noop $regsubex(http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,(%.+),) | echo -a $regml(1)
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: May 2007
Posts: 89
Babel fish
|
Babel fish
Joined: May 2007
Posts: 89 |
Some other possible solutions may be:
Alias GetChan {
Var %t = http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter
Echo -a $gettok(%t,2,61)
; $chr(61) : equal sign "="
}
; The above function may only be used if the equal sign occurs only once and always just before the channel name.
Or
Alias GetChan {
Var %t = http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter
If $regex(%t,/(%[^$]+)/) { Echo -a $regml(1) }
}
Or to be more precise
Alias GetChan {
Var %t = http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter
If $regex(%t,/=(%[^$]+)/) { Echo -a $regml(1) }
}
Cordialement
tropnul
|
|
|
|
Joined: Jan 2007
Posts: 1,156
Hoopy frood
|
Hoopy frood
Joined: Jan 2007
Posts: 1,156 |
then use the = token.
$gettok(http://www.buzzen.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,-1,61)
|
|
|
|
Joined: Oct 2007
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2007
Posts: 214 |
Wow,
Thanks guys, you've helped me save alot of time.
Cheers
- J
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
What the... Your telling me that $gettok($string,length(to),XX) XX being the chr base of the $gettok cmd?
I mean I always used 32 thinking it was standard and never had a specific meaning now to my understanding with this post in question is that the 32 section is chr based event where if 32 is the value of (Space) meaning that every token is within/after each space where if 61 was the num in that section and there was more then 2 spaces you could somehow manipulate $gettok with the chr events to pick up either part of the string?
var %f = This apple is sufficently *good but I might need 4 $gettok(%f,1,42) would return Everything prior to * and -1 would return everything after *
:S To think gettok had more potential
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Jan 2007
Posts: 1,156
Hoopy frood
|
Hoopy frood
Joined: Jan 2007
Posts: 1,156 |
Yes, I suggest reading up on $gettok and Token Identifiers in the mIRC help file.
$chr(32) is a token that is a space. $chr(46) is a token that is a period. $chr(44) is a token that is a comma.
You can use tokens to seperate data.
var %xx = data1 data2 data3
These are seperated by $chr(32) so $gettok(%xx,2,32) returns data2.
var %f = This apple is sufficently *good but I might need 4
$gettok(%f,1,32) would return This $gettok(%f,2,32) would return apple $gettok(%f,2-,32) would return "apple is sufficently *good but I might need 4"
NOTE: Using $chr(32) is the slowest response. Try to use another token like , or . to seperate data with.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
Well I guess I learn new things everyday
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
|