Xonos Posted March 13, 2008 Posted March 13, 2008 (edited) Ok! I would like to know if anyone has any advice for my situation. I want to write a script that calls variables from an external editable file. For example let's say I have a script that does the following. sleep("$RebootTimer1"); 23 Hours, 30 Minutes - RebootTimer1 ; Here is where I will insert script that will connect to telnet and do some commands. sleep("$RebootTimer2"); 30 Minutes - RebootTimer2 processclose("world.exe") sleep("2000") run("world.exe") Ok so in short... RebootTimer (The 84600000 sleep timer) I need that to be changeable via an external ini or txt file.. With variables or something. Like this... rebootconfig.ini [Config] $RebootTimer1=84600000 //RebootTimer1 is the total time until it logs into telnet $RebootTimer2=1800000 //RebootTimer2 is the grace period after reboottimer2. I'll pay money for information on how to do this. Edited March 13, 2008 by Richardo [center][/center][center]Xonos Development[font=trebuchet ms,helvetica,sans-serif]- Resources -[/font]AutoIT Documentation | Active Directory UDF | Windows Services UDF | Koda GUI Designer[/center]
Developers Jos Posted March 13, 2008 Developers Posted March 13, 2008 wrong forum -> moved SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
sensalim Posted March 13, 2008 Posted March 13, 2008 I don't know what you meant (headache right now) but can't you use iniread and iniwrite?
Aassdd Posted March 13, 2008 Posted March 13, 2008 He said you posted the thread in wrong section, and he moved it to the correct one. "I'll pay money for information on how to do this." This is a general help and support section. You don't have to pay to get help.. Yes, why don't you try ini commands?
Developers Jos Posted March 13, 2008 Developers Posted March 13, 2008 (edited) this sleep("$RebootTimer1") and sleep("$RebootTimer2") won't work. It needs to be a Number not a Literal string. maybe: sleep($RebootTimer1) and sleep($RebootTimer2) ? (don't know how you set the values) same for sleep("2000") which should be sleep(2000) Edited March 13, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Aassdd Posted March 13, 2008 Posted March 13, 2008 You don't have to put quotes ("") when you use variables. If you want to have an ini file so anyone can change the delay, you'll only need IniRead.
Xonos Posted March 13, 2008 Author Posted March 13, 2008 Ok! I never noticed iniread or iniwrite before! I am still getting used to this! Thanks for the information guys. So sorry for posting in the wrong section! [center][/center][center]Xonos Development[font=trebuchet ms,helvetica,sans-serif]- Resources -[/font]AutoIT Documentation | Active Directory UDF | Windows Services UDF | Koda GUI Designer[/center]
Xonos Posted March 13, 2008 Author Posted March 13, 2008 (edited) Just an update for future reference... I figured it out! Here is a reference script if anyone else needs help. Variables do work in the sleep function. $var = IniRead("test.ini", "section", "test", "NotFound") sleep($var);10 seconds set for this variable 10000 miliseconds MsgBox(4096, "Timer", $var);messages you with a msg box in 10 seconds Ini File [section] test=10000 Edited March 13, 2008 by Richardo [center][/center][center]Xonos Development[font=trebuchet ms,helvetica,sans-serif]- Resources -[/font]AutoIT Documentation | Active Directory UDF | Windows Services UDF | Koda GUI Designer[/center]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now