EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
[Script/software] AP - Overtuning ships, the way of UFJD. Vanilla-friendly toolkit
Post new topic Reply to topic Goto page 1, 2  Next
View previous topic :: View next topic
Author Message
kurush



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3853 on topic

Thank you for registering your game
modified
PostPosted: Wed, 7. Mar 12, 00:24    Post subject: [Script/software] AP - Overtuning ships, the way of UFJD. Vanilla-friendly toolkit Reply with quote Print

As some people here might already know, we now have engine and rudder tunings in UFJD sectors. It is apparently expected that we map UFJD sectors in 200 km radius and cover them with advanced satellites to get those lucky finds. In practice it is not that exciting Smile

I realized that I need to automate the process after jumping to about 20 UFJD sectors manually in search for tuning crates.

Two scripts are included:

  1. A modified version of EJ's script that searches for containers. This version searches ONLY for tunings and also in the current sector ONLY. If it finds something, it opens a text input box to block any further input. You need to type "exit" in this input box or it will re-open. This is to block actions from the second script. It also jumps your ship far away from the sector center to avoid death by Xenons (death will close the input box). The script is named aaaaa.findwares.conditional and should appear as the first script in the list for script editor.
  2. A script for Authotkey (http://www.autohotkey.com/) . This scripts repeatedly jumps you to UFJD sector and back. Once in UFJD, it saves, activates the script editor, runs the first script and then reloads. If the first script is blocking the input, it won't be able to reload and the action will stop with a save available in UFJD sector with a tuning container.

What you will need:

  • Autohotkey installed
  • A lot of salvage insurance (1000+)
  • A lot of EC (1500 should be sufficient to get at least one hit even if you are very unlucky)
  • UFJD mapped to the right windows key (or some other key, but then autohotkey script will need to be changed)
  • A ship to overtune
  • Advanced Satellite
  • A moderately fast computer that can load a save game in less than 30-35 seconds.


Download URL: http://tiny.cc/tunings

Installation.

  1. Copy aaaaa.findwares.conditional.xml to addon/scripts subfolder of X3 installation
  2. Install and start autohotkey
  3. Right-click on autohotkey icon in the system tray and select "Edit this script". Notepad will open, replace what you see in it with the the contents of Autohotkey.ahk and save (you can also just copy this file into your windows Documents folder).
  4. Right-click on autohotkey in system tray and select "Reload this script"
  5. MAKE A BACKUP OF ALL YOUR SAVES
  6. Note that the script will repeatedly overwrite the 1-st save on the list.
  7. Start X3AP, activate the script editor, make sure aaaaa.findwares.conditional.xml is the first script on the list. If not, either rename it with more aaaaa or change the autohotkey script (look for the comments there).



Running

  1. Reload a game that is not modified.
  2. Make sure CAPS LOCK is OFF. The autohotkey script uses CAPS LOCK as a toggle to switch itself off.
  3. Make sure UFJD is mapped to the right windows key (normally, the one right of the right Alt). You can change the key in autohotkey script as well.
  4. Jump into a relatively empty sector that doesn't produce a lot of lag upon entry
  5. press Alt N. You should see SETA being activated after short period of time.
  6. After this DO NOT TOUCH THE KEYBOARD. You cannot minimize the game. If you want to stop the script, turn on CAPS LOCK. Once you activate it, the script will stop running after some time.
  7. Once you see a popup box on the screen saying 1 Engine Tuning or 1 Rudder Optimization in the title, congratulations, you found a crate. Stop the script by activating CAPS LOCK (wait a bit for it to actually stop) and then type "exit" to close the input box. The script will print the coordinates of the tunings container. Write them down or remember them.
  8. Reload the game from the 1-st slot and order your ship to go to the coordinates you recorded. Engine Tuning will become visible once you get close, for rudder optimizations you will need to drop an advanced satellite before you can see them.
  9. Once you collected your crate, jump away manually and save your game to a slot other than the first. It is a good idea to check that your game is still not modified in case something went wrong.
  10. Repeat as needed



_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here


Last edited by kurush on Mon, 21. Jan 13, 10:23; edited 5 times in total
Back to top
View user's profile Send private message
sadron





Joined: 28 Dec 2011
Posts: 630 on topic

Thank you for registering your game
PostPosted: Wed, 7. Mar 12, 01:58    Post subject: Reply with quote Print

I gotta bookmark this so I remember when I try to use it. Thanks for making this topic.

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





Joined: 31 Dec 2009
Posts: 74 on topic

Thank you for registering your game
PostPosted: Fri, 9. Mar 12, 17:51    Post subject: Reply with quote Print

nice macro, but i think it can run more efficiently if you make it load from a different save state. for example, before you start the macro, make a save in slot 10 (assuming you have no autosaves) then instead of loading from the top load from the bottom with input (pgdn). then you can cut out the entire part after the load where you jump back into the known sectors. plus this way you don't need a million energy or insurance and you don't waste game time jumping in and out while the rest of your ships start idling or run into enemies.




for anyone who can't figure out what to change, this is what the end of the edited macro looks like starting from after it runs the script, so basically everything from the shift L to the bottom

Code:
SendInput +l
  Sleep 300
  SendInput {PgDn}
  Sleep 300
  SendInput {Enter}
  Sleep 300
  SendInput {Enter}
;Time it takes to load a game
  Sleep 45000
  SendInput {Del}
  Sleep 300
}
return


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



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3853 on topic

Thank you for registering your game
PostPosted: Fri, 9. Mar 12, 20:04    Post subject: Reply with quote Print

Quote:
but i think it can run more efficiently if you make it load from a different save state. for example, before you start the macro, make a save in slot 10 (assuming you have no autosaves)

I thought about this, but then I like my empire to run while my ships are being overturned. If you didn't plan your empire to run on auto-pilot or want to save on salvage insurance, then yes, you might want to change that. The delay times are rather high as well, it should be possible to tweak them to match the actual performance of your system.
I ended up adding auto-detection for the situation when you find the crate to stop the Autohotkey macro and send me a message Smile


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
sadron





Joined: 28 Dec 2011
Posts: 630 on topic

Thank you for registering your game
PostPosted: Fri, 9. Mar 12, 22:44    Post subject: Reply with quote Print

I think I did it wrong, I can't get it to work...

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



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3853 on topic

Thank you for registering your game
PostPosted: Fri, 9. Mar 12, 22:45    Post subject: Reply with quote Print

sadron wrote:
I think I did it wrong, I can't get it to work...

Would you be able to provide more details what didn't work?


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
Lord0bsidian





Joined: 31 Dec 2009
Posts: 74 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 01:28    Post subject: Reply with quote Print

first tell us what you did. make sure the button presses in the macro matches your in game hotkey setup. then if you feel up to it sit through one cycle and try to see where it's messing up. if you did the setup right, chances are your computer is taking longer to save or jump than the macro allows for so you'll have to change the times. the times in the macro are in milliseconds.

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





Joined: 28 Dec 2011
Posts: 630 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 06:46    Post subject: Reply with quote Print

I think the script for autokey isn't being run when I run the ingame script. Plus I don't have whatever is needed for the Alt-N hotkey combo.

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



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3853 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 07:31    Post subject: Reply with quote Print

sadron wrote:
I think the script for autokey isn't being run when I run the ingame script. Plus I don't have whatever is needed for the Alt-N hotkey combo.

You don't run the ingame script manually (or, rather run it only once to make sure it shows in the first position in the script editor). You need to download and install the free software called autohotkey (the link in the original post, click Download there or use this direct link). This software replays keyboard shortcuts for X jumping you to UFJD and back and it also starts the ingame script. It is activated when the following two conditions are true
a) It is started and is showing in your windows system tray (green H icon)
b) You press Alt-N while in game
It will be stopped if you turn on the CAPS LOCK key

Basically, it does the job of jumping back and forth and running the in-game detection script every time for you. Nothing you couldn't do yourself if you are patient enough Wink


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
sadron





Joined: 28 Dec 2011
Posts: 630 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 08:27    Post subject: Reply with quote Print

Sorry I should have clarified, I DO have Autokey downloaded. I'm just saying it didn't catch, so as far as I know the script wasn't running.

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



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3853 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 08:31    Post subject: Reply with quote Print

sadron wrote:
Sorry I should have clarified, I DO have Autokey downloaded. I'm just saying it didn't catch, so as far as I know the script wasn't running.

Check your system tray for this icon:

If Autohotkey is started, it should be there . If you have it, right-click on it and in the menu select "Edit this script". Windows notepad with the current script should open. Check that you have my script there and not the default sample script coming with autohotkey.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
Lord0bsidian





Joined: 31 Dec 2009
Posts: 74 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 14:18    Post subject: Reply with quote Print

sadron wrote:
I think the script for autokey isn't being run when I run the ingame script. Plus I don't have whatever is needed for the Alt-N hotkey combo.


autohotkey is basically a separate program that presses buttons for you. in other words, the in game script doesn't run autohotkey, autohotkey is supposed to run the in game script, along with all the jumping in and out of ufjd, saving, loading, etc.

this particular autohotkey macro is supposed to do a series of things in this exact order:

activate ufjd (press whatever hotkey you set for ufjd)
activate seta (press j)
wait until you jump into ufjd
save in slot 1 (press shift s, etc)
wait until you finish saving
turn on script editor (press various menu hotkeys to get to the name change and type in thereshallbewings)
wait for script editor to turn on
run the script (various autopilot menu hotkeys)

-here the in game script puts out a popup that stops the macro if it finds something, but if it doesn't the macro keeps going to:

load (press shift l, etc)
wait until you finish loading
jump out of ufjd (press shift j)
activate seta (press j)
wait until you finish jumping
repeat from top


the things you need to change in the macro file yourself are all the hotkeys for the relevant menu items and the times for all the waiting periods. you should leave 5000-10000ms extra on each time in case of lag spikes.

one more thing to note is that the popup doesn't actually stop the macro per se, just puts out a text box so that the autohotkey button presses become typed letters instead of menu hotkeys so you have to alt tab out and reset the macro before reloading your save and getting the tuning or the macro will keep going while you're trying to do other things

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



MEDALMEDALMEDAL

Joined: 07 Nov 2005
Posts: 3853 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 18:29    Post subject: Reply with quote Print

Lord0bsidian wrote:

activate ufjd (press whatever hotkey you set for ufjd)

Small clarification: it is preconfigured with right windows key

If you don't have it set for your UFJD, macro won't work. You still should see some activity on the screen such as saving the game.
Quote:

one more thing to note is that the popup doesn't actually stop the macro per se, just puts out a text box so that the autohotkey button presses become typed letters instead of menu hotkeys so you have to alt tab out and reset the macro before reloading your save and getting the tuning or the macro will keep going while you're trying to do other things

You can also press CAPS-LOCK to force the macro switch itself off.


_________________

Overtuning assistance in Albion Prelude
Want to run any script or mod without ***modified***? Click here
Back to top
View user's profile Send private message
sadron





Joined: 28 Dec 2011
Posts: 630 on topic

Thank you for registering your game
PostPosted: Sat, 10. Mar 12, 19:10    Post subject: Reply with quote Print

I did try all this, I might have just missed something. I'll go over the steps and see if I can get it running again sometime soon.

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





Joined: 28 Apr 2004



modified
PostPosted: Sat, 17. Mar 12, 23:36    Post subject: Reply with quote Print

I ran this script for quite a while and nothing showed up. After each run, "NOTHING IS FOUND" message is shown even though i can see Energy cells in sector map. Is this script supposed to list everything in sector but only show a popup if an engine tuning/rudder optimization is found, or list only the engine tuning/rudder optimizations but nothing else?

*edit* ok it works fine, seems i was on a unlucky roll, after 4 hours it gave me 1 engine tuning Smile


_________________
Death is lighter than a feather, duty heavier than a mountain
Borderlander Saying


Last edited by Gaidin on Sun, 18. Mar 12, 09:21; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic Goto page 1, 2  Next
 
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 Thu, 23. May 13, 05:27

All times are GMT + 2 Hours


Board Security

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