mIRC Home    About    Download    Register    News    Help

Print Thread
#146118 31/03/06 12:53 PM
Joined: Mar 2006
Posts: 3
E
Enriad Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Mar 2006
Posts: 3
Hi,

I'm sure there are scripts out there, though wouldn't it be neat if there was $xml(file/url).

Possibly props like $xml(file, line).type which returns element, header, etc?

Have like /xml file type line for writing them.

I'm not sure, just some ideas, you guys could probably think of something better.

Daniel

#146119 26/04/06 04:20 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I think something like this could work well:

Code:
$xml(file,level1,level2,level3)


This would get data from <level1><level2><level3>data</level3></level2></level1>

Code:
$xml(file,level1,level2,level3,attrib).attribute


This would get data from <level1><level2><level3 attrib="data" /></level2></level1>

#146120 27/04/06 07:25 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
adding to your method

$xml(file,level1,level2,level3,N).childnode returns total childnodes for N = 0 or the Nth.

$xml(file,level1).treelength returns the "childnode deepness" so if level1 is formatted like this

level1
-level2
--level3
---level4
---/level4
--/level3
-/level2
/level1


it returns 3 because level 4 is the deepest nested node and is 3 levels down.

Im sure theres loads more cool properties we can think off.
It would be a really nice feature


$maybe
#146121 06/05/06 12:50 AM
Joined: Dec 2002
Posts: 19
M
Pikka bird
Offline
Pikka bird
M
Joined: Dec 2002
Posts: 19
While I agree this feature would be great (currently I made a script which parses XML files using multi-dimensionnal arrays made of a hashtable), you should keep in mind that mIRC was intended for chatting.

So, if you'd like to parse XML files, you should probably do it yourself, use some workarounds (I've already seen implementations based on Windows' XML parser with $com calls), or use a MORE EFFICIENT language (a compiled one like C for example).

#146122 06/05/06 01:39 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
*sigh* I'm not going to debate this AGAIN, but I'll just say that mIRC has long been more than JUST a chat program. MANY of mIRC's features are NOT chat related.

#146123 06/05/06 07:21 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You are right. You used to think of it as an MSN client.

#146124 06/05/06 07:54 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
How is that relevant?

#146125 06/05/06 07:59 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That it's more than just a text based program. It's ful of funny faces, and pretty colors and all that good [censored].

#146126 06/05/06 08:04 AM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I never had smileys OR pretty colours when I used it for that, but again, that's irrelevant to the thread.

#146127 06/05/06 09:39 AM
Joined: Dec 2002
Posts: 19
M
Pikka bird
Offline
Pikka bird
M
Joined: Dec 2002
Posts: 19
Well, from a developper's point of view, adding XML support to an application such as mIRC isn't an easy thing IMHO.
Of course there are many libraries that let you parse XML files (such as libxml under Linux), but adding support for it through a scripting language is another completely different task...

#146128 06/05/06 04:23 PM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
mIRC Script is not just for Chat related functions, i know off alot of people that hardly chat but still use mIRC Scripts to quickly script a program.
The "It's not related to chat so therefor it shouldn't be added" arguement has long cease to exist. Your jumping to the conclusion in that mIRC is slow perse. Just yesterday i needed to quickly build up an xml from a 700kb plain txt file it took 1 second using a filter some regex matching and some file handling commands. If this is in plain mIRC Script then using a built in xml method should be even faster, though granted that building xml files is not quite the same as parsing them.

If we think outside the box who knows where we'll end up but i can assure you the road leading to the end will be alot more fun if we do.


$maybe

Link Copied to Clipboard