LavishScript Questions
Moderators: Lavish Software Team, Moderators
LavishScript Questions
First are there any other options for dealing with timing other than TimedCommand and ${Time} stuff like ${Time.SecondsSinceMidnight}? What I'd love to have is a variable holding execution time of a script in tenths of a second or something similar. (Execution time of a session, etc)
Secondly just a curiousity question. How hard / any possibility of getting less rigid syntax for LavishScript flow.
Such as:
if "foo" {
Meh
} else {
Beh
}
or
if "foo" Meh
Secondly just a curiousity question. How hard / any possibility of getting less rigid syntax for LavishScript flow.
Such as:
if "foo" {
Meh
} else {
Beh
}
or
if "foo" Meh
Actually after spending a few hours today writing code, I released how much I hate all this macroquest legacy syntax, grin.
Everytime I have to write varcalc i ${i}+1 I die a little bit inside.
That aside how much trouble would it be to add a For..Loop, and a top check while loop? I realise your pushing for 1.0 atm, so after that maybe some options so the syntax isn't as verbose.
Just trying to give feedback, overall its shaping up to be an amazing product.
Everytime I have to write varcalc i ${i}+1 I die a little bit inside.
That aside how much trouble would it be to add a For..Loop, and a top check while loop? I realise your pushing for 1.0 atm, so after that maybe some options so the syntax isn't as verbose.
Just trying to give feedback, overall its shaping up to be an amazing product.
Too much trouble to bother implementing. The current syntax for while will be the final syntax. However, you can do this:
That's basically a prefixed ++ in C, like ++count<=10
Or instead of varcalc i ${i}+1, simply:
Code: Select all
declare count int 1
do
{
echo ${count}
}
while "${count:Inc}<=10"
Or instead of varcalc i ${i}+1, simply:
Code: Select all
i:Inc
Just for contrast
vs.
Also does the math calc include short circuiting? I'm assuming no.
Code: Select all
function CheckEvent()
{
declare i int local
if "!${EventsInQ}"
return
do
{
if "${System.TickCount}>${EventTime[1]}"
{
call ${EventFunction}
varset i 1
do
{
varset EventTime[${i}] ${EventTime[${Math.Calc[${i}+1]}]}
varset EventFunction[${i}] ${EventFunction[${Math.Calc[${i}+1]}]}
varcalc i ${i}+1
}
while "${i}<${EventsInQ}"
varcalc EventsInQ ${EventsInQ}-1
}
}
while "!${EventsInQ} && ${System.TickCount}>${EventTime[1]}"
}
Code: Select all
function CheckEvent()
{
declare i int local
while "!${EventsInQ} && ${System.TickCount}>${EventTime[1]}"
{
call ${EventFunction}
for i = 1 to ${EventsInQ}
{
varset EventTime[${i}] ${EventTime[${Math.Calc[${i}+1]}]}
varset EventFunction[${i}] ${EventFunction[${Math.Calc[${i}+1]}]}
}
varcalc EventsInQ ${EventsInQ}-1
}
}
Also does the math calc include short circuiting? I'm assuming no.