1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
if (condition==true) {
	if (condition2==true) {
		condition3=action(condition,condition2);
		if (condition3==true) {
			action2(condition3);
		} else {
			action3();
		}
	} else {
		action3();
	}
}
In this example, action3 is different from action2, and in reality action2 is actually very long. I would not want to copy and paste action2 twice--nor do I want to make a separate method for it.
Is it possible via syntax to compress this into a more efficient script?
Edit: Hahaha I think I have the solution:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
if ((condition==true) && (condition2==true)) {
	condition3=action(condition,condition2);
	if (condition3==true) {
		action2(condition3);
	}
} else {
	action3();
}
The reason I couldn't see it was because actions were extremely long, after typing it in a template form it was very simple to see how that could have been simpler.
[solved] Quick Efficiency Script
1 
Offline