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:
|
main()
{
trig = getentarray("move_trig", "targetname");
for(i=0;i<move_trig.size;i++)
trig[i] thread brush_think();
trig enablelinkto();
trig linkto("self.movingbrush");
}
brush_think()
{
self.brushmoving = false;
self.brushmodel = getent(self.target, "targetname");
while()
{
self waittill("trigger");
if(!self.brushmoving)
self thread brush_move();
}
}
brush_move()
{
self.brushmoving = true;
if(self.brushpos1)
{
self.brushmodel movey(256,5,1,1);
self.brushmodel waittill("movedone");
self.brushpos1 = false;
}
else
{
self.brushmodel movey(-256,5,1,1);
self.brushmodel waittill("movedone");
self.brushpos1 = true;
}
self.brushmoving = false;
}
|