Дополнение к Пособию Скрипты. Что это и с чем их едят. cent...
X3 Terran Conflict / X3 Земной конфликт
 
X3 Terran conflict  
 

На сайте онлайн (человек): 84



 



Дополнение к Пособию Скрипты. Что это и с чем их едят. cent...

Terran Conflict (X3TC) / Форум / Скрипты и моды для X3 Terran Conflict / Учимся простейшим скриптам

Учимся простейшим скриптам
(http://x3tc.net/x3_forum/?tid=672)
Автор: Malstrime
(30.04.2010 16:39:35)

 
Дополнение к Пособию "Скрипты. Что это и с чем их едят."
 

Список всех скриптовых команд. Часть 1.

  • Общие команды
     Код:
    1. <RetVar/IF><Expression>
    2. inc <RetVar>
    3. dec <RetVar>
    4. @ <RetVar/IF> wait <Var/Number> ms
    5. @ <RetVar/IF> wait randomly from <Var/Number> to <Var/Number> ms
    6. <RetVar/IF> = random value from 0 to <Var/Number> - 1
    7. <RetVar> = random value from <Var/Number> to <Var/Number> - 1
    8. * <Comment>
    9. <RetVar> = script engine version
    10. <RetVar> = get script version
    11. <RetVar/IF> is a new script version available
    12. <RetVar> = get script name
    13. <RetVar> = get script priority
    14. set script priority to <Var/Number>
    15. infinite loop detection enabled=<Var/Number>
    16. <RetVar/IF> is script with prio <Var/Number> on stack
    17. <RetVar/IF> get task ID
    18. <RetVar/IF> get PID
    19. enable signal/interrupt handling: <Var/Number>
    20. <RetVar/IF> is signal/interrupt handling on
    21. <RefObj> -> set local variable: name=<Var/String> value=<Value>
    22. <RetVar/IF> <RefObj> -> get local variable: name=<Var/String>
    23. set global variable: name=<Var/String> value=<Value>
    24. <RetVar/IF> get global variable: name=<Var/String>
    25. <RetVar> = datatyp[<Value>]
    26. <RetVar/IF> is datatyp[<Value>] == <Var/Script Data Type>
    27. <RetVar> = read text: page=<Var/Number> id=<Var/Number>
    28. <RetVar/IF> read text: page id=<Var/Number>, from <Var/Number> to <Var/Number> to array, include empty=<Var/Number>
    29. <RetVar/IF> read text: page id=<Var/Number>, id=<Var/Number> exists
    30. <RetVar> = sprintf: fmt=<Var/String>, <Value>, <Value>, <Value>, <Value>, <Value>
    31. <RetVar> = sprintf: pageid=<Var/Number> textid=<Var/Number>, <Value>, <Value>, <Value>, <Value>, <Value>
    32. load text: id=<Var/Number>
    33. <RetVar/IF> state of news article: page=<Var/Number> id=<Var/Number>
    34. set state of news article page=<Var/Number> id=<Var/Number> to <Var/Number>
    35. <RetVar/IF> system date is month=<Var/Number>, day=<Var/Number>
    36. <RetVar> = playing time
    37. <RetVar/IF> is plot <Var/Number> state flag <Var/Number>
    38. <RetVar> = register hotkey <Var/String> to call script <Script Name>
    39. <RetVar> = register hotkey <Var/String> to call script name <Var/String>
    40. unregister hotkey <Var/Number>
    41. <RetVar> = last load time
    42. <RetVar/IF> <RefObj> -> get all local variable keys, starting with=<Var/String>
    43. <RetVar/IF> get all global variable keys, starting with=<Var/String>
    44. <RetVar/IF> <RefObj> -> get local variables: regular expression=<Var/String>
    45. <RetVar/IF> get global variables: regular expression=<Var/String>
    46. <RetVar> = get maximum, <Var/Number>, <Var/Number>, <Var/Number>, <Var/Number>, <Var/Number>
     


  • Общие команды - Управление исполнением цикла
     Код:
    1. end conditional
    2. else
    3. continue
    4. break
    5. goto label <Label>
    6. gosub <Label>
    7. define label <Label>
    8. endsub
     

  • Общие команды - Вызовы скриптов
     Код:
    1. @ <RetVar/IF/START><RefObj> call script <Script Name> : <Parameter>
    2. <RefObj> interrupt with script <Script Name> and prio <Var/Number>: arg1=<Value> arg2=<Value> arg3=<Value> arg4=<Value>
    3. <RefObj> interrupt task <Var/Number> with script <Script Name> and prio <Var/Number>: arg1=<Value> arg2=<Value> arg3=<Value> arg4=<Value>
    4. <RefObj> start task <Var/Number> with script <Script Name> and prio <Var/Number>: arg1=<Value> arg2=<Value> arg3=<Value> arg4=<Value> arg5=<Value>
    5. return <Value>
    6. <RetVar/IF> <RefObj> -> is script <Script Name> on stack of task=<Var/Number>
    7. <RetVar/IF> <RefObj> -> is task <Var/Number> in use
    8. <RetVar/IF> <RefObj> -> call named script: script=<Var/String>, <Value>, <Value>, <Value>, <Value>, <Value>
    9. <RefObj> -> start named script: task=<Var/Number> scriptname=<Var/String> prio=<Var/Number>, <Value>, <Value>, <Value>, <Value>, <Value>
    10. <RetVar> = <RefObj> -> get next available task: starting=<Var/Number>
    11. <RefObj> -> interrupt with script <Script Name> and prio <Var/Number>
     

  • Общие команды - Массивы
     Код:
    1. <RetVar> = array alloc: size=<Var/Number>
    2. <RetVar/IF><Var/Array>[<Var/Number>]
    3. <Var/Array>[<Var/Number>] = <Value>
    4. <RetVar/IF><Var/Array>[<Var/Number>][<Var/Number>]
    5. <Var/Array>[<Var/Number>][<Var/Number>] = <Value>
    6. <RetVar/IF> size of array <Var/Array>
    7. <RetVar> = clone array <Var/Array>: index <Var/Number> ... <Var/Number>
    8. copy array <Var/Array> index <Var/Number> ... <Var/Number> into array <Var/Array> at index <Var/Number>
    9. insert <Value> into array <Var/Array> at index <Var/Number>
    10. append <Value> to array <Var/Array>
    11. remove element from array <Var/Array> at index <Var/Number>
    12. resize array <Var/Array> to <Var/Number>
    13. <RetVar> = get index of <Value> in array <Var/Array> offset=<Var/Number> + 1
    14. <Var/Array>[<Var/Number>] = <Var/Array>[<Var/Number>]
    15. <RetVar> = sort array <Value>
    16. <RetVar> = sort array: data=<Value> sort values=<Value>
    17. <RetVar/IF> find <Value> in array: <Value>
    18. <RetVar> = create new array, arguments=<Value>, <Value>, <Value>, <Value>, <Value>
    19. <RetVar/IF> reverse array <Value>
    20. <RetVar/IF> arrays <Value> and <Value> are equal
     


  • Общие команды - Строки
     Код:
    1. <RetVar/IF> get length of string <Var/String>
    2. <RetVar> = find position of pattern <Var/String> in <Var/String>
    3. <RetVar> = get substring of <Var/String> offset=<Var/Number> length=<Var/Number>
    4. <RetVar> = string <Var/String> to integer
    5. <RetVar> = substitute in string <Var/String>: pattern <Var/String> with <Var/String>
    6. <RetVar> = convert number <Var/Number> to string
    7. <RetVar> = format time: <Var/Number>
    8. <RetVar/IF> match regular expression: <Var/String> to string <Var/String>
    9. <RetVar/IF> get string font length: <Var/String>
     

  • Общие команды - Вычисления
     Код:
    1. <RetVar> = = fixed sin <Var/Number>
    2. <RetVar> = = fixed cos <Var/Number>
    3. <RetVar> = square root of <Var/Number>
     


  • Общие команды - Команды/Сигналы
     Код:
    1. <RefObj> -> connect ship command/signal <Object Command/Signal> to script <Script Name> with prio <Var/Number>
    2. <RefObj> -> set ship command/signal <Object Command/Signal> to global default behaviour
    3. <RefObj> -> ignore ship command/signal <Object Command/Signal>
    4. <RefObj> -> add secondary signal: signal=<Object Signal>, script=<Script Name>, prio=<Var/Number>, name=<Var/String>
    5. <RefObj> -> remove secondary signal: signal=<Object Signal>, name=<Var/String>
    6. global secondary signal map: add signal=<Object Signal> race=<Var/Race> class=<Var/Class> script=<Script Name> prio=<Var/Number> name=<Var/String>
    7. global secondary signal map: remove signal=<Object Signal> race=<Var/Race> class=<Var/Class> name=<Var/String>
    8. global script map: set: key=<Object Command/Signal>, class=<Var/Class>, race=<Var/Race>, script=<Script Name>, prio=<Var/Number>
    9. global script map: remove: key=<Object Command/Signal>, class=<Var/Class>, race=<Var/Race>
    10. global script map: ignore: key=<Object Command/Signal>, class=<Var/Class>, race=<Var/Race>
    11. set script command upgrade: command=<Object Command/Signal> upgrade=<Var/Ware>
    12. <RetVar> = get script command upgrade: command=<Object Command/Signal>
    13. set script command upgrade: command=<Object Command/Signal> upgrade=<Var/Ware> script=<Script Name>
    14. set ship command preload script: command=<Object Command/Signal> script=<Script Name>
    15. global script map for wings: key=<Var/Wing Command> race=<Var/Race> script=<Script Name> prio=<Var/Number>
    16. set script command upgrade: wing command=<Var/Wing Command> upgrade=<Var/Ware>
    17. set script command upgrade: wing command=<Var/Wing Command> upgrade=<Var/Ware> script=<Script Name>
    18. set wing command preload script: wing command=<Var/Wing Command> script=<Script Name>
    19. add ship custom command: id=<Var/Number>
    20. remove ship custom command: id=<Var/Number>
    21. <RetVar> = ship custom command exists: id=<Var/Number>
    22. set script command: <Object Command/Signal>
    23. <RetVar/IF> get script command
    24. set script command target: <Value>
    25. <RetVar/IF> get script command target
    26. <RefObj> -> connect wing command/signal <Object Command/Signal> to script <Script Name> with prio <Var/Number>
     

  • Аудио команды
     Код:
    1. play sample <Var/Number>
    2. play sample: incoming transmission <Var/Number>, from object <Value>
    3. <RefObj> -> send audio message <Var/Number> to player
    4. send incoming message <Var/String> to player: display it=<Var/Number>
    5. <RefObj> -> send incoming message: text=<Var/String> temporary=<Var/Boolean>
    6. send incoming question <Var/String> to player: callback=<Script Name>
    7. send incoming question <Var/String> to player: callback=<Script Name> flags=<Var/Number>
    8. <RetVar> = <RefObj> -> serialise object
    9. <RetVar/IF/START> speak text: page=<Var/Number> id=<Var/Number> priority=<Var/Number>
    10. display subtitle text: text=<Var/String> duration=<Var/Number> ms
    11. <RetVar/IF> <RefObj> -> get object name array
    12. <RetVar/IF> get text id: ware=<Var/Ware>
    13. <RetVar/IF/START> speak array: <Value> prio=<Var/Number>
     

  • Команды бортжурнала
     Код:
    1. write to player logbook <Value>
    2. write to player logbook: printf: fmt=<Var/String>, <Value>, <Value>, <Value>, <Value>, <Value>
    3. write to player logbook: printf: pageid=<Var/Number> textid=<Var/Number>, <Value>, <Value>, <Value>, <Value>, <Value>
    4. <RefObj> -> write to logbook <Value>
    5. write to log file <Var/Number> append=<Var/Number> value=<Value>
    6. write to log file <Var/Number> append=<Var/Number> printf: fmt=<Var/String>, <Value>, <Value>, <Value>, <Value>, <Value>
    7. write to log file <Var/Number> append=<Var/Number> printf: pageid=<Var/Number> textid=<Var/Number>, <Value>, <Value>, <Value>, <Value>, <Value>
     


  • Команды автопилота
     Код:
    1. @ <RetVar/IF> <RefObj> -> fly to home base
    2. @ <RetVar/IF> <RefObj> -> fly to station <Var/Station>
    3. @ <RetVar/IF> <RefObj> -> fly to sector <Var/Sector>
    4. <RetVar/IF> <RefObj> -> find nearest enemy ship: max.dist=<Var/Number>
    5. <RetVar/IF> <RefObj> -> find nearest enemy station: max.dist=<Var/Number>
    6. <RetVar/IF> <RefObj> -> fire lasers on target <Value> using turret <Var/Number>
    7. @ <RetVar/IF> <RefObj> -> turn turret <Var/Number> to target <Var/Ship/Station>: timeout=<Var/Number> ms
    8. @ <RetVar/IF> <RefObj> -> attack run on target <Value>: timeout=<Var/Number> ms
    9. @ <RetVar/IF> <RefObj> -> defensive move: type=<Var/Number>, intensity=<Var/Number>, timeout=<Var/Number> ms, avoid object=<Value>
    10. @ <RetVar/IF> <RefObj> -> move to ware object <Value> for collecting: timeout=<Var/Number> ms
    11. <RetVar/IF> <RefObj> -> catch ware object <Value>
    12. @ <RetVar/IF> <RefObj> -> move around <Var/Number> ms
    13. @ <RetVar/IF> <RefObj> -> escort ship <Var/Ship>
    14. @ <RetVar/IF> <RefObj> -> escort ship <Var/Ship>: timeout=<Var/Number> ms
    15. <RefObj> -> set formation <Var/Number>
    16. <RefObj> -> add to formation with leader <Var/Ship>
    17. <RefObj> -> remove from any formation
    18. <RetVar/IF> <RefObj> -> get formation leader
    19. <RetVar> = <RefObj> -> get formation follower ships
    20. <RetVar> = <RefObj> -> get formation
    21. <RetVar> = <RefObj> -> select new formation leader by: ship class=<Var/Number> strength=<Var/Number> min.speed=<Var/Number>
    22. <RetVar/IF> <RefObj> -> has formation ships
    23. <RefObj> -> give formation leadership to <Var/Ship>
    24. <RefObj> -> set as player wingman: <Var/Number>
    25. <RetVar/IF> <RefObj> -> is player wingman
    26. START <RefObj> -> command <Object Command>: arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
    27. START <RefObj> -> delayed command <Object Command>: arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
    28. <RefObj> -> send signal <Object Signal>: arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
    29. @ <RetVar/IF> <RefObj> -> follow object <Var/Ship> with precision <Var/Number> m
    30. @ <RetVar/IF> <RefObj> -> follow <Var/Ship> with precision <Var/Number> m : timeout=<Var/Number> ms
    31. <RefObj> -> set follow mode <Var/Number>
    32. <RetVar/IF> <RefObj> -> get follow mode
    33. <RetVar/IF> <RefObj> -> use jump drive: target=<Value>
    34. <RetVar/IF> <RefObj> -> needed jump drive energy for jump to sector <Var/String>
    35. <RefObj> -> set destination to <Value>
    36. <RetVar/IF> <RefObj> -> get destination
    37. <RefObj> -> set attack target to <Value>
    38. <RetVar/IF> <RefObj> -> get attack target
    39. @ <RetVar/IF> <RefObj> -> move to position: x=<Var/Number> y=<Var/Number> z=<Var/Number> with precision <Var/Number> m
    40. <RefObj> -> set command: <Object Command>
    41. <RetVar/IF> <RefObj> -> get command
    42. <RefObj> -> set command target: <Value>
    43. <RetVar/IF> <RefObj> -> get command target
    44. <RefObj> -> set command target2: <Value>
    45. <RetVar/IF> <RefObj> -> get command target2
    46. <RetVar/IF> get player tracking aim
    47. set player tracking aim to <RefObj>
    48. <RetVar/IF> <RefObj> -> is <Var/Ship/Station> in firing range of turret <Var/Number>
    49. <RetVar> = <RefObj> -> find enemy in firing range of turret <Var/Number>
    50. <RefObj> -> set command: <Object Command> target=<Value> target2=<Value> par1=<Value> par2=<Value>
    51. <RetVar/IF> <RefObj> -> fire missile <Var/Ware> on <Value>
    52. <RetVar/IF> <RefObj> -> fire missile <Var/Ware> from turret <Var/Number> on <Value>
    53. <RetVar/IF> <RefObj> -> find best missile for target <Value>
    54. <RetVar> = best missile type for target <Value>
    55. <RetVar/IF> <RefObj> -> get current missile
    56. <RetVar/IF> <RefObj> -> is missile <Var/Ware> ready to fire
    57. <RetVar/IF> <RefObj> -> should a missile be fired
    58. <RetVar> = <RefObj> -> get fire missile probability
    59. <RetVar> = <RefObj> -> get fire missile time difference in seconds
    60. <RefObj> -> set fire missile probability to <Var/Number>
    61. <RefObj> -> set fire missile time difference to <Var/Number> ms
    62. <RetVar/IF> <RefObj> -> check, select and fire missile on <Value>
    63. <RetVar/IF> <RefObj> -> launch <Var/Number> fight drones: protect me or attack target=<Value>
    64. <RetVar> = <RefObj> -> find nearest missile aiming to me
    65. <RetVar> = <RefObj> -> get array of missiles aiming to me
    66. <RetVar/IF> <RefObj> -> decouple ships
    67. <RetVar/IF> <RefObj> -> is decoupled ships leader
    68. <RetVar/IF> <RefObj> -> get current galaxy flight timestep in ms
    69. <RetVar/IF> <RefObj> -> is landing
    70. <RetVar/IF> <RefObj> -> is starting
    71. @ <RetVar/IF> <RefObj> -> move to position continue: x=<Var/Number> y=<Var/Number> z=<Var/Number> with precision <Var/Number> m
    72. <RetVar/IF> <RefObj> -> move to debris/asteroid <Value> and turn turret <Var/Number> to target: timeout=<Var/Number>
    73. <RetVar/IF> <RefObj> -> add big ship <Var/Ship>
    74. <RetVar/IF> <RefObj> -> has a free ship dock port: ship subtype = <Value>
    75. <RetVar/IF> <RefObj> -> can be controlled by race logic
    76. <RefObj> -> set race logic control enabled to <Var/Number>
    77. <RetVar/IF> <RefObj> -> can execute StartAction
    78. <RefObj> -> set StartAction enabled to <Var/Number>
    79. <RetVar/IF> <RefObj> -> get current action
    80. <RefObj> -> set pirate cover state to <Var/Number>
    81. <RetVar/IF> <RefObj> -> scan potential pirate <Var/Ship> for illegal wares
    82. @ <RetVar/IF> <RefObj> -> attack run on target <Value> : timeout=<Var/Number> ms speedlimit=<Var/Number>
    83. <RetVar> = <RefObj> -> get scanner range
    84. <RefObj> -> select and switch lasers for target <Var/Ship/Station> in turret <Var/Number>: scan for friends <Var/Number>
    85. <RetVar> = <RefObj> -> select best lasers for target <Var/Ship/Station> in turret <Var/Number>: scan for friends <Var/Number>
    86. <RefObj> -> start job
    87. <RetVar/IF> <RefObj> -> get job id
    88. <RetVar/IF> <RefObj> -> get job leader
    89. <RetVar> = <RefObj> -> get job idle rate
    90. <RetVar> = <RefObj> -> get job jump range
    91. <RetVar/IF> <RefObj> -> wait idle rate minimum: <Var/Number> ms
    92. <RetVar> = <RefObj> -> get flight time
    93. <RefObj> -> reset flight time
    94. <RefObj> -> auto sync patrol sector with environment: <Var/Number>
    95. <RefObj> -> add to patrol group for sector: <Var/Sector>
    96. <RefObj> -> remove from patrol group for sector: <Var/Sector>
    97. <RefObj> -> remove all patrol group references
    98. <RetVar> = <RefObj> -> find nearest enemy ship in range: class=<Var/Class>
    99. <RetVar> = get freight scanner range
    100. <RetVar> = get transporter range
    101. <RetVar> = get mineral scanner range
    102. <RetVar/IF> <RefObj> -> is in freight scanning range: ship=<Var/Ship>
    103. <RetVar/IF> <RefObj> -> is in transporter range: ship=<Var/Ship>
    104. <RetVar/IF> <RefObj> -> is in mineral scanner range: asteroid=<Var/Asteroid>
    105. <RetVar/IF> <RefObj> -> is autojump activated
    106. <RefObj> -> set autojump active: <Var/Number>
    107. <RetVar/IF> <RefObj> -> get autojump minimum jumps
    108. <RefObj> -> autojump minimum jumps = <Var/Number>
    109. <RetVar/IF> <RefObj> -> is emergency jump activated
    110. <RefObj> -> set emergency jump active: <Var/Number>
    111. <RetVar/IF> <RefObj> -> get emergency jump minimum shield threshold
    112. <RefObj> -> autojump emergency jump shield threshold = <Var/Number>%
    113. <RetVar/IF> <RefObj> -> get missile resupply: missile=<Var/Ware>
    114. <RefObj> -> set missile resupply: missile=<Var/Ware> amount=<Var/Number>
    115. <RetVar/IF> <RefObj> -> get ammo resupply: ammo=<Var/Ware>
    116. <RefObj> -> set ammo resupply: ammo=<Var/Ware> amount=<Var/Number>
    117. <RetVar/IF> <RefObj> -> get jumpdrive fuel resupply
    118. <RefObj> -> set jumpdrive fuel resupply: amount=<Var/Number>
    119. <RetVar/IF> <RefObj> -> send marines to board ship: <Var/Ship> marines=<Value>
    120. <RetVar/IF> <RefObj> -> launch boarding pod at target: victim=<Var/Ship> marines=<Value>
    121. <RetVar/IF> <RefObj> -> get resupply fuel required
    122. <RetVar/IF> <RefObj> -> get all formation followers
    123. <RetVar/IF> <RefObj> -> get highest formation leader
    124. <RetVar/IF> is player warping
    125. <RetVar/IF> <RefObj> -> get desired speed
    126. <RefObj> -> set desired speed: <Var/Number>
     

     
  • Команды автопилота - звенья
     Код:
    1. <RetVar/IF> create a new flight wing: name=<Var/String> race=<Var/Race>
    2. <RetVar/IF> find flight wing: name=<Var/String> race=<Var/Race>
    3. disband flight wing: wing=<Var/Wing>
    4. remove ship from flight wing: wing=<Var/Wing> ship=<Var/Ship>
    5. add ship to flight wing: wing=<Var/Wing> ship=<Var/Ship>
    6. <RetVar/IF> get flight wing ship array: wing=<Var/Wing>
    7. <RetVar/IF> get flight wing array
    8. <RefObj> -> add to flight wing: wing=<Var/Wing>
    9. <RefObj> -> remove from flight wing
    10. global script map for wings: key=<Var/Wing Command> race=<Var/Race> script=<Script Name> prio=<Var/Number>
    11. set script command upgrade: wing command=<Var/Wing Command> upgrade=<Var/Ware>
    12. set script command upgrade: wing command=<Var/Wing Command> upgrade=<Var/Ware> script=<Script Name>
    13. <RetVar> = get wing command upgrade: command=<Var/Wing Command>
    14. <RefObj> -> set wing command: <Var/Wing Command>
    15. <RefObj> -> set wing command: <Var/Wing Command> target=<Value> target2=<Value>
    16. <RetVar/IF> <RefObj> -> get wing natural formation
    17. <RefObj> -> set wing natural formation: formation=<Var/Number>
    18. <RetVar/IF> <RefObj> -> is temporarily removed from wing
    19. <RefObj> -> temporarily remove from wing
    20. <RefObj> -> return to wing
    21. <RetVar/IF> get predefined wing: wing=<Var/Number>
    22. <RefObj> -> add wing additional ship command: id=<Var/String> script=<Script Name> pageid=<Var/Number> textid=<Var/Number>
    23. <RefObj> -> add wing additional ship command: id=<Var/String> script=<Script Name> pageid=<Var/Number> textid=<Var/Number> checkscript=<Script Name>
    24. <RefObj> -> remove wing additional ship command: id=<Var/String>
    25. <RetVar/IF> <RefObj> -> does wing additional ship command exists: id=<Var/String>
    26. <RetVar/IF> <RefObj> -> get ship array for wing command upgrade: command=<Var/Wing Command>
    27. <RetVar/IF> <RefObj> -> ship has wing command upgrade: command=<Var/Wing Command>
    28. add wing custom command: id=<Var/Number>
    29. remove wing custom command: id=<Var/Number>
    30. <RetVar> = wing custom command exists: id=<Var/Number>
    31. START <RefObj> -> wing command <Var/Wing Command> : arg1=<Value>, arg2=<Value>, arg3=<Value>, arg4=<Value>
    32. <RetVar/IF> <RefObj> -> is in same wing as <Var/Ship>
    33. <RetVar/IF> <RefObj> -> get wing formation leaders
    34. <RetVar/IF> <RefObj> -> get temporarily removed ship array from wing
    35. set wing command preload script: wing command=<Var/Wing Command> script=<Script Name>
    36. <RetVar/IF> <RefObj> -> get number of wing formation leaders
    37. <RetVar/IF> <RefObj> -> get max number of ships per wing formation
     


  • Торговые команды
     Код:
    1. <RetVar/IF> get player money
    2. add money to player: <Var/Number>
    3. <RetVar/IF> <RefObj> -> add <Var/Number> units of <Var/Ware>
    4. <RetVar/IF> <RefObj> -> install <Var/Number> units of <Var/Ware>
    5. <RetVar> = get volume of ware <Var/Ware>
    6. <RetVar> = get transport class of ware <Var/Ware>
    7. <RetVar/IF> find station: product <Var/Ware> with best price: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    8. <RetVar/IF> <RefObj> -> find station: product <Var/Ware> with best price: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    9. <RetVar/IF> find station: product <Var/Ware> with min. jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    10. <RetVar/IF> <RefObj> -> find station: product <Var/Ware> with min. jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    11. <RetVar/IF> find station: resource <Var/Ware> with best price: min.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    12. <RetVar/IF> <RefObj> -> find station: resource <Var/Ware> with best price: min.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    13. <RetVar/IF> find station: resource <Var/Ware> with min. jumps: min.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    14. <RetVar/IF> <RefObj> -> find station: resource <Var/Ware> with min. jumps: min.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    15. <RetVar/IF> find station sells: resource <Var/Ware> with best price: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    16. <RetVar/IF> <RefObj> -> find station sells: resource <Var/Ware> with best price: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    17. <RetVar/IF> find station sells: resource <Var/Ware> with min. jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    18. <RetVar/IF> <RefObj> -> find station sells: resource <Var/Ware> with min. jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    19. <RetVar/IF> find station: product <Var/Ware> with best price depend on jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    20. <RetVar/IF> find station: resource <Var/Ware> with best price depend on jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    21. <RetVar/IF> find station sells: resource <Var/Ware> with best price depend on jumps: max.price=<Var/Number>, amount=<Var/Number>, max.jumps=<Var/Number>, startsector=<Var/Sector>, trader=<Var/Ship/Station>, exclude array=<Value>
    22. <RetVar> = get average price of ware <Var/Ware>
    23. <RetVar> = get max price of ware <Var/Ware>
    24. <RetVar> = get min price of ware <Var/Ware>
    25. <RetVar> = get max price of ware <Var/Ware> as secondary resource
    26. <RetVar> = get min price of ware <Var/Ware> as secondary resource
    27. <RetVar/IF> is ware <Var/Ware> illegal in <Var/Race> sectors
    28. <RetVar> = get maintype of ware <Var/Ware>
    29. <RetVar> = get subtype of ware <Var/Ware>
    30. <RetVar> = get ware from maintype <Var/Number> and subtype <Var/Number>
    31. <RetVar> = get number of subtypes of maintype <Var/Number>
    32. <RetVar> = <RefObj> -> get maintype
    33. <RetVar> = <RefObj> -> get subtype
    34. <RetVar> = get relvalue of <Var/Ware>
    35. <RetVar> = get notoriety required to buy ware: <Var/Ware>
    36. <RetVar/IF> is equipment: ware=<Var/Ware>
    37. <RetVar/IF> is upgrade: ware=<Var/Ware>
    38. <RetVar/IF> is inventory: ware=<Var/Ware>
     


  • Торговые команды - Для кораблей
     Код:
    1. <RetVar/IF> <RefObj> -> buy <Var/Number> units of <Var/Ware>
    2. <RetVar/IF> <RefObj> -> buy <Var/Number> units of <Var/Ware> to a max. price of <Var/Number> Cr
    3. <RetVar/IF> <RefObj> -> sell <Var/Number> units of <Var/Ware>
    4. <RetVar/IF> <RefObj> -> load <Var/Number> units of <Var/Ware>
    5. <RetVar/IF> <RefObj> -> unload <Var/Number> units of <Var/Ware>
    6. <RetVar> = <RefObj> -> get max. ware transport class
    7. <RetVar/IF> <RefObj> -> get cargo bay size
    8. <RetVar/IF> <RefObj> -> get free volume of cargo bay
    9. <RetVar/IF> <RefObj> -> get volume of ware <Var/Ware> in cargo bay
    10. <RetVar/IF> <RefObj> -> get true volume of ware <Var/Ware> in cargo bay
    11. <RetVar/IF> <RefObj> -> get free volume of ware <Var/Ware> in cargo bay
    12. <RetVar/IF> <RefObj> -> get total volume in cargo bay
    13. <RetVar/IF> <RefObj> -> can transport ware <Var/Ware>
    14. <RefObj> -> add default items to ship
    15. <RefObj> -> add lasers per value: <Var/Number> flags: <Var/Number>
    16. <RefObj> -> add shields per value: <Var/Number>
    17. <RefObj> -> switch laser in turret <Var/Number> gun <Var/Number> to <Var/Ware>
    18. <RefObj> -> set wanted ware count to <Var/Number>
    19. <RefObj> -> set wanted ware to <Var/Ware>
    20. <RetVar> = <RefObj> -> get wanted ware count
    21. <RetVar> = <RefObj> -> get wanted ware
    22. <RetVar/IF> <RefObj> -> has illegal ware onboard: race=<Var/Race>
    23. <RetVar/IF> <RefObj> -> get tradeable ware array from ship
    24. <RetVar> = get warearray for <Var/Ship>
    25. <RetVar> = <RefObj> -> get upgrade price: cargo-speed-rot <Var/Ware> units: <Var/Number>
    26. <RetVar/IF> <RefObj> -> get defined amount of ware <Var/Ware> as ship hardware
    27. <Var/Ware> <RefObj> -> set defined amount of ware <Var/Number> as ship hardware
    28. <RetVar> = <RefObj> -> get ship hardware as array
    29. <RetVar/IF> <RefObj> -> can buy ware <Var/Ware> at station <Var/Station>
    30. <RetVar/IF> <RefObj> -> can buy ware <Var/Ware> from race <Var/Race>
     


  • Торговые команды - Для станций
     Код:
    1. <RetVar/IF> <RefObj> -> get best store amount of ware <Var/Ware>
    2. <RetVar/IF> <RefObj> -> get max. store amount of ware <Var/Ware>
    3. <RetVar/IF> <RefObj> -> can buy ware <Var/Ware>
    4. <RetVar/IF> <RefObj> -> get intermediates buyable
    5. <RefObj> -> set intermediates buyable to <Var/Number>
    6. <RetVar/IF> <RefObj> -> can sell ware <Var/Ware>
    7. <RetVar/IF> <RefObj> -> get intermediates sellable
    8. <RefObj> -> set intermediates sellable to <Var/Number>
    9. <RetVar/IF> <RefObj> -> get price of ware <Var/Ware>
    10. <RetVar/IF> <RefObj> -> get average price of ware <Var/Ware>
    11. <RefObj> -> set price of ware <Var/Ware> to <Var/Number> Cr
    12. <RetVar/IF> <RefObj> -> uses ware <Var/Ware> as primary resource
    13. <RetVar/IF> <RefObj> -> uses ware <Var/Ware> as secondary resource
    14. <RetVar/IF> <RefObj> -> trades with ware <Var/Ware>
    15. <RetVar/IF> <RefObj> -> get product ware
    16. <RetVar/IF> <RefObj> -> get number of resources
    17. <RetVar/IF> <RefObj> -> get number of primary resources
    18. <RetVar/IF> <RefObj> -> get number of secondary resources
    19. <RetVar/IF> <RefObj> -> get max trade jumps
    20. <RefObj> -> set max trade jumps: <Var/Number>
    21. <RetVar/IF> <RefObj> -> only player own ships can trade with
    22. <RetVar> = <RefObj> -> get tradeable ware array from station
    23. <RetVar/IF> <RefObj> -> get products
    24. <RetVar/IF> <RefObj> -> uses ware <Var/Ware> as product
    25. <RetVar> = <RefObj> -> get production cycle time: account for secondary resources=<Var/Number>
    26. <RetVar> = <RefObj> -> get remaining production cycle time
    27. <RetVar> = <RefObj> -> get number of products per cycle
    28. <RetVar> = <RefObj> -> get number of products per cycle for ware <Var/Ware>
    29. <RetVar> = <RefObj> -> get production status: as percentage=<Var/Number>
    30. <RefObj> -> add product to factory or dock: <Var/Ware>
    31. <RefObj> -> add primary resource to factory: <Var/Ware>
    32. <RefObj> -> add second resource to factory: <Var/Ware>
    33. <RefObj> -> remove product from factory or dock: <Var/Ware>
    34. <RefObj> -> remove primary resource from factory: <Var/Ware>
    35. <RefObj> -> remove second resource from factory: <Var/Ware>
    36. <RefObj> -> factory production task: on=<Var/Number>
    37. <RetVar/IF> <RefObj> -> get repair cost of ship <Var/Ship>
    38. <RefObj> -> add default wares to station/dock
     


  • Торговые команды - Для кораблей и станций
     Код:
    1. <RetVar/IF> <RefObj> -> get money
    2. <RefObj> -> add money: <Var/Number>
    3. <RetVar/IF> <RefObj> -> get amount of ware <Var/Ware> in cargo bay
    4. <RetVar/IF> <RefObj> -> get true amount of ware <Var/Ware> in cargo bay
    5. <RetVar/IF> <RefObj> -> get free amount of ware <Var/Ware> in cargo bay
    6. <RetVar/IF> <RefObj> -> get max amount of ware <Var/Ware> that can be stored in cargo bay
    7. <RetVar/IF> <RefObj> -> get ware storage percentage: ware=<Var/Ware>
     


  • Торговые команды - Торговец
     Код:
    1. add merchant <Var/String> base=<RefObj> -> wanted wares=<Var/Array> owned wares=<Var/Array> cash=<Var/Number> rank=<Var/Number>
    2. <RetVar> = <RefObj> -> get merchants
    3. remove merchant <Var/String>
    4. merchant <Var/String> got ware <Var/Ware>: quantity=<Var/Number>
    5. merchant <Var/String> sold ware <Var/Ware>: quantity=<Var/Number>
    6. reset merchant <Var/String> expiry
    7. <RetVar> = get data for merchant <Var/String>: item number=<Var/Number>
     


  • Торговые команды - Пассажиры
     Код:
    1. <RetVar/IF> <RefObj> -> create passenger in ship: name=<Var/String> race=<Var/Race> voice=<Var/Number> face=<Var/Number>
    2. <RetVar/IF> <RefObj> -> add pilot of ship <Var/Ship> as passenger: disable ship=<Var/Boolean>
    3. <RetVar/IF> <RefObj> -> get passenger array
    4. <RetVar/IF> <RefObj> -> move passenger to ship <Var/Ship>: set passenger as pilot=<Var/Boolean>
    5. <RetVar/IF> <RefObj> -> eject passenger
    6. <RetVar/IF> <RefObj> -> enslave passenger
    7. <RetVar/IF> <RefObj> -> destroy passenger
    8. <RefObj> -> train passenger to marine
    9. <RefObj> -> create marine from passenger: fighting=<Var/Number> hacking=<Var/Number> mechanical=<Var/Number> engineering=<Var/Number>
    10. <RefObj> -> set marine skill: fighting=<Var/Number>
    11. <RefObj> -> set marine skill: hacking=<Var/Number>
    12. <RefObj> -> set marine skill: mechanical=<Var/Number>
    13. <RefObj> -> set marine skill: engineering=<Var/Number>
    14. <RetVar/IF> is marine: passenger/astronaut=<Var/Passenger>
    15. <RetVar/IF> <RefObj> -> can transport passenger: <Var/Passenger>
    16. <RetVar/IF> <RefObj> -> can launch marines
    17. <RetVar/IF> <RefObj> -> is ship boardable
    18. <RetVar/IF> <RefObj> -> get marines array
    19. <RetVar/IF> <RefObj> -> free space for marines
    20. <RefObj> -> set passenger transport, destination=<Var/Station>, payment=<Var/Number>
    21. <RetVar/IF> <RefObj> -> is passenger to be transported
    22. <RetVar/IF> <RefObj> -> get passenger transport destination
    23. <RetVar/IF> <RefObj> -> get passenger transport payment
    24. <RetVar/IF> <RefObj> -> get marine buy price
    25. <RetVar/IF> <RefObj> -> get number of marines can board
    26. <RetVar/IF> <RefObj> -> get maximum number of marines
    27. <RetVar/IF> <RefObj> -> get number of marines attacking
    28. <RetVar/IF> <RefObj> -> get incoming marines
    29. <RetVar/IF> <RefObj> -> get marine fighting skill
    30. <RetVar/IF> <RefObj> -> get marine hacking skill
    31. <RetVar/IF> <RefObj> -> get marine mechanical skill
    32. <RetVar/IF> <RefObj> -> get marine engineering skill
    33. <RetVar/IF> <RefObj> -> get marine overall skill
    34. <RetVar/IF> <RefObj> -> add marine <Value> to attack group on ship
    35. <RefObj> -> stop incoming marines
    36. <@RetVar/IF> <RefObj> -> move marine to board: <Value>, timeout=<Var/Number>
     
  • дерево темы → Учимся простейшим скриптам Учимся простейшим скриптам »
    Список игр