Hey guys, I am trying to use 1 IF to check if a variable is true and then inside of it I use another IF that should pick the number from the function that generated it. can't I use the called function after the first IF?
My Function:
function Resultup(max) {
return 1 + Math.floor(Math.random() * max)
}
function Results() {
return Resultup(8)
}
It continues that way up to Resultsup8
Incase you were wondering if I load Resultdown
[EOS] Can't figure why my tease freezes
-
- Explorer At Heart
- Posts: 560
- Joined: Sun Jul 06, 2014 2:11 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Slave
Re: [EOS] Can't figure why my tease freezes
One thing that sticks out: you use the name Resultsup both for a function and a variable. They share the same namespace, so when you assign to Resultsup, you are overwriting the function and trying to call it will result in an error. Should only happen though if you run that code twice or you did the same thing before in some other way.
Re: [EOS] Can't figure why my tease freezes
I know it is a bit confusing but I am notkerkersklave wrote: ↑Wed Mar 15, 2023 9:55 pm One thing that sticks out: you use the name Resultsup both for a function and a variable. They share the same namespace, so when you assign to Resultsup, you are overwriting the function and trying to call it will result in an error. Should only happen though if you run that code twice or you did the same thing before in some other way.
Function:
Resultup(no s here) and Results
Variable:
Resultsup (the s is here)
-
- Explorer At Heart
- Posts: 266
- Joined: Thu Jan 03, 2013 4:55 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Submissive
Re: [EOS] Can't figure why my tease freezes
Looking only at a snippet of code is not very helpful to identify the issue; can you share the script in preview mode?Epton wrote: ↑Thu Mar 16, 2023 5:37 pmI know it is a bit confusing but I am notkerkersklave wrote: ↑Wed Mar 15, 2023 9:55 pm One thing that sticks out: you use the name Resultsup both for a function and a variable. They share the same namespace, so when you assign to Resultsup, you are overwriting the function and trying to call it will result in an error. Should only happen though if you run that code twice or you did the same thing before in some other way.
Function:
Resultup(no s here) and Results
Variable:
Resultsup (the s is here)
Re: [EOS] Can't figure why my tease freezes
This is all of the code.Thamrill wrote: ↑Thu Mar 16, 2023 7:31 pmLooking only at a snippet of code is not very helpful to identify the issue; can you share the script in preview mode?Epton wrote: ↑Thu Mar 16, 2023 5:37 pmI know it is a bit confusing but I am notkerkersklave wrote: ↑Wed Mar 15, 2023 9:55 pm One thing that sticks out: you use the name Resultsup both for a function and a variable. They share the same namespace, so when you assign to Resultsup, you are overwriting the function and trying to call it will result in an error. Should only happen though if you run that code twice or you did the same thing before in some other way.
Function:
Resultup(no s here) and Results
Variable:
Resultsup (the s is here)
I have a function in init aka Results()
I use Resultdown1/2/3/4.... to count how many times each option was chosen and if it is 2 it goes to a different page, that is it.
The error I get is that it is not able to read the eval: Resultsup = Resultup() [what I've marked in blue]. if I use it before IF Virgin == True, then it works just fine.
https://milovana.com/webteases/showteas ... 5526a14bad
- Attachments
-
- Screenshot_2.jpg (87.66 KiB) Viewed 1900 times
-
- Explorer At Heart
- Posts: 266
- Joined: Thu Jan 03, 2013 4:55 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Submissive
Re: [EOS] Can't figure why my tease freezes
As a first look, you haven't closed the curly bracket of the Results function in the Initialization scripts. Adding it the tease runs, otherwise it doesn't even load. I will look more into it, but as a first comment all nested if actions make for a difficult to maintain code and you should consider if it wouldn't be better to reorganize the code in different pages, flattening the trees of actionsEpton wrote: ↑Thu Mar 16, 2023 8:33 pmThis is all of the code.
I have a function in init aka Results()
I use Resultdown1/2/3/4.... to count how many times each option was chosen and if it is 2 it goes to a different page, that is it.
The error I get is that it is not able to read the eval: Resultsup = Resultup() [what I've marked in blue]. if I use it before IF Virgin == True, then it works just fine.
https://milovana.com/webteases/showteas ... 5526a14bad
Re: [EOS] Can't figure why my tease freezes
I did close them I noticed as I was about to reply, I didn't know the share link changes each save after the tease is released sorry.Thamrill wrote: ↑Fri Mar 17, 2023 5:35 amAs a first look, you haven't closed the curly bracket of the Results function in the Initialization scripts. Adding it the tease runs, otherwise it doesn't even load. I will look more into it, but as a first comment all nested if actions make for a difficult to maintain code and you should consider if it wouldn't be better to reorganize the code in different pages, flattening the trees of actionsEpton wrote: ↑Thu Mar 16, 2023 8:33 pmThis is all of the code.
I have a function in init aka Results()
I use Resultdown1/2/3/4.... to count how many times each option was chosen and if it is 2 it goes to a different page, that is it.
The error I get is that it is not able to read the eval: Resultsup = Resultup() [what I've marked in blue]. if I use it before IF Virgin == True, then it works just fine.
https://milovana.com/webteases/showteas ... 5526a14bad
I'll think about reorganizing the nested ifs that can load from different page like the eval one I guess.
I appreciate your help
https://milovana.com/webteases/showteas ... 22ac61b383
It seems that the curly brackets is what froze my tease lol now im back to the IF problem. Thank you for the reply it helped me to look at where I forgot to look at lol, this thread can be considered as closed :) .
-
- Explorer At Heart
- Posts: 266
- Joined: Thu Jan 03, 2013 4:55 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Submissive
Re: [EOS] Can't figure why my tease freezes
One more thing I found is that I got this:Epton wrote: ↑Fri Mar 17, 2023 9:45 amI did close them I noticed as I was about to reply, I didn't know the share link changes each save after the tease is released sorry.Thamrill wrote: ↑Fri Mar 17, 2023 5:35 amAs a first look, you haven't closed the curly bracket of the Results function in the Initialization scripts. Adding it the tease runs, otherwise it doesn't even load. I will look more into it, but as a first comment all nested if actions make for a difficult to maintain code and you should consider if it wouldn't be better to reorganize the code in different pages, flattening the trees of actionsEpton wrote: ↑Thu Mar 16, 2023 8:33 pm
This is all of the code.
I have a function in init aka Results()
I use Resultdown1/2/3/4.... to count how many times each option was chosen and if it is 2 it goes to a different page, that is it.
The error I get is that it is not able to read the eval: Resultsup = Resultup() [what I've marked in blue]. if I use it before IF Virgin == True, then it works just fine.
https://milovana.com/webteases/showteas ... 5526a14bad
I'll think about reorganizing the nested ifs that can load from different page like the eval one I guess.
I appreciate your help
https://milovana.com/webteases/showteas ... 22ac61b383
It seems that the curly brackets is what froze my tease lol now im back to the IF problem. Thank you for the reply it helped me to look at where I forgot to look at lol, this thread can be considered as closed :) .
ReferenceError: Resultsup is not defined
at Interpreter.unwind (interpreter.min.js:1:57275)
at Interpreter.throwException (interpreter.min.js:1:55951)
at Interpreter.getValueFromScope (interpreter.min.js:1:53867)
at Interpreter.stepIdentifier (interpreter.min.js:1:72938)
at Interpreter.step (interpreter.min.js:1:3938)
at Interpreter.run (interpreter.min.js:1:4285)
at n.value (VirtualMachine.js:29:23)
at Object.run (if.js:16:24)
at ActionQueue.js:54:72
at u (runtime.js:45:40)
So what i feel to suggest you (and this is one of the reason I personally don't like Javascript) is to define all the variables that you're going to need in the tese in the initialization script. The error arises in page "Results" in the If action checking for virginity.
Another thing that I feel I should tell you, is that in many cases you are creating an excessive ammount of eval actions. In every eval action you can put multiple lines of code, so you can put multiple instructions inside a single action, rather than placing many eval actions one after the other
Re: [EOS] Can't figure why my tease freezes
This is what I don't understand because I use up the same way as resultsup but for some reason resultsup doesn't work. the only difference is that up does not have an IF above it.Thamrill wrote: ↑Fri Mar 17, 2023 3:39 pmOne more thing I found is that I got this:Epton wrote: ↑Fri Mar 17, 2023 9:45 amI did close them I noticed as I was about to reply, I didn't know the share link changes each save after the tease is released sorry.Thamrill wrote: ↑Fri Mar 17, 2023 5:35 am
As a first look, you haven't closed the curly bracket of the Results function in the Initialization scripts. Adding it the tease runs, otherwise it doesn't even load. I will look more into it, but as a first comment all nested if actions make for a difficult to maintain code and you should consider if it wouldn't be better to reorganize the code in different pages, flattening the trees of actions
I'll think about reorganizing the nested ifs that can load from different page like the eval one I guess.
I appreciate your help
https://milovana.com/webteases/showteas ... 22ac61b383
It seems that the curly brackets is what froze my tease lol now im back to the IF problem. Thank you for the reply it helped me to look at where I forgot to look at lol, this thread can be considered as closed :) .
ReferenceError: Resultsup is not defined
at Interpreter.unwind (interpreter.min.js:1:57275)
at Interpreter.throwException (interpreter.min.js:1:55951)
at Interpreter.getValueFromScope (interpreter.min.js:1:53867)
at Interpreter.stepIdentifier (interpreter.min.js:1:72938)
at Interpreter.step (interpreter.min.js:1:3938)
at Interpreter.run (interpreter.min.js:1:4285)
at n.value (VirtualMachine.js:29:23)
at Object.run (if.js:16:24)
at ActionQueue.js:54:72
at u (runtime.js:45:40)
So what i feel to suggest you (and this is one of the reason I personally don't like Javascript) is to define all the variables that you're going to need in the tese in the initialization script. The error arises in page "Results" in the If action checking for virginity.
Another thing that I feel I should tell you, is that in many cases you are creating an excessive ammount of eval actions. In every eval action you can put multiple lines of code, so you can put multiple instructions inside a single action, rather than placing many eval actions one after the other
And I've done lots of evals because for some reason x= tease.getitem("x") doesn't work if it is not in an individual eval. so it simply stuck xD but thanks for mentioning it.
Edit:
OMG I am soooo stupid ... I've placed it all under else of Resultdown3 so it obviously couldn't find it lol
Thanks for the help
-
- Explorer At Heart
- Posts: 266
- Joined: Thu Jan 03, 2013 4:55 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Submissive
Re: [EOS] Can't figure why my tease freezes
It should work for multiple commands; just put them in different lines and place a semicolumn at the ond of each line
Who is online
Users browsing this forum: No registered users and 71 guests