Jump to content

External Configuration File


 Share

Recommended Posts

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 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]

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • Developers

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 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.
  :)

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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 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]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...