Author Topic: Get lastspoken token and run it ? need help  (Read 2328 times)

megs

  • Guest
Get lastspoken token and run it ? need help
« on: July 23, 2017, 06:04:41 PM »
ou can use the "Execute Another Command" action's "Execute by name (Advanced)" option for this:
Code: [Select]

Execute command, '{TXT:VarLASTSPOKENCMD}' (by name)


Where the first command would contain
Code: [Select]

Set Text [VarLASTSPOKENCMD] to '{LASTSPOKENCMD}'
« Last Edit: July 23, 2017, 06:55:34 PM by megs »

megs

  • Guest
Re: Get lastspoken token and run it
« Reply #1 on: July 23, 2017, 06:12:18 PM »
Nop, not functioning.
 
the command who execute last saved command said me : NOT SET.


context:

command prefix spoken : select
Code: [Select]
set text [VarAction] to 'select'

command suffix spoken : friendly ship
Code: [Select]
set text [VarLASTSPOKENCMD] to [{LASTSPOKENCMD}]
press U key and hold for 0.1 seconds and release
Set Text [VarAction] to '.'

(repeat command)
command full spoken : next ship
Code: [Select]
Executecommand, '{TXT:VarLASTSPOKENCMD}' (byname) (and wait until it complete execution)
Set Text [VarAction] to '.'

next ship command return could not execute 'NOT SET' (byname), COMMAND NOT AVAILABLE

say '' method show the command returned was  ( 'not set' )

any idear ?
« Last Edit: July 23, 2017, 07:15:26 PM by megs »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Get lastspoken token and run it ? need help
« Reply #2 on: July 23, 2017, 07:54:25 PM »
One the one hand, it returns "Not Set" because you're using the "A variable" field for the "Set a Text Value" action rather than the "Text" field.

On the other, prefix/suffix commands cannot be executed by name currently, even though this isn't mentioned as a limitation in the documentation, so it won't work either way.

I've filed a bug report here.


As another side note, you can right-click any item in the action list and click "Copy All as Text", so you don't have to retype it for pasting on the forum.

megs

  • Guest
Re: Get lastspoken token and run it ? need help (1.6.7)(1.6.7.5)
« Reply #3 on: July 24, 2017, 02:32:25 AM »
i have resolved the problem to get token in prefixed, by setting directly vars whith défault spoken command, but
is there any solution to execute a prefixed/suffixed command ?

I think doing direct call of prefixed command is very important because of keeping computer ressources, know what calling sub function cause in memory and processor impact ( stacking overflow could come quickly when a powerfull game is running side off voice attack , and i dont speack about memory amount used when freezing process and awaitting execution of subfunctions). I prefer do not using it if i can.

i could use serialized full function and execute them into suffixed command, but it was very ugly and dirty...

please GARY, implement/correct it ( or explain to me that i should do), i think it is important to optimize your scripts command.

and you May add a special token {LASTPREFIXEDSPOKENCMD} that was containing last prefixed spoken command usable in prefixed commands, say commands, and var translation TXT, executing it at last.


thanks in advance.
« Last Edit: July 24, 2017, 04:59:37 AM by megs »