EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[SCRIPT] Remove Hotkeys - v2
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Graxster





Joined: 14 Oct 2006
Posts: 814 on topic

Thank you for registering your game
modified
PostPosted: Tue, 25. Nov 08, 02:14    Post subject: [SCRIPT] Remove Hotkeys - v2 Reply with quote Print

Remove Hotkeys

This is a powerful tool that will allow you to remove hotkey entries that you no longer use or want, and that the author of the script didn't provide uninstall scripts for. It uses the new menu system to display a list of possible hotkeys. You then select a name from the list that you think is the correct one for your hotkey. Making a mistake will not break your game, but if you do make a mistake, you should re-load your last save and try again. The proper steps to take:

  • Look at your hotkeys in Controls > Interface and decide which you want to remove.

  • Run the script.

  • Select a name that appears to be the correct name.

  • Go to Controls > Interface and see if the hotkey is now gone.

  • If it's gone, save your game. If it's not gone, re-load your last save and try again.


If you follow those instructions, it's perfectly safe to use. Cool

You've been warned!

The reason I'm warning you: There's no scripting command, "Get such-and-such hotkey" or even "Get global variable; Is global variable a hotkey or something else?". Also, they're not always named "hotkey" or "key" either. So I have to display all the global variables. If you select the wrong one, it will set the value of that global variable to "null". Take a look at what you'll see:



I'm putting up 2 different versions for download. One requires Cycrow's Community Configuration Menu, the other (for those that don't use/want the CCM) can be run from the script editor. Sorry, no SPK version this time. Enjoy!

-Grax

---------------------------------------------------------------------------------------------

Update: Should now display only hotkeys (or pretty close to that)

Update - Version 2: Now works correctly (left out a file, lol). Added Emergency Hotkey Removal.

WARNING: I can not be held responsible for you deciding to use the Emergency Hotkey Removal tool. Very Happy
Selecting this option should remove ALL hotkeys, regardless of whether they were registered correctly or not.

---------------------------------------------------------------------------------------------

RAR Archive - Requires Cycrow's CCM



RAR Archive - run from script editor





Last edited by Graxster on Wed, 26. Nov 08, 05:36; edited 3 times in total
Back to top
View user's profile Send private message
angrysquirrel





Joined: 18 Nov 2003
Posts: 266 on topic

Thank you for registering your game
PostPosted: Tue, 25. Nov 08, 02:35    Post subject: Reply with quote Print

dude that's a great tool! I remember having multiple hotkeys of same item in x3 when I reinstalled the script multiple times. That is why I like this tool Finally some way to fix the problem. Smile Where do I put the script files though? In the scripts directory? (just want to make sure).

Back to top
View user's profile Send private message
jimhsu77479





Joined: 25 Nov 2007



PostPosted: Tue, 25. Nov 08, 02:38    Post subject: Reply with quote Print

Wow I needed this yesterday ... was manually going through 50 extra hotkeys and guessing which ones were extra.

Back to top
View user's profile Send private message
Graxster





Joined: 14 Oct 2006
Posts: 814 on topic

Thank you for registering your game
PostPosted: Tue, 25. Nov 08, 06:14    Post subject: Reply with quote Print

Yes, put it in the scripts directory.

-G

Back to top
View user's profile Send private message
rubberman





Joined: 06 Nov 2002
Posts: 87 on topic
Location: Burton upon trent
Thank you for registering your game
PostPosted: Tue, 25. Nov 08, 21:41    Post subject: Reply with quote Print

Something odd here the menu appears blank in game, both versions attempted

Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20457 on topic
Location: London
Thank you for registering your game
PostPosted: Tue, 25. Nov 08, 21:46    Post subject: Reply with quote Print

i have a few suggestions

1. Add the ability to filter certain ones. Ie, filter something like *key*. Make an option to turn it off or on. Then you can get most of them without all the extras

2. Remove the ones you definatly know are not keys, ie, any page ones. so you dont need to list them all


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ThisIsHarsh





Joined: 19 Oct 2008
Posts: 1132 on topic

Thank you for registering your game
PostPosted: Tue, 25. Nov 08, 23:10    Post subject: Reply with quote Print

Yeah also, hotkeys are numbers, so no need to show any globals that do not reference numbers.

Here is my script to unregister all hotkeys *not* assigned to a global variable (i.e. added without realising you need to store a global to remove them later Rolling Eyes ), maybe you can find bits of it useful:

Code:


001   $global.arr =  get global variables: regular expression='.*'
002   
003   $id = 2000
004   
005   while $id
006   |$found = [FALSE]
007   |$global.idx =  size of array $global.arr
008   |
009   |while $global.idx
010   ||dec $global.idx =
011   ||$global = $global.arr[$global.idx]
012   ||$global.value = get global variable: name=$global
013   ||if $global.value == $id
014   |||$found = [TRUE]
015   |||break
016   ||end
017   |end
018   |
019   |skip if $found
020   ||unregister hotkey $id
021   |
022   |dec $id =
023   end
024   
025   return null


Back to top
View user's profile Send private message
bounty_hunter66





Joined: 15 Aug 2006
Posts: 465 on topic

Thank you for registering your game
PostPosted: Wed, 26. Nov 08, 00:30    Post subject: Reply with quote Print

No hotkeys are shown up in that menu despite i have alot of hotkeys

Back to top
View user's profile Send private message Yahoo Messenger
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20457 on topic
Location: London
Thank you for registering your game
PostPosted: Wed, 26. Nov 08, 00:35    Post subject: Reply with quote Print

bounty_hunter66 wrote:
No hotkeys are shown up in that menu despite i have alot of hotkeys


just do you know, the script doesn't display what hotkeys you have, it display what hotkeys scripts have properly registered, ie, they have stored thier global varible of the key.

if the script fails to do this and you end up with lots of hotkeys for the same, then this wont help you


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Graxster





Joined: 14 Oct 2006
Posts: 814 on topic

Thank you for registering your game
PostPosted: Wed, 26. Nov 08, 01:12    Post subject: Reply with quote Print

I tried that, but apparently either the script engine is wacky, or it doesn't agree with me. I tried:

Code:

$name= get global variable name: $text
skip if not is datatype [DATATYPE_INT] $name
.. (add to menu)


Now, to me, DATATYPE_INT means "datatype integer", which is any number, right? Now although all the hotkey $names were coming back as numbers (verified by writing to logbook), using the above filter results in nothing being added to the menu.

Confused

-Grax

Back to top
View user's profile Send private message
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)



Joined: 15 Nov 2004
Posts: 20457 on topic
Location: London
Thank you for registering your game
PostPosted: Wed, 26. Nov 08, 01:20    Post subject: Reply with quote Print

u sure thats how the command appears, as it should look like

is datatyp [ $name ] == DATATYP_INT


_________________
My Scripts | MY X3TC Scripts | X3 Plugin Manager | Custom Gui
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Graxster





Joined: 14 Oct 2006
Posts: 814 on topic

Thank you for registering your game
PostPosted: Wed, 26. Nov 08, 01:50    Post subject: Reply with quote Print

Yeah, that was me being a dumba$$, rofl. Thanks! I knew that too! Too much scripting, not enough gaming! Cool

-G

Edit: Thanks guys, got it narrowed down now. Should be less confusing now.

Edit 2: Sorry ppl, if it wasn't working or appeared blank, please re-download. I forgot to include a file. Should be working now.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Fri, 20. Oct 17, 14:22

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.40749 seconds, sql queries = 26