Re: Tease Ai scripting: The HELP CORNER
Posted: Fri Oct 19, 2018 11:45 am
... for the explorer at heart!
https://milovana.com/forum/
Could be something like this:
Code: Select all
hi lets start @CheckFlag(taskA_interrupted, Resume_taskA) @CheckFlag(taskB_interrupted, Resume_taskB)
@Flag(flag_taskA, flag_taskB) @NullResponse @DeleteFlag(flag_taskA, flag_taskB)
heres a task
@NullResponse @RapidCodeOn
(Choose_task)
@NullResponse @Goto(taskA, taskB)
(taskA)
@NullResponse @CheckFlag(flag_taskA, Choose_task)
@NullResponse @SetFlag(flag_taskA) @CallReturn(path_of_the_file/taskA.txt)
@NullResponse @Goto(End)
(taskB)
@NullResponse @CheckFlag(flag_taskB, Choose_task)
@NullResponse @SetFlag(flag_taskB) @CallReturn(path_of_the_file/taskB.txt)
@NullResponse @Goto(End)
(End)
ok lets end
@EndScript
@End
(Resume_taskA)
@NullResponse @CallReturn([i]path_of_the_file[/i]/taskA.txt, resume_task)
@NullResponse @Goto(End)
(Resume_taskB)
@NullResponse @CallReturn([i]path_of_the_file[/i]/taskB.txt, resume_task)
@NullResponse @Goto(End)
Code: Select all
set up task A
ok you can go now, turn off teaseAi and come back later @SetFlag(taskA_interrupted)
@End
(resume_task)
@NullResponse @DeleteFlag(taskA_interrupted)
hi welcome back, lets see how task A went
@End
Code: Select all
set up task B
ok you can go now, turn off teaseAi and come back later @SetFlag(taskB_interrupted)
@End
(resume_task)
@NullResponse @DeleteFlag(taskB_interrupted)
hi welcome back, lets see how task B went
@End
Code: Select all
@NullResponse @CheckFlag(flag_taskA, Choose_task)Code: Select all
@NullResponse @Goto(taskB)Code: Select all
@NullResponse @Goto(taskB,taskC)Did you tried without the @RapidCodeOn to see if you still get the inconsistent behaviour?Xero wrote: Thu Jul 25, 2019 10:03 pm hi
Im writing a script using teaseAI sweet patch version. I'm getting some seemingly inconsistent behaviour, where a piece of code will work many times in a row and then malfunction (as if it skipped setting a variable or reading a variable). The piece of code in question uses @RapidCodeOn and several @NullReponse lines with various operations (gotos, checking/setting/deleting flags)
is it possible that teaseAI can get a bit out of sync and execute lines in the wrong order? Or any other known issues where teaseAI behaves inconsistently?
thanks
Xero
If you post the script (if you want) maybe we could help you checking if there's an error in the script or if it's a bug in the patch.Xero wrote: Thu Jul 25, 2019 10:55 pmThanks for the quick response. I could not reproduce the error without rapidCodeOn, but the error is intermittent so maybe I just go lucky with testing. Ill try more tomorrow and see if i can work out whats going onavatarbr wrote: Thu Jul 25, 2019 10:16 pm
Did you tried without the @RapidCodeOn to see if you still get the inconsistent behaviour?
I have a lot of code behind @RapidCodeOn without problems, but sometimes I think something goes wrong (it's hard to detect)
I just gave a quick read to your post, but I remember working on something like this for you in the past: viewtopic.php?f=26&t=16051&p=262205#p262205Xero wrote: Fri Jul 26, 2019 9:18 am thanks for the help, I've attached a file which is a simplified complete personality, the 5 files involved in the issue are a start script, and 4 files in custom/day_task folder, nothing else is used. unfortunatly i couldnt make the example any smaller as i dont know where the bug is
I checked your script and it looks correct. So assuming it was a bug in the patch I tested it with the latest patch 55, but still the error happened.Xero wrote: Sat Jul 27, 2019 2:20 pmtigrotto wrote: Sat Jul 27, 2019 12:00 pm
Is this a new version of that script? Did the script I created work? If it's a newer version of the script I worked on I think you can adapt that to the new iteration.
I'll check your script now.
yes its a more complicated version of what i asked about before. The script you gave me then was great and thanks again for it. This one is based of the concepts in your original one but i ended up changing it a fair bit as it became more complicated. Maybe I should have stuck closer to what you did or not complicated it so much
I'll try to check it tomorrow too. Maybe after a good night's sleep I'll notice something I didn't today.Xero wrote: Sat Jul 27, 2019 3:30 pm thanks for trying! its a difficult one because its intermittent. It's useful to know you can also produce the bug though and its not jsut me, and also good to know the logic looks correct.
in practise the program would be turned off after every call, so if there is an issue with multiple callreturns then it will be ok
hi Xero,Xero wrote: Fri Jul 26, 2019 9:18 am the idea is that the task selector should be called twice per day, once in morning, once in evening. the evening call should refer to the same task as the morning so for example
task 3
task 3 followup2
would be a correct output from two calls, but sometimes i get
task 3
task 1
or other weird behaviour (but only after several correct outputs)
to complicate things further:
-there is code to stop the same task being called two days in a row
-module 1 and 2 have introductory sections that should be ran only the first time its called
-module 2 should never repeat and is marked as complete when finished (task 1 and 3 can repeat)
this all seems to mostly work, but occasionally goes wrong!
any help or even jsut knowing if you see a bug too would be great (it only appears after a while)
thanks
Xero
Make sure to delete all the flags when starting a new test.Xero wrote: Thu Aug 01, 2019 7:26 pm thank you all for the help, ive read all your responses carefully.
@pv my apologies for not mentioning this before but in the final version there will probably be more modules and more than one may be unrepeatable. Your example handles the test case really well and simplifies the logic well, unfortunately i think it would be more difficult to extend
Ive been testing my version with resets of teaseAI inbetween and so far it seems ok (instead of calling it many times in one session). My best guess is either:
1) theres a subtle bug none of us can see
2) the call return function overflows or doesnt reset correctly on many subsequent calls (since this would be a difficult function to write i suspect there may be a bug in the patch here)
You'll find it here.Xero wrote: Fri Aug 02, 2019 9:44 am the command guide im using doesnt seem to mention this, is there a more up to date command list?
@Flag() executes the line only the the flag you put inside the command exist(you can use multiple flags too. In this case the line will be executed only if all flags exist. Same for @NotFlag() but it works the opposite of @Flag())
I don't know, I haven't tried using @SetVar[] with text. Remember to use the square brackets after @SetVar[] though:Xero wrote: Fri Aug 02, 2019 9:44 am also is there a way to set a varible to text? i know you can use @InputVar to get text from user
@SetVar[last_session]=[tease and denial]
Yes. You can add the command #CurrentTime in the vocab file you made and you'll have the current time. You'll probably have to add some font tags too to make it identical to the real time stamp.TyCaine wrote: Fri Aug 02, 2019 8:26 pm is there possibly a command or var that can be used to fake the time stamp to further complete the illusion of the 4th and 5th Glitter contacts being added to the chat room (since they are not being added with @ContactX like the other three)?