[Script] Simple Claim Hotkey
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
[Script] Simple Claim Hotkey
So I decided one day that I wanted an easy way to claim ships that didn't have extra features bundled in, or required certain wares in my cargohold, or any of that. So, I made a script for it. It checks to ensure there is no pilot in your targeted ship, and if this condition is true, it makes it yours and writes a quick note in your log saying you claimed a ship. No sounds, no fanfare, just a ship that was once blue and is now green.
Download
Download
Last edited by Treelor on Thu, 3. Jan 13, 09:58, edited 1 time in total.
Try something like this:
You can take out the read text in favor of just hard-coding the name if you like.
Code: Select all
$GVar = 'Hotkey.Claim.Ship'
$Key = get global variable: name=$GVar
if not $Key
$Label = read text: page=7777 id=20013
$Key = register hotkey $Label to call script 'ClaimShipScript'
set global variable: name=$GVar value=$Key
end
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
For your setup script just use this code:
Replace GlobalVar with a global variable name, and ScriptName with the name of your script.
It will only make one hotkey using that.
Code: Select all
if not get global variable: name='GlobalVar'
$HK = register hotkey 'Cipher Game' to call script 'ScriptName'
set global variable: name='GlobalVar' value=$HK
end
It will only make one hotkey using that.
1940s - Various "computers" are "programmed" using direct wiring and switches. Engineers do this in order to avoid the tabs vs spaces debate.
- jack775544
- Posts: 1277
- Joined: Tue, 13. Dec 11, 08:27
Only checking the pilots name could be a problem, it is possible for the pilot to not exist but the ship to still be under a races control - if you want to be 100% certain that the target ship has bailed you can use this check:
Code: Select all
$Race = $Object-> get owner race
$Cmd = $Object-> get command
if $Race == [Neutral Race] AND $Cmd == [COMMAND_NONE]
* This ship has bailed.
end
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire
Current speed being zero while the ship isn't docked is also a nice indicator.
Ships always fly... somewhere. =)
Ships always fly... somewhere. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.