gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
76793 Posts in 13502 Topics by 1651 Members - Latest Member: Arnold99 November 21, 2024, 12:38:14 pm
*
gfx*gfx
gfx
WinMX World :: Forum  |  Metis Scripts and Help  |  Metis Script Help  |  A little help with metis characters
gfx
gfxgfx
 

Author Topic: A little help with metis characters  (Read 2714 times)

0 Members and 1 Guest are viewing this topic.

Micromecca

  • Guest
A little help with metis characters
« on: June 06, 2007, 02:29:35 am »
some time ago now I came up with this method for replacing characters written by metis in txt files with the true character for example * instead of ∗

small vb script....
Code: [Select]
Const ForReading = 1
Const ForWriting = 2

strFileName = Wscript.Arguments(0)
strOldText = Wscript.Arguments(1)
strNewText = Wscript.Arguments(2)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)

strText = objFile.ReadAll
objFile.Close
strNewText = Replace(strText, strOldText, strNewText)

Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close

executed by a batch file in metis....
Code: [Select]
cscript FixUsers.vbs "C:\Program Files\RoboMX\Plugins\UserGroups.xml" "∗" "*"

Can anyone tell me if its possible to perform these function in metis itself, and if so how?

thanks
 :D

Offline Bearded Blunder

  • Forum Member
    • Taboo Community Website
Re: A little help with metis characters
« Reply #1 on: June 06, 2007, 02:25:18 pm »
I'd need to understand better what the issue is you're trying to correct, when it occurs & how...

Also be careful what files you run this on, if for example run on usergroups.xml to correct miswritten wildcards at start of names to * be aware it will also convert them mid name where you wanted it to match an actual * rather than be a wildcard......

Metis is far less fussy in OUTput than input certanily to a room & passes these entities to files ok when captured in %PARAM% (apart from $ which causes trouble everywhere)....

Have you tried having it write using the * method rather than ∗ ?? although * is fine in OUTput anyway only in INput that it needs replacing..
Blessed is he who expecteth nothing, for he shall not be disappointed.

Micromecca

  • Guest
Re: A little help with metis characters
« Reply #2 on: June 06, 2007, 02:34:21 pm »
I use a script which allows me (and other admins) to add users to usergroups 'on the fly' via a command.
The script reads the entire usergroup in question and pushes each line to a var, when it writes it back it replaces line 3 with the new entry (new user) and writes the rest of the usergroup back after that line.
Entries that contain wildcards, for example *user 001* are written back as ∗user 001∗ so the vb script scans the file and replaces each ∗ with *
Is it possible to overcome this with metis alone?

 :D

Offline Bearded Blunder

  • Forum Member
    • Taboo Community Website
Re: A little help with metis characters
« Reply #3 on: June 06, 2007, 02:56:32 pm »
well i'd try
Code: [Select]
<out type="push" extdata="linetowrite"><operator type="strrep" nvalue="$lineasread$" lvalue="&lowast;" rvalue="*"/></out>or similar, but that won't prevent problems with a user who's name is"St*RRy*Eyes" who would NEED to appear as "*St&lowast;RRy&lowast;Eyes*" in there..

does that approach not work?
 if the above code does do the trick, you could get fancy & script it only replacing &lowast; at the ends of lines..
Blessed is he who expecteth nothing, for he shall not be disappointed.

Offline Bide & Musique

  • Forum Member
Re: A little help with metis characters
« Reply #4 on: June 06, 2007, 03:24:05 pm »
more easy  .....

    use metis  2.80 Beta 1 Modified 4  with  the option DisableXmlEntities   set to 1      :wink:
 
Quote
Metis 2.80  Beta 1 Modified 4   B&M 13-05-2007
*************************
- Fixed   invalid argument with the command /mxc load   

Metis 2.80  Beta 1 Modified 3    B&M 12-05-2007
*************************
- Fixed  command OnRename

- Added one option to disable the use of XmlEntities in memory 
 
usage  in file MXC.xml :
<DisableXmlEntities value="1"/>

if value = 1  XmlEntities in Memory are disabled
if value = 0  XmlEntities in Memory are enabled  ( Default )


enjoy        /0\

Micromecca

  • Guest
Re: A little help with metis characters
« Reply #5 on: June 06, 2007, 03:26:52 pm »
i gave that ver a try a short while back and had no end of problems with usergroups  :?

Offline James420

  • Forum Member
Re: A little help with metis characters
« Reply #6 on: June 07, 2007, 02:07:04 am »
To write a * to a file in any version of Metis without it being stupid and writing the entity code. Just write the entity code instead. It'll replace it with the actual character, kinda reverse of what it's doing now. You could also just run the strrep operator like Blunder said, and replace all the * characters with the entity value. But in some versions of Metis, in order to read the * character in a variable. You have to look for it with the entity value (Don't ask, Metis is retarded when it comes to handling the text properly). But b1m4 you shouldn't have to do any of that as long as you add that enxtra line of code into your mxc file. Then it should write out all the characters just fine without replacing them with the entity value.

Micromecca

  • Guest
Re: A little help with metis characters
« Reply #7 on: June 07, 2007, 10:23:31 am »
yep, thanks James, I've been down that road before, i actually flung a laptop across the room if i remember rightly  :lol:

It's now working perfect using B1M3, so I must have cocked something up last time !

thanks guys
 :D

Offline James420

  • Forum Member
Re: A little help with metis characters
« Reply #8 on: June 09, 2007, 12:03:08 am »
That's good to know, but I strongly suggest you update to b1m4 since it has a few important bug fixes.

WinMX World :: Forum  |  Metis Scripts and Help  |  Metis Script Help  |  A little help with metis characters
 

gfxgfx
gfx
©2005-2024 WinMXWorld.com. All Rights Reserved.
SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
Page created in 0.009 seconds with 21 queries.
Helios Multi © Bloc
gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!