-
Notifications
You must be signed in to change notification settings - Fork 0
/
timerotor_effect_pos.txt
75 lines (68 loc) · 1.49 KB
/
timerotor_effect_pos.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@name Timerotor Effect Pos
@inputs Activate
@outputs Pos1 Pos2 Reverse PosNum
@persist PosNum Reverse
if(first()){
PosNum = 0
Reverse = 0
}
if(~Activate & !first()){
if(Activate == 1){
timer("active",10)
}
else{
timer("deactivate",10)
}
}
if(clk("active")){
timer("active",33)
if(Reverse == 0){
if(PosNum < 80){
PosNum = PosNum+5
}
elseif(PosNum >= 80 & PosNum < 85){
PosNum = PosNum+4
}
elseif(PosNum >= 85 & PosNum < 90){
PosNum = PosNum+3
}
elseif(PosNum >= 90 & PosNum < 95){
PosNum = PosNum+2
}
elseif(PosNum >= 95 & PosNum < 100){
PosNum = PosNum+1
}
elseif(PosNum >= 100){
PosNum = 100
Reverse = 1
}
}
elseif(Reverse == 1){
if(PosNum <= 100 & PosNum > 95){
PosNum = PosNum-1
}
elseif(PosNum <= 95 & PosNum > 90){
PosNum = PosNum-2
}
elseif(PosNum <= 90 & PosNum > 85){
PosNum = PosNum-3
}
elseif(PosNum <= 85 & PosNum > 80){
PosNum = PosNum-4
}
elseif(PosNum <= 80 & PosNum > 0){
PosNum = PosNum-5
}
elseif(PosNum <= 0){
PosNum = 0
Reverse = 0
}
}
Pos1 = PosNum
Pos2 = -PosNum
}
if(clk("deactivate")){
#timer("deactivate",33)
stoptimer("active")
PosNum = 0
}