Write a variable to a file

alcor75

Well-Known Member
Hello, pls wich is the right command or set of commands to write a variable to a file?
I know how to echo it but i would like to write it to a file for later usage and after a few hours of search decided to ask.

Alcor75.
 

CyberTech

Second-in-Command
Staff member
Hello, pls wich is the right command or set of commands to write a variable to a file?
I know how to echo it but i would like to write it to a file for later usage and after a few hours of search decided to ask.

Alcor75.
There is nearly nothing you could want to do in LS that is not done in evebot, go find!

Code:
    method UpdateStatStatus(string StatusMessage)
    {
        redirect -append "${This.StatsLogFile}" Echo "[${Time.Time24}] ${StatusMessage}"
    }

    method InitializeLogs()
    {

        redirect -append "${This.LogFile}" echo "--------------------------------------------------------------------------------------"
        redirect -append "${This.LogFile}" echo "** ${AppVersion} starting on ${Time.Date} at ${Time.Time24}"

        redirect -append "${This.CriticalLogFile}" echo "--------------------------------------------------------------------------------------"
        redirect -append "${This.CriticalLogFile}" echo "** ${AppVersion} starting on ${Time.Date} at ${Time.Time24}"

        This:UpdateConsole["Starting ${AppVersion}"]

        redirect -append "${This.StatsLogFile}" echo "--------------------------------------------------------------------------------------"
        redirect -append "${This.StatsLogFile}" echo "** ${AppVersion} starting on ${Time.Date} at ${Time.Time24}"
    }
 

alcor75

Well-Known Member
i'm making good progress, but my poor knowledge in scripting and programming (sadly i only know how to gut pice of script together and not how to exactly write them) stop me frequently.

Now i want to create different files where to store my data, i need to set a variable to be the name of my log file, i need it to be like this:
Regionname-itemname-date.txt (Sinq Laison-Golden Omber-2009.06.06.txt)

i tryed with :

Code:
variable string Logfile
Logfile:Set[Sinq Laison-${Orders.Get[${i}].Name}-${Time.Date}.txt]
but it abviusly did not work.
pls can you enlight me?

Alcor75
 

Amadeus

The Maestro
Staff member
What does it say when you 'echo' ${Logfile}? Also, I'm not sure without seeing the rest of your script if ${Orders.Get[${i}]} is being used right.

Finally, the "Date" MEMBER of the 'time' datatype returns the date with slashes, not dots (see http://www.lavishsoft.com/wiki/index.php/DataType:time)

Therefore, what you probably want is this:


Code:
Logfile:Set[Sinq Laison-${Orders.Get[${i}].Name}-${Time.Year}.${Time.Month}.${Time.DayOfWeek}.txt]
 

alcor75

Well-Known Member
Amadeus, tnx wery much for helping me, your sugest work perfectly!!
I'll continue developing my project tonight and post here my progress without broke rour rules.

Alcor75
 

alcor75

Well-Known Member
Yes is me again, i hope you like to see people interessed into learn.....

i decided to use
Code:
Logfile:Set[Everyshore-${Orders.Get[${i}].Name}-${EVETime.Date}.txt]
and it worked wery well. Also, is there a way to automatically get my Region? i can't finde a working way.

Now the new problem is that i need to have the ingame time listed like 232905
(hour)23 (minutes)29 (seconds)05 exactly listed as above described (232905), no space dots or slash, how do i get it that way? (using EVETime.Time it end up putting : as separator, and i can't eliminate it).

exemple of what i need: Everyshore-Golden Omber-2009.6.9 232905.txt

Also,
Code:
${Orders.Get[${i}].Price}
resulo in a number with 6 decimals, and the same uppen to the
Code:
${Orders.Get[${i}].QuantityRemaining}
is there a way to round them to 2 decimals?

this look my last obstacle for this first pice of code, with this i'm set to use the exported data and start creating some good route.

Tnx again for the help and hear you soon.

Alcor75
 
Last edited:

alcor75

Well-Known Member
tnx alot Glider, i fixed all the script and now work wery well.
Is not a automatic script, most work is still done manually but i'm inproving it.

Tnx alot for all the help guys.
 
Top Bottom