I work on a "Repair Drones" script, but I dont know how to code this:
- 4 items of "Repair Drone ware" in my ship
- 4 "Repair Drones" are created nearby my ship
- The script for "laser repair work" is finished but:
I want to launch all my drones at the same time on the same target,
but actualy, I wait to the 1rst drone finish the repair job then the 2nd drone can begin to work ??? no logic
There is my "poor" code:
Code: Select all
***
***
***
* CREATE DRONES AND MOVE TO TARGET POS
$drones.arr = array alloc: size=0
while $drones.ware.cnt
dec $drones.ware.cnt =
$drn = create ship: type={Argon Camera Drone 4771} owner= {Player} addto=$sector x=0 y=0 z=0
$drn ->set position: x=$x y=$y z=$z
$drn ->set name to 'Repair Drone'
= $ship ->install -1 units of $drone.ware
= $drn ->install 2 units of {1 MJ Shield}
= $drn ->install 1 units of {Repair Laser}
= $drn ->select best lasers for target $target in turret null: scan for friends null
$drn ->ignore collisions: [TRUE]
append $drn to array $drones.arr
= $drn ->call script 'plugin.PSCO1.repairDroneRepair' : victim=$target
= wait randomly from 1000 to 2000 ms
end
With this code, I need to wait the target to be repaired by the 1rst drone to see the others drones work... bad
(I tried also with sub menus but no success...)
Create Wing with a leader ?
Need to remove my loop in my called script ?
Another quick question about
Code: Select all
$target = [THIS] ->get user input: type={Var/Ship}, title=$text