Task that let you chose between other tsk

Discuss RoboTask here
Post Reply
MainMan B
Posts: 6
Joined: Tue Sep 16, 2008 12:51 pm
Location: Denmark

Task that let you chose between other tsk

Post by MainMan B »

Hi,

I would like to know if it's possible to create a task
that let you choose between tasks you have created
earlier, maybe even choose more than one. I hope you
understand what I mean.

Regards,
Rasmus Bertelsen
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Task that let you chose between other tsk

Post by Oleg »

It's possible.

You may create the task with the following algorithm:

Input box // Input the number and save into NUM variable
if {NUM} = 1 then
   stert task task1
end if
if {NUM} = 2 then
   stert task task2
end if
if {NUM} = 3 then
   stert task task3
end if
... etc.
MainMan B
Posts: 6
Joined: Tue Sep 16, 2008 12:51 pm
Location: Denmark

Task that let you chose between other tsk

Post by MainMan B »

Should the: "if {NUM} = etc." statements be in the
variable you create, in the if then dialogue? I can't
seem to make it work.

Regards,
Rasmus Bertelsen
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Task that let you chose between other tsk

Post by Oleg »

See the example below:

;*****************************
;* RoboTask Task file       
;* Do not edit in text editor!
;*****************************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|700197831
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task700"
Hide=INTEGER|0
ID=INTEGER|370801753
Name=STRING|"Choose between"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_DIALOG_INPUTBOX"
Enabled=INTEGER|-1
Name=STRING|"Input Box"
Params=FOLDER

[Actions\Action1\Params]
default=STRING|"0"
prompt=STRING|"Type the number from 1 to 5"
variable=STRING|"NUM"

[Actions\Action10]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action11]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action11\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"1"
value1=STRING|"{num}"
value2=STRING|"4"

[Actions\Action12]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Here you may run the task #4"""
Params=FOLDER

[Actions\Action12\Params]
icon=STRING|"1"
msg0=STRING|"Here you may run the task #4"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action13]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action14]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action14\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"1"
value1=STRING|"{num}"
value2=STRING|"5"

[Actions\Action15]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Here you may run the task #5"""
Params=FOLDER

[Actions\Action15\Params]
icon=STRING|"1"
msg0=STRING|"Here you may run the task #5"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action16]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"1"
value1=STRING|"{num}"
value2=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Here you may run the task #1"""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"Here you may run the task #1"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action5]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action5\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"1"
value1=STRING|"{num}"
value2=STRING|"2"

[Actions\Action6]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Here you may run the task #2"""
Params=FOLDER

[Actions\Action6\Params]
icon=STRING|"1"
msg0=STRING|"Here you may run the task #2"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action7]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action8]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action8\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"1"
value1=STRING|"{num}"
value2=STRING|"3"

[Actions\Action9]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Here you may run the task #3"""
Params=FOLDER

[Actions\Action9\Params]
icon=STRING|"1"
msg0=STRING|"Here you may run the task #3"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

Save the text of the task into file and use menu "Task | Import" in order to import into RoboTask
Last edited by Oleg on Sat Sep 20, 2008 4:26 am, edited 1 time in total.
MainMan B
Posts: 6
Joined: Tue Sep 16, 2008 12:51 pm
Location: Denmark

Task that let you chose between other tsk

Post by MainMan B »

Cool! Thank you very much for that. I suppose the FOLDER
strings in the Action section should be my task names,
or the names of them with the .tsk extension?
Post Reply