28 July 2022, 05:15 | #1 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
How can I search for and replace a tool type value?
Good night,
I need to search and change a tool type in 1200+ WHDLoad games I installed these past weeks. It appears the default QuitKey=$xx set up by WHDLoad installers somehow conflicts with normal operation of WHDLoadMenu and TinyLauncher. How could I do this please? |
28 July 2022, 05:31 | #2 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
change the quitkey in S:WHDLoad.Prefs perhaps? i use QuitKey=$43 which i think is enter on the numpad and it overrides the quitkey setting in all tooltypes.
|
28 July 2022, 07:07 | #3 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
Thank you for the tip,
Alas, when an option is set both locally (tooltype) and globally (WHDLoad.prefs), the local option has precedence. I just tested it and WHDLoad spits out the "bad number" error, because it must expect a hex value, even though QuitKey=89 exists in WHDLoad.prefs. I need to find a way to change those values without checking each and every icon one by one |
28 July 2022, 08:13 | #4 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
no idea why your setup differs, but i have a heap of local tooltype quitkeys that came as standard (and got peeved a lot of them are different) and i override the lot with S:Whdload.Prefs without issue with QuitKey=$43 and global should override local, at least it does for me.
Maybe try changing your S:WHDload.prefs keycode to match the one i use and give that a try? it should equate to the numeric keypads "ENTER". The prefs file ofc just needs the ; taken away from the quitkey entry to uncomment it. Code:
;Preload ;try to buffer much data files on startup ;Proxy=proxyhost:3128 ;use this HTTP-proxy, [user:password@]hostname[:port] QuitKey=$43 ;rawkey code to quit ;ReadDelay=150 ;wait after reading from disk (1/50 seconds) ;RecallAdr=$4f000000 ;memory address to store recall data ;RestartKey=$5c |
28 July 2022, 08:45 | #5 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
I beg to differ. It seems to me your config is the weird one.
Here is an excerpt from WHDLoad docs: There are local and global options. Local options are specified as arguments via the command line or as ToolTypes when started from the Workbench. If a option is specified global and local the local one has precedence, i.e. it will overwrite the global one. For example you can set a global QuitKey as default for all installed programs and set an individual QuitKey for single installs in their icon via a Tooltype. (http://whdload.de/docs/en/opt.html for the complete doc). That is exactly the behavior I'm seeing when launching a game with a QuitKey tooltype. Although a QuitKey statement is present in the config file of WHDLoad, the slave will fail. Happens also with TinyLauncher, although in this case the emulation freezes. Removing the tooltype fixes the issue. Last edited by PoulpSquad; 28 July 2022 at 09:02. |
28 July 2022, 09:34 | #6 | |
Registered User
Join Date: Jan 2022
Location: Australia
Posts: 78
|
Quote:
|
|
28 July 2022, 12:33 | #7 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,525
|
Not sure about an option in AmigaOS, but Notepad++ can search and replace in multiple files. So you could filter for '*.info' files and just replace your old QuitKey with a new one that way.
|
28 July 2022, 13:47 | #8 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
@SnoopDOS: That would have made sense of course, but it doesn't work neither!
@TCD: That's worth a try... if that doesn't exist on Amiga I'll have to find a way to export them Windows side, modify them, and copy them back to their original location Last edited by PoulpSquad; 28 July 2022 at 13:52. |
28 July 2022, 13:51 | #9 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,525
|
Let's hope somebody knows how to do the same with Amiga tools. It might be an even better idea to remove the QuitKey tool type completely from the individual slaves and use the WHDload.prefs option instead that way.
|
28 July 2022, 14:20 | #10 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
Confirming this hex=>decimal thing works...
Taking a random game that uses the QuitKey tooltype, for instance Mr. Heli. I settled on using a random key, F5. F5 has a rawkey value of 54. Converting 54 from hex to decimal=84 QuitKey=84 (without a $) works fine, F5 indeed quits the slave as intended. Now the problem remains to search for a string in thousands of .info files and replace it . Notepad++ doesn't exist on Amiga I'm afraid... What software could do this? |
28 July 2022, 14:33 | #11 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
First, I would say that it isn't needed to scan all info files for QuitKey. Usually QuitKey is not set as tooltype.
If you still want to search in batch I would recommend to use an ARexx script using rexxtricks.library or rhm.library. Both have functions for tooltypes. |
28 July 2022, 14:41 | #12 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
You are right, there's only a handful of them... makes things both more difficult and easier.
I was going to copy everything on this directory to an NTFS partition and have my way with Windows tools. I don't think missing attributes like Protected or such are important for WHDLoad slaves? Thankfully tooltypes are in plain text and a string is easy to find. I just hope saving modifications to an Amiga file doesn't break it... My knowledge of Rexx is pretty lacking, so I'm not sure what to do with those libraries you're referring to. I'll see if I can find a way to use them, thank you for the tip! EDIT: Boom! Found it! I had the solution in front of me all this time... SimpleFind fished out all the .info files with the string QuitKey=! You were right daxb, on circa 1200 games, only 35 have this tooltype, and most of them use the one set in the prefs file anyway. Considering this as solved, thank you all for your help and suggestions and tips! Last edited by PoulpSquad; 28 July 2022 at 14:51. |
28 July 2022, 15:50 | #13 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Just in case someone is interested. I have an example ARexx script but my Amiga is offline. Hence I can't provide it. However, with e.g. rexxtricks.library it is simple:
Code:
call GETTOOLTYPES(<icon>, 'tooltypes') DO i = 1 TO tooltypes.0 SAY tooltypes.i END |
28 July 2022, 21:20 | #14 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
There's also a tool to change default tool: http://aminet.net/package/util/wb/Deft_II_v16
(a guy i used to work with, author of the excellent multifr) |
28 July 2022, 21:37 | #15 | |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
Quote:
|
|
28 July 2022, 21:53 | #16 |
Registered User
Join Date: Aug 2012
Location: Torelló, Spain
Age: 47
Posts: 93
|
Wow, that looks great...
Thanks a lot jotd, now I can go full anal-retentive with WHDLoad tooltypes! A dream come true! |
28 July 2022, 22:44 | #17 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,163
|
I'm not sure that it replaces tooltypes. It replaces default tool that's for sure. For the rest I don't remember.
|
28 July 2022, 23:07 | #18 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
bummer.
|
28 July 2022, 23:15 | #19 |
Registered User
Join Date: Oct 2021
Location: England
Posts: 1,172
|
never used it, but has anyone used something like https://aminet.net/package/util/wb/TTManager35c
or perhaps this cli tool: https://aminet.net/package/util/cli/ViewT it has the args: FILE/A,VIEW/S,ADD/K,DEL/K/N which would suggest being able to delete a specific tooltype ? that perhaps combined with LIST LFORMAT to find all info files in the WHDLoad games folder to produce a script to use ViewT to delete whats required? His instructions/spiel Code:
/* ViewT1.0 (ViewTooltypes) * * by Phil Dietz * 18-Jan-94 * * * DESCRIPTION: a *small* CLI program to view/edit ToolTypes for icons. * It's residentiable as well. PublicDomain with source included. * * * GIBBERISH: Here's a very simple program I threw together. * I made it cuz I was sick of having to use Workbench to view * or change an icons ToolTypes. My HD controller is quite slow * so manipulating an icon in a dir or layers of dirs is painful. * Who said C couldn't write small code...[cough cough] :-) * * * USAGE: ViewT FILE/A,VIEW/S,ADD/K,DEL/K/N * * FILE/A - Path of file icon to view (without .info extension) * VIEW/S - View's the tooltypes of the icon (default) * ADD/K - Add's the string after ADD to the icon's tooltypes * DEL/K/N- Delete's the number of the ToolType line shown by VIEW. * * ie show tooltypes: ViewT sys:wbstartup/SetDefMon * or ViewT sys:wbstartup/SetDefMon view * * add a type: ViewT sys:wbstartup/SetDefMon add "FOOD=BIG TACO" * * delete entry 5: ViewT sys:wbstartup/SetDefMon del 5 * |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ask Your Amiga: Wikipedia Search Tool ("AYA") | Weaselrama | News | 9 | 17 April 2021 22:00 |
Changing Icon Tool Type Values on Mass | manic23 | support.Other | 15 | 27 April 2019 15:39 |
Amiga Search Tool (for craigslist) | Crackersixx | Amiga scene | 3 | 01 February 2008 01:58 |
Replace 68040 | cybernoid | support.Hardware | 5 | 17 May 2007 21:33 |
Replace WB | Dr. Dude | support.Apps | 12 | 10 July 2004 15:59 |
|
|