GodDragon wrote: ↑Wed Nov 22, 2017 12:43 pm
Yea I agree and my exact aim is to create complex scripts and do stuff like he suggested. You can basicly do anything with Tease AI unless it is limited by performance and such. But we'd need a good IDE unless Tease AI adds error catching.
Exactly my same opinion, an IDE would do a lot for helping people write scripts
For example yesterday Tease AI crashed while reading DateDifference because it was expecting an array index that was non existent. I still don't know what line or file though and that is a huge issue.
I think this is a small bug inside #datedifference which, sometimes (that's why i wasn't able to track it down....i don't know why it happens sometimes and sometimes it doesn't, even with the same commands) throws that error.
From what i could understand, it seemed to be related with using #datedifference checks twice in the same line (like the #DT command from spicy).
This line for example, some times trhew errors:
@Variable[#DateDifference(LastE, Days)]>=[3]And[#DateDifference(LastE, Days)]<=[7]
I've found out, though, that there is a workaround which works. Just put your reperated #datedifference check in a variable, and then use the variable inside the @Variable check...it is a bit complicated to explain why it works but i know why (the problem would be finding why the other approach sometimes doesn't).
In the previous example:
@SetVar[date]=[#DateDifference(LastE, Days)]
@Variable[date]>=[3]And[date]<=[7]
I think you can simplify it using a vocab, in which you set the date too (not sure, though, never tested it)
So you create a vocab #setDate with a single line
@SetVar[date]=[#DateDifference(LastE, Days)]
Then whenever you want to set that date you can just #setDate.
In the previous example:
@Variable[#setDate]>=[3]And[#setDate]<=[7]
The biggest problem about Tease AI is that it lacks some stuff a normal coding language would feature. Methods with return types etc..
I agree. And another problem is that it doesn't execute the commands in the order they are written, but in the order that 1885 put the inside the method that does all checks.
So writing for example: test this @CheckFlag(new) @SetFlag(new)
I would have expected this to first check if the flag is present, if it is it will move to the (new) part of the script, if it isn't it sets the flag.
But this is not necessarily how it will go...if @SetFlag() is before @CheckFlag() in the main code, then it will first set it and then check, no matter in which order you use it in the script.
I told 1885 that is was stupid (and i also changed it to make it work following the right order in which you use the commands) but he didn't want it in and forced me to remove it and leave it as it has always been...
So if you want to have sequential commands, you have to write them in separate lines to be sure to have then being executed in the right order.
You could implement them in some way but it is more complicated than it could be and it comes with the cost of performance and more code and as I already said the performance, lack of documentation and spaghetti code of Tease AI itself is kinda annoying. A documentation can be added. A rework of the spaghetti code too but it requires time. Thinking about it I would go with modifying tease ai itself or recreating it but keeping the script syntax and just adding more to it.
Yes, the code is a mess to improve and fix, and that's also why it is defintely slower than it could be. So a better coded version would surely be a good thing to have, that's not in doubt...but i still think an IDE would be more important to have