Nov 14 2003, 04:29 AM
How would I do a wildcard search for a specific XBEID and return the path to the xbe? I want this for my "Delete XBMP/C save and launch" script. I feel it would be done the easiest by searching for the specific XBEID (for the user at least), and returning the path, so it knows where the file is, to launch it.
I'm having quite a hard time trying to figure out a way to do this. It's confusing the fuck out of me
Nov 14 2003, 05:00 AM
I guess you'll have to search all directories/subdirectories. Check all files' XBEIDs. And launch the one whose XBEID matches.
I'm afraid there's no easy way to do this.
Nov 14 2003, 05:04 AM
Yea, I know there's no easy way. I'm just having a hard time figuring out the code to make this work. I guess I should have said that.
EDIT: Nevermind (for now), I think I'm starting to get it to work, I haven't tested it yet though, it just looks like it *may* work.
EDIT2: Ok, here's the code I've come up with so far, I don't know if it works, I don't know that I'll get to test it out till tomarrow or so:
SETFUNC XBMCID XBEID %XBE%
IF %XBMCID% == "0face008" GOTO GETPATH
IF %XBMCID% != "0face008" GOTO DOAGAIN
MessageBox "TEST: %XBE% and %XBMCID%$eol$$eol$BLACK to exit"
IF %_GP_BLACK% == "1" GOTO DONESEARCH
Nov 14 2003, 12:34 PM
you might be able to use the cache_menu.xml to do this.
The nodes arent indexed so it might not be easy... ill try out some code this weekend and let you know if i come up with anything workable.
Nov 14 2003, 12:47 PM
Thanks man. I was originally thinking about that. But, I don't know how to make it work for people like me that don't use auto-menu, well, and I suck at this action scripting, so I really just kinda started throwing shit together, and this is what I've come up with.
Nov 15 2003, 06:47 AM
Eh, nevermind the XBEID for XBMC being '0face008' that's just the folder the saves are in (which, I thought that was done by XBEID, guess not though). Luckily, I checked the cache menu, and found out it's actually '262987784', that should make things go a little bit smoother.
Nov 15 2003, 06:54 AM
|But, I don't know how to make it work for people like me that don't use auto-menu|
It shouldnt really be an issue since you still must have the basics in your custom menu for it to work too.
Im making a script that will let you browse your cache file and change game/app titles now that kthulu has his keyboard script finished.
Since I was working with it and had to get the search pattern down right (thanks for the bugfix geniusalz:)) I figured I would go ahead and write this up.
You will need to edit the first line in the script to point to your cache_menu.xml file unless yours is on C:\ by default.
The only problem that this script will have is if you go through two submenus to get to your players. (ie: main menu->apps->media players->xbmp)
Thats the next fix I will be working on before i go ahead with the editing of game titles.
Anyway, the script searches your menu.. and checks the xbeid from the xbe file location itself and not the cache_menu entry for it. If found, it offers to delete the saves adn launch the app, skip or quit. So custom menus shouldnt be a problem unless its the problem i previously mentioned.
Its set up for XBMC and XBMP and tested fine on my box.
You can get it HERE... let me know if it works out fine for you.
Nov 15 2003, 06:59 AM
Yea, after I posted the "But, I don't know....." crap, it occured to me you could also search for XBEID still, too lazy to edit.
As for your script, I'll test it when I can, sounds nice though, with this I may just switch to auto-menu, because I'll be able to edit name from MXM and such. I still think I'll finish mine, though your's will be far more superior, just to get some experience and a sense of completion (something I rarely do).
Nov 15 2003, 07:06 AM
oh yea.. i highly recommend you finish yours. I dont ever mean to "squelch" anyone by doing a script and the ones i do are by no means the best ... which is why is was excited to see kthulu make up a better text editing script.
im doing them to learn too... i would rather they help someone along to get a better understanding of actionscripting... than to be used as the answer. Either way is a win for the person that wanted it... and gives me a little more experience doing different things.
Nov 15 2003, 08:58 AM
Yea, I know you don't mean to "squelch" (wtf?, lol), I was just saying. On a side note, mine freezes MXM me thinks, to test this I've added output so I know if it's searching or it just actually froze. Another side note (or more accuratly a question), do you know if I can use two wild cards in the search? Something like *App*, so it only bothers to look in directory's containing the letters 'app' in them.
Nov 15 2003, 03:47 PM
no i dotn think you can..but i could be wrong.
You could use a if "%s_name%" #^ "app" GOTO APPSDIRFOUND though. So if a dir contains app it will search it, otherwise it will skip it.
Nov 15 2003, 04:06 PM
That's the good thing about action scripting, if there isn't a means of doing one thing directly, there's always a work around (I think the more advanced languages do this type of shit for you automatically).
Nov 17 2003, 05:47 PM
Ok, I tested your script and it Doesn't seem to delete and launch, though it does read the cache menu rather nicely. And, and update on mine - It always freezes MXM, but I think I know the problem.
Jan 9 2004, 06:06 AM
on the searching for xbeid thing and deleting the xbmp save and then launching...
you could use a context script, then the path would already be available to you as %_GameDir%. to use the SETFUNC ... XBEID function and compare with game save dir, you could use the getHeXbeID.xas script i just posted.
i've had an idea for awhile on solving the cach-editor search problem, but was trying to wait till i got something else working that would provide an example (may be awhile though) so... how bout mimicking the menu structure in actionscript. only search one level at a time and present the search results as a menu with selectable menu items (kinda like VKB) once an item is selected, it searches down one more level and presents a menu with choices resulting from that search. am i making sense?
Jan 9 2004, 06:10 AM
or you could put the script in like this...
<dir>F:HDDLOADERProject Gotham Racing 2</dir>
SETFANSPEED whatever (10-50, i think)
EXEC "F:\HDDLOADER\Project Gotham Racing 2\default.xbe" (Might wanna check on the use of backslashes inside qoutes, i think u have to double them up)
<title>Project Gotham Racing 2 (PAL)</title>
<media>F:MXM Video Previewst_projectgothamracing2.wmv</media>
i bet the %_GameDir% is useable in there, but maybe not...
Jan 9 2004, 06:18 AM
I was working on a very similar system, but abandoned it coz it was taking too long to fix.
And if you want a menu script that works fine, You can customize one I posted one a little while ago.
GOSUB won't work, so you'll have to move the code inside the main loop. And FOR loops don't work, but that can easily be done with GOTO's
Jan 9 2004, 06:41 AM
sounds similar to something i was working on a few weeks ago...a filemanager script
just to see if i could
i have a working display that can be switched from source display, destination display, queue display. it doesn't use any external files for record keeping. it uses that old "06C:MXM07C:EVOX" string-array trick i talked about a long time ago. it has flicker problems tho when scrolling thru the files cause the processing in the recursive calls are so heavy. i got frustrated with my queue string array tho cause i was having problems taking strings out of it...so haven't touched it in a few weeks.
maybe this weekend, if you would be willing, i can clean my code up to something more readable and you could look at it?
i know the coming built-in filemanager will be FAR superior, but i just wanted to see if i could do it. plus, even after the filemanager is built-in, something similar to this script may still be needed for other scripts to get filepaths from users without relying on their 'typing skills'
Jan 9 2004, 01:21 PM
Sure, I'll have a look at it. In my experience XML arrays are far easier to use than string arrays.
And cool idea about using it as an 'open file' or 'open location' dialog box.
Jan 9 2004, 01:30 PM
when you say using XML arrays, are you talking about using a temp xml file...
is it possible to use the built-in XML operations on an XML structure loaded into a string?
that would be cool...
Jan 9 2004, 08:52 PM
You don't have to make an xml file, just a temporary one in memory.
You can use !.%index% with XMLGetValue and XMLSetValue to use arrays
If you have a string, you can just write it to a file, and use the XMLOpen for that
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here