IF command - automatic WOL

Discuss RoboTask here
Post Reply
anvar
Posts: 2
Joined: Sat Mar 13, 2010 2:51 am
Location: Netherlands

IF command - automatic WOL

Post by anvar »

Hello,I'm having some problems with the IF command.I wrote a script to boot up my homeserver at a specified time.Now I've also added a wait command and ping afterwards.Now if the ping doesn't work, he returns -1. Now I want to use the IF command, if there is a -1 then the previous command must be repeated.Now command is- run wol script (bat file)- delay 240000ms- ping IP   - IF ping IP resolves in -1   - run wol script   - delay 240000ms   - ping IP   - IF ping IP resolves in -1      - Send email      - End IF   - End IF- send emailNow my IF commands states this:- As number, first operand {-1}, comperisan type =Now this isn't working, so can someone help me out with this. Thanks for the replies
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

IF command - automatic WOL

Post by Oleg »

You should compare your variable with -1
i.e.:
first operand: {PingVar}
second operand: -1

Braces must specify the variable name. If you use some expression AS IS you don't need to use symbols "{" and "}"
anvar
Posts: 2
Joined: Sat Mar 13, 2010 2:51 am
Location: Netherlands

IF command - automatic WOL

Post by anvar »

thanks, looks quite logical.Only it still doesn't read my ping value out.So I've my ping value is as followed- ping ip- timeout: 5msc- reply time to variable 1000msc- value if host doesn't respond -1Then my if then value is:- as string- {PingVar}- comparison type: =- second: -1And then I've change everything to include the Else command, otherwise he allways mails the last oneThe full command is now:- run wol script (bat file)- delay 240000ms- ping IP- IF
ping IP resolves in -1   - run wol script   - delay 240000ms  
- ping IP   - IF ping IP resolves in -1      - Send email   - End IF   - Else   - send email- End IFnow he allways skips the first & second if, also when there is a value "-1" given by the ping command
Last edited by anvar on Sat Mar 13, 2010 8:03 am, edited 1 time in total.
Post Reply