Advertisement
Guest User

fuck this game

a guest
Sep 23rd, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SCL 19.02 KB | None | 0 0
  1. #tBlockDestFromMaster := "FC_GET_ASSIGNMENT_BLOCK"(InputEncoderValue := #DestFromMaster);
  2.  
  3. IF #CurrentDestination = 0 THEN //this is a trolley that has been off the track, use the dest from master
  4.     #tCurrentDestination := #tBlockDestFromMaster;
  5. ELSE
  6.     #tCurrentDestination := #CurrentDestination;
  7. END_IF;
  8.  
  9. CASE #CurrentBlock OF
  10.     142, 143: //switch 1
  11.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  12.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[1].Straight THEN
  13.                 #tCurrentDestination := 401;
  14.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[1].Curved THEN
  15.                 #tCurrentDestination := 108;
  16.             END_IF;
  17.         ELSE
  18.             #tCurrentDestination := 143;
  19.         END_IF;
  20.         //Check switch is still in correct position
  21.         IF #CurrentDestination = 401 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[1].Straight THEN
  22.             #tCurrentDestination := 143;
  23.         ELSIF #CurrentDestination = 108 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[1].Curved THEN
  24.             #tCurrentDestination := 143;
  25.         END_IF;
  26.        
  27.     106, 107, 108: //switch 2
  28.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  29.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[2].Straight THEN
  30.                 #tCurrentDestination := 119;
  31.             END_IF;
  32.         ELSE
  33.             #tCurrentDestination := 108;
  34.         END_IF;
  35.         //Check switch is still in correct position
  36.         IF #CurrentDestination = 119 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[2].Straight THEN
  37.             #tCurrentDestination := 108;
  38.         END_IF;
  39.        
  40.     405: //switch 2 curve
  41.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  42.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[2].Curved THEN
  43.                 #tCurrentDestination := 119;
  44.             END_IF;
  45.         ELSE
  46.             #tCurrentDestination := 405;
  47.         END_IF;
  48.         //Check switch is still in correct position
  49.         IF #CurrentDestination = 119 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[2].Curved THEN
  50.             #tCurrentDestination := 405;
  51.         END_IF;
  52.        
  53.     117, 118, 119: //switch 3
  54.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  55.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[3].Straight THEN
  56.                 #tCurrentDestination := 202;
  57.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[3].Curved THEN
  58.                 #tCurrentDestination := 122;
  59.             END_IF;
  60.         ELSE
  61.             #tCurrentDestination := 119;
  62.         END_IF;
  63.         //Check switch is still in correct position
  64.         IF #CurrentDestination = 202 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[3].Straight THEN
  65.             #tCurrentDestination := 119;
  66.         ELSIF #CurrentDestination = 122 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[3].Curved THEN
  67.             #tCurrentDestination := 119;
  68.         END_IF;
  69.        
  70.     201, 202: //switch 4 straight
  71.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  72.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[4].Straight THEN
  73.                 IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Straight THEN
  74.                     #tCurrentDestination := 220;
  75.                 ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Curved THEN
  76.                     #tCurrentDestination := 212;
  77.                 END_IF;
  78.             ELSE
  79.                 #tCurrentDestination := 202;
  80.             END_IF;
  81.         ELSE
  82.             #tCurrentDestination := 202;
  83.         END_IF;
  84.         IF #CurrentDestination = 220 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[4].Straight OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Straight) THEN
  85.             #tCurrentDestination := 202;
  86.         ELSIF #CurrentDestination = 212 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[4].Straight OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Curved) THEN
  87.             #tCurrentDestination := 202;
  88.         END_IF;
  89.        
  90.     287: //switch 4 curved
  91.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  92.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[4].Curved THEN
  93.                 IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Straight THEN
  94.                     #tCurrentDestination := 220;
  95.                 ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Curved THEN
  96.                     #tCurrentDestination := 212;
  97.                 END_IF;
  98.             ELSE
  99.                 #tCurrentDestination := 287;
  100.             END_IF;
  101.         ELSE
  102.             #tCurrentDestination := 287;
  103.         END_IF;
  104.         //Check switch is still in correct position
  105.         IF #CurrentDestination = 220 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[4].Curved OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Straight) THEN
  106.             #tCurrentDestination := 287;
  107.         ELSIF #CurrentDestination = 212 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[4].Curved OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[5].Curved) THEN
  108.             #tCurrentDestination := 287;
  109.         END_IF;
  110.        
  111.     218, 219, 220: //switch 6
  112.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  113.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[6].Curved THEN
  114.                 IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[7].Curved THEN
  115.                     #tCurrentDestination := 231;
  116.                 END_IF;
  117.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[6].Straight THEN
  118.                 #tCurrentDestination := 238;
  119.             END_IF;
  120.         ELSE
  121.             #tCurrentDestination := 220;
  122.         END_IF;
  123.         //Check switch is still in correct position
  124.         IF #CurrentDestination = 231 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[6].Curved OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[7].Curved) THEN
  125.             #tCurrentDestination := 220;
  126.         ELSIF #CurrentDestination = 238 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[6].Straight THEN
  127.             #tCurrentDestination := 220;
  128.         END_IF;
  129.        
  130.     210, 211, 212: //switch 7
  131.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  132.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[7].Straight THEN
  133.                 #tCurrentDestination := 231;
  134.             END_IF;
  135.         ELSE
  136.             #tCurrentDestination := 212;
  137.         END_IF;
  138.         //Check switch is still in correct position
  139.         IF #CurrentDestination = 231 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[7].Straight THEN
  140.             #tCurrentDestination := 212;
  141.         END_IF;
  142.        
  143.     236, 237, 238: //switch 8
  144.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  145.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[8].Straight THEN
  146.                 #tCurrentDestination := 244;
  147.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[8].Curved THEN
  148.                 #tCurrentDestination := 240;
  149.             END_IF;
  150.         ELSE
  151.             #tCurrentDestination := 238;
  152.         END_IF;
  153.         //Check switch is still in correct position
  154.         IF #CurrentDestination = 244 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[8].Straight THEN
  155.             #tCurrentDestination := 238;
  156.         ELSIF #CurrentDestination = 240 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[8].Curved THEN
  157.             #tCurrentDestination := 238;
  158.         END_IF;
  159.        
  160.     229, 230, 231: //switch 9
  161.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  162.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[9].Straight THEN
  163.                 #tCurrentDestination := 244;
  164.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[9].Curved THEN
  165.                 IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[10].Curved THEN
  166.                     #tCurrentDestination := 260;
  167.                 END_IF;
  168.             END_IF;
  169.         ELSE
  170.             #CurrentDestination := 231;
  171.         END_IF;
  172.         //Check switch is still in correct position
  173.         IF #CurrentDestination = 244 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[9].Straight THEN
  174.             #tCurrentDestination := 231;
  175.         ELSIF #CurrentDestination = 260 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[9].Curved OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[10].Curved) THEN
  176.             #tCurrentDestination := 231;
  177.         END_IF;
  178.        
  179.     243, 244://switch 10
  180.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  181.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[10].Straight THEN
  182.                 #tCurrentDestination := 260;
  183.             END_IF;
  184.         ELSE
  185.             #tCurrentDestination := 244;
  186.         END_IF;
  187.         //Check switch is still in correct position
  188.         IF #CurrentDestination = 260 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[10].Straight THEN
  189.             #tCurrentDestination := 244;
  190.         END_IF;
  191.        
  192.     260: //switch 11
  193.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  194.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[11].Straight THEN
  195.                 #tCurrentDestination := 262;
  196.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[11].Curved THEN
  197.                 #tCurrentDestination := 263;
  198.             END_IF;
  199.         ELSE
  200.             #tCurrentDestination := 260;
  201.         END_IF;
  202.         //Check switch is still in correct position
  203.         IF #CurrentDestination = 262 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[11].Straight THEN
  204.             #tCurrentDestination := 260;
  205.         ELSIF #CurrentDestination = 263 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[11].Curved THEN
  206.             #tCurrentDestination := 260;
  207.         END_IF;
  208.        
  209.     262, 302: //switch 12 straight
  210.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  211.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[12].Straight THEN
  212.                 #tCurrentDestination := 310;
  213.             END_IF;
  214.         ELSE
  215.             #tCurrentDestination := 262;
  216.         END_IF;
  217.         //Check switch is still in correct position
  218.         IF #CurrentDestination = 310 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[12].Straight THEN
  219.             #tCurrentDestination := 262;
  220.         END_IF;
  221.        
  222.     355: //switch 12 curved
  223.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  224.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[12].Curved THEN
  225.                 #tCurrentDestination := 310;
  226.             END_IF;
  227.         ELSE
  228.             #tCurrentDestination := 355;
  229.         END_IF;
  230.         //Check switch is still in correct position
  231.         IF #CurrentDestination = 310 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[12].Curved THEN
  232.             #tCurrentDestination := 355;
  233.         END_IF;
  234.        
  235.     308, 309, 310: //switch 13 straight
  236.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  237.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[13].Straight THEN
  238.                 IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Straight THEN
  239.                     #tCurrentDestination := 332;
  240.                 ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Curved THEN
  241.                     #tCurrentDestination := 323;
  242.                 ELSE
  243.                     #tCurrentDestination := 310;
  244.                 END_IF;
  245.             ELSE
  246.                 #tCurrentDestination := 310;
  247.             END_IF;
  248.         ELSE
  249.             #tCurrentDestination := 310;
  250.         END_IF;
  251.         //Check switch is still in correct position
  252.         IF #CurrentDestination = 332 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[13].Straight OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Straight) THEN
  253.             #tCurrentDestination := 310;
  254.         ELSIF #CurrentDestination = 323 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[13].Straight OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Curved) THEN
  255.             #tCurrentDestination := 310;
  256.         END_IF;
  257.        
  258.     258, 301: //switch 13 curved
  259.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  260.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[13].Curved THEN
  261.                 IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Straight THEN
  262.                     #tCurrentDestination := 332;
  263.                 ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Curved THEN
  264.                     #tCurrentDestination := 323;
  265.                 ELSE
  266.                     #tCurrentDestination := 301;
  267.                 END_IF;
  268.             ELSE
  269.                 #tCurrentDestination := 301;
  270.             END_IF;
  271.         ELSE
  272.             #tCurrentDestination := 301;
  273.         END_IF;
  274.         //Check switch is still in correct position
  275.         IF #CurrentDestination = 332 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[13].Curved OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Straight) THEN
  276.             #tCurrentDestination := 301;
  277.         ELSIF #CurrentDestination = 323 AND (NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[13].Curved OR NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[14].Curved) THEN
  278.             #tCurrentDestination := 301;
  279.         END_IF;
  280.     330, 331, 332: //switch 15 curved
  281.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  282.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[15].Curved THEN
  283.                 #tCurrentDestination := 351;
  284.             END_IF;
  285.         ELSE
  286.             #tCurrentDestination := 332;
  287.         END_IF;
  288.         //Check switch is still in correct position
  289.         IF #CurrentDestination = 351 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[15].Curved THEN
  290.             #tCurrentDestination := 332;
  291.         END_IF;
  292.     323: //switch 15 straight
  293.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  294.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[15].Straight THEN
  295.                 #tCurrentDestination := 351;
  296.             END_IF;
  297.         ELSE
  298.             #tCurrentDestination := 323;
  299.         END_IF;
  300.         //Check switch is still in correct position
  301.         IF #CurrentDestination = 351 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[15].Straight THEN
  302.             #tCurrentDestination := 323;
  303.         END_IF;
  304.     349, 350, 351: //switch 16
  305.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  306.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[16].Straight THEN
  307.                 #tCurrentDestination := 353;
  308.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[16].Curved THEN
  309.                 #tCurrentDestination := 355;
  310.             END_IF;
  311.         ELSE
  312.             #tCurrentDestination := 351;
  313.         END_IF;
  314.         //Check switch is still in correct position
  315.         IF #CurrentDestination = 353 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[16].Straight THEN
  316.             #tCurrentDestination := 351;
  317.         ELSIF #CurrentDestination = 355 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[16].Curved THEN
  318.             #tCurrentDestination := 351;
  319.         END_IF;
  320.     353, 354: //switch 17 straight
  321.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  322.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[17].Straight THEN
  323.                 #tCurrentDestination := 269;
  324.             END_IF;
  325.         ELSE
  326.             #tCurrentDestination := 353;
  327.         END_IF;
  328.         //Check switch is still in correct position
  329.         IF #CurrentDestination = 269 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[17].Straight THEN
  330.             #tCurrentDestination := 353;
  331.         END_IF;
  332.     263: //switch 17 curved
  333.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  334.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[17].Curved THEN
  335.                 #tCurrentDestination := 269;
  336.             END_IF;
  337.         ELSE
  338.             #tCurrentDestination := 263;
  339.         END_IF;
  340.         //Check switch is still in correct position
  341.         IF #CurrentDestination = 269 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[17].Curved THEN
  342.             #tCurrentDestination := 263;
  343.         END_IF;
  344.     267, 268, 269: //switch 18 straight
  345.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  346.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[18].Straight THEN
  347.                 #tCurrentDestination := 284;
  348.             END_IF;
  349.         ELSE
  350.             #tCurrentDestination := 269;
  351.         END_IF;
  352.         //Check switch is still in correct position
  353.         IF #CurrentDestination = 284 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[18].Straight THEN
  354.             #tCurrentDestination := 269;
  355.         END_IF;
  356.     240: //switch 18 curved
  357.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  358.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[18].Curved THEN
  359.                 #tCurrentDestination := 284;
  360.             END_IF;
  361.         ELSE
  362.             #tCurrentDestination := 240;
  363.         END_IF;
  364.         //Check switch is still in correct position
  365.         IF #CurrentDestination = 284 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[18].Curved THEN
  366.             #tCurrentDestination := 240;
  367.         END_IF;
  368.     282, 283, 284: //switch 19  
  369.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  370.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[19].Straight THEN
  371.                 #tCurrentDestination := 124;
  372.             ELSIF "DB_TROLLEY_SWITCH_INFO".Data.Switch[19].Curved THEN
  373.                 #tCurrentDestination := 287;
  374.             END_IF;
  375.         ELSE
  376.             #tCurrentDestination := 284;
  377.         END_IF;
  378.         //Check switch is still in correct position
  379.         IF #CurrentDestination = 124 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[19].Straight THEN
  380.             #tCurrentDestination := 284;
  381.         ELSIF #CurrentDestination = 287 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[19].Curved THEN
  382.             #tCurrentDestination := 284;
  383.         END_IF;
  384.     123, 124: //switch 20 straight
  385.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  386.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[20].Straight THEN
  387.                 #tCurrentDestination := 143;
  388.             ELSE
  389.                 #tCurrentDestination := 124;
  390.             END_IF;
  391.         ELSE
  392.             #tCurrentDestination := 124;
  393.         END_IF;
  394.         //Check switch is still in correct position
  395.         IF #CurrentDestination = 143 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[20].Straight THEN
  396.             #tCurrentDestination := 124;
  397.         END_IF;
  398.     122: //switch 20 curved
  399.         IF #tBlockDestFromMaster = 0 THEN //master has allowed the vehicle to keep going
  400.             IF "DB_TROLLEY_SWITCH_INFO".Data.Switch[20].Curved THEN
  401.                 #tCurrentDestination := 143;
  402.             END_IF;
  403.         ELSE
  404.             #tCurrentDestination := 122;
  405.         END_IF;
  406.         //Check switch is still in correct position
  407.         IF #CurrentDestination = 143 AND NOT "DB_TROLLEY_SWITCH_INFO".Data.Switch[20].Curved THEN
  408.             #tCurrentDestination := 122;
  409.         END_IF;
  410. END_CASE;
  411. #CurrentDestination := #tCurrentDestination;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement