mIRC Homepage
Posted By: Buggs2008 helping stripping out a line - 26/11/07 11:16 PM
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
Posted By: Lpfix5 Re: helping stripping out a line - 27/11/07 12:36 AM
What is the channel out of there lol? #A??
Posted By: DJ_Sol Re: helping stripping out a line - 27/11/07 01:05 AM
$gettok(URL,1,37)


EX: $gettok(http://www.buzzen.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,1,37)
Posted By: Buggs2008 Re: helping stripping out a line - 27/11/07 01:55 AM
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
Posted By: Lpfix5 Re: helping stripping out a line - 27/11/07 04:33 AM
You can make it as easy as you want it to be from $remove to $regsubex

Code:
//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.

Code:
//noop $regsubex(http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,(%.+),) | echo -a $regml(1)
Posted By: TropNul Re: helping stripping out a line - 27/11/07 06:43 AM
Some other possible solutions may be:

Code:
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

Code:
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

Code:
Alias GetChan {
  Var %t = http://www.internet.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter
  If $regex(%t,/=(%[^$]+)/) { Echo -a $regml(1) }
}


Cordialement
Posted By: DJ_Sol Re: helping stripping out a line - 27/11/07 08:26 AM
then use the = token.

$gettok(http://www.buzzen.net/chatui.aspx?rm=%#A\bDungeon\bA\bDare\bEnter,-1,61)
Posted By: Buggs2008 Re: helping stripping out a line - 27/11/07 03:02 PM
Wow,

Thanks guys, you've helped me save alot of time.

Cheers

- J
Posted By: Lpfix5 Re: helping stripping out a line - 27/11/07 03:38 PM
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
Posted By: DJ_Sol Re: helping stripping out a line - 27/11/07 05:50 PM
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.
Posted By: Lpfix5 Re: helping stripping out a line - 27/11/07 11:09 PM
Well I guess I learn new things everyday
© mIRC Discussion Forums