Repeat sequence - Numbers increase.

Discuss RoboTask here
Post Reply
kokas
Posts: 3
Joined: Sat May 24, 2014 6:46 pm

Repeat sequence - Numbers increase.

Post by kokas »

Hello, I have read several threads and have not found what I want.

wish RoboTask open a shortcut to a web page in the url type a number and enter, example:



http://www.mywebsite.com/index.php?=1

repeat:

http://www.mywebsite.com/index.php?=2

repeat.

http://www.mywebsite.com/index.php?=3


Each time the sequence is repeated, RoboTask have to increase the number in ascending order.


how could I do this?

Thanks
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Repeat sequence - Numbers increase.

Post by Oleg »

See my example.
This task opens 3 pages in the loop.

Code: Select all

 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task372"
Hide=INTEGER|0
ID=INTEGER|1920243796
LogOnAsUser=INTEGER|1
Name=STRING|"Repeat sequence - Numbers increase"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""NUM"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"NUM"

[Actions\Action2]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER

[Actions\Action2\Params]
begin=STRING|"1"
end=STRING|"3"
variable=STRING|"NUM"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""//www.mywebsite.com/index.php?page={num} """
Params=FOLDER

[Actions\Action3\Params]
ifnonzero=STRING|"0"
program=STRING|"http://www.mywebsite.com/index.php?page={num}"
runas=STRING|"0"
wait=STRING|"0"

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


Save the task into a file and use menu Task -> Import to import the task into RoboTask.
Oleg Yershov
kokas
Posts: 3
Joined: Sat May 24, 2014 6:46 pm

Re: Repeat sequence - Numbers increase.

Post by kokas »

Thanks Oleg, the code works fine.

But I have a little problem.

Each time you repeat the process, I always opens the same pages:
mywebsite.com/index.php=1
mywebsite.com/index.php?=2
mywebsite.com/index.php?=3

I want every time the process is repeated automatically increases in numbers.

First execution of the process, opens three pages 1 to 3
second execution of pages, open from 3-6
third: 6-9
....
....
following the process in the order of increasing numbers.


I have to open pages from number 1 to number 200850.

Thank.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Repeat sequence - Numbers increase.

Post by Oleg »

You can save last sequence number into a file (for example) and read it at next start of the task.
But the task will be a bit more complex.
See below:

Code: Select all

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task372"
Hide=INTEGER|0
ID=INTEGER|1920243796
LogOnAsUser=INTEGER|1
Name=STRING|"Repeat sequence - Numbers increase"
OnErrorTaskID=INTEGER|-1
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
Action17=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""NUM"" with value """""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"NUM"

[Actions\Action10]
ActionID=STRING|"A_LOOP_SIMPLE"
Enabled=INTEGER|-1
Name=STRING|"Simple Loop"
Params=FOLDER

[Actions\Action10\Params]
begin=STRING|"{start}"
end=STRING|"{finish}"
variable=STRING|"NUM"

[Actions\Action11]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|0
Name=STRING|"Run ""//www.mywebsite.com/index.php?page={num} """
Params=FOLDER

[Actions\Action11\Params]
ifnonzero=STRING|"0"
program=STRING|"http://www.mywebsite.com/index.php?page={num}"
runas=STRING|"0"
wait=STRING|"0"

[Actions\Action12]
ActionID=STRING|"A_ROBOTASK_ALERT"
Enabled=INTEGER|-1
Name=STRING|"Show Notification"
Params=FOLDER

[Actions\Action12\Params]
defh=STRING|"1"
defw=STRING|"0"
duration=STRING|"5"
height=STRING|"76"
icon=STRING|"3"
kind=STRING|"0"
message=STRING|"http://www.mywebsite.com/index.php?page={num}"
position=STRING|"3"
title=STRING|"site"
width=STRING|"500"

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

[Actions\Action14]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {filename}"
Params=FOLDER

[Actions\Action14\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{filename}"
line0=STRING|"{num}"
linecount=STRING|"1"
suppress=STRING|"1"

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

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

[Actions\Action16]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action16\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{filename}"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"0"

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

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""START"" with value """""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"START"

[Actions\Action3]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FINISH"" with value """""
Params=FOLDER

[Actions\Action3\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FINISH"

[Actions\Action4]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FILENAME"" with value ""{TempDir}\pagenum.txt"""
Params=FOLDER

[Actions\Action4\Params]
expand=STRING|"1"
varkind=STRING|"1"
varname=STRING|"FILENAME"
varvalue=STRING|"{TempDir}\pagenum.txt"

[Actions\Action5]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""START"" with value ""{TextFile({FileName})}"""
Params=FOLDER

[Actions\Action5\Params]
expand=STRING|"1"
varname=STRING|"START"
varvalue=STRING|"{TextFile({FileName})}"

[Actions\Action6]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""FINISH"" with value ""{start}"""
Params=FOLDER

[Actions\Action6\Params]
expand=STRING|"1"
varname=STRING|"FINISH"
varvalue=STRING|"{start}"

[Actions\Action7]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""start"""
Params=FOLDER

[Actions\Action7\Params]
incement=STRING|"1"
vaiable=STRING|"start"

[Actions\Action8]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""finish"""
Params=FOLDER

[Actions\Action8\Params]
incement=STRING|"3"
vaiable=STRING|"finish"

[Actions\Action9]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""{start}"""
Params=FOLDER

[Actions\Action9\Params]
icon=STRING|"1"
msg0=STRING|"{start}"
msg1=STRING|"{Finish}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
Oleg Yershov
kokas
Posts: 3
Joined: Sat May 24, 2014 6:46 pm

Re: Repeat sequence - Numbers increase.

Post by kokas »

This works fine A million thanks I Appreciate it You are the best.

Have nice day.
Post Reply