Advertisement
Faguss

Delorean addon script with input multi instead of getkeys

Jun 9th, 2015
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.72 KB | None | 0 0
  1. ;;; http://lex-ofp.narod.ru Lex-OFP@yandex.ru ICQ 471230703
  2. ;;; v1.1
  3. ?(isNull player): Exit
  4. _Unit=_this select 0
  5. _Reload=0
  6. #Reload
  7. ;;; =====================================================Horn
  8. _Horn = call loadFile format[":file read BT_DeLorean.db %1", "Horn"]
  9. ?(format["%1",_Horn]=="-1"): _Horn=["SHIFT","LBUTTON"]
  10. _Horn_count=(count _Horn)
  11. ?(_Horn_count<1) or (_Horn_count>3): _Horn=["SHIFT","LBUTTON"]; _Horn_count=2
  12. _Horn1=_Horn select 0;_Horn2="null";_Horn3="null"
  13. ?(_Horn_count>1):_Horn2=_Horn select 1
  14. ?(_Horn_count>2):_Horn3=_Horn select 2
  15. ;;; =====================================================Reset
  16. _Reset= call loadFile format[":file read BT_DeLorean.db %1", "Reset"]
  17. ?(format["%1",_Reset]=="-1"): _Reset=["SHIFT","LBUTTON","RBUTTON"]
  18. _Reset_count=(count _Reset)
  19. ?(_Reset_count<1) or (_Reset_count>3): _Reset=["SHIFT","LBUTTON","RBUTTON"]; _Reset_count=3
  20. _Reset1=_Reset select 0;_Reset2="null";_Reset3="null"
  21. ?(_Reset_count>1):_Reset2=_Reset select 1
  22. ?(_Reset_count>2):_Reset3=_Reset select 2
  23. ;;; =====================================================off
  24. _off= call loadFile format[":file read BT_DeLorean.db %1", "off"]
  25. ?(format["%1",_off]=="-1"): _off=["CTRL","LBUTTON","RBUTTON"]
  26. _off_count=(count _off)
  27. ?(_off_count<1) or (_off_count>3): _off=["CTRL","LBUTTON","RBUTTON"]; _off_count=3
  28. _off1=_off select 0;_off2="null";_off3="null"
  29. ?(_off_count>1):_off2=_off select 1
  30. ?(_off_count>2):_off3=_off select 2
  31. ;;; =====================================================Left
  32. _Left= call loadFile format[":file read BT_DeLorean.db %1", "Left"]
  33. ?(format["%1",_Left]=="-1"): _Left=["CTRL","LBUTTON"]
  34. _Left_count=(count _Left)
  35. ?(_Left_count<1) or (_Left_count>3): _Left=["CTRL","LBUTTON"]; _Left_count=2
  36. _Left1=_Left select 0;_Left2="null";_Left3="null"
  37. ?(_Left_count>1):_Left2=_Left select 1
  38. ?(_Left_count>2):_Left3=_Left select 2
  39. ;;; =====================================================Right
  40. _Right= call loadFile format[":file read BT_DeLorean.db %1", "Right"]
  41. ?(format["%1",_Right]=="-1"): _Right=["CTRL","RBUTTON"]
  42. _Right_count=(count _Right)
  43. ?(_Right_count<1) or (_Right_count>3): _Right=["CTRL","RBUTTON"]; _Right_count=2
  44. _Right1=_Right select 0;_Right2="null";_Right3="null"
  45. ?(_Right_count>1):_Right2=_Right select 1
  46. ?(_Right_count>2):_Right3=_Right select 2
  47. ;;; =====================================================
  48. ?(_Reload>0): hint format["Fwatch v%1 DeLorean\n\n%2\n%3\n\n%4\n%5\n\n%6\n%7\n\n%8\n%9\n\n%10\n%11",loadFile ":info version",localize "STR_BT_DeLorean_Horn",_Horn,localize "STR_BT_DeLorean_Reset",_Reset,localize "STR_BT_DeLorean_Off_Povorotnik",_off,localize "STR_BT_DeLorean_L_Povorotnik",_Left,localize "STR_BT_DeLorean_R_Povorotnik",_Right]; goto "Help"
  49. ;;; =====================================================Loop
  50. _Status=0
  51.  
  52. ; number is the sleep time
  53. 0.05 exec "..\fwatch\data\InputMulti.sqs"
  54. @Format ["%1",count FWATCH_INPUT_MULTI] != "scalar"
  55.  
  56. #Loop
  57. @(driver _Unit== player) or !(alive _Unit)
  58. ?!(alive _Unit): Exit
  59.  
  60. ; input multi returns "LSHIFT" and "RSHIFT" instead of "SHIFT", too keep compatibility use this:
  61. _keys =+ FWATCH_INPUT_MULTI select 0
  62. ? "LSHIFT" in _keys || "RSHIFT" in _keys : _keys=_keys-["LSHIFT","RSHIFT"]; _keys=_keys+["SHIFT"]
  63. ? "LALT" in _keys || "RALT" in _keys : _keys=_keys-["LALT","RALT"]; _keys=_keys+["ALT"]
  64. ? "LCTRL" in _keys || "RCTRL" in _keys : _keys=_keys-["LCTRL","RCTRL"]; _keys=_keys+["CTRL"]
  65.  
  66.  
  67. ;;; =====================================================Help
  68. ?( "F1" in _keys) and ( "LBUTTON" in _keys): _Reload=1;goto "Reload"
  69. ;;; =====================================================Reset
  70. ?(_Reset_count==1) and (_Reset1 in _keys): goto "Reset"
  71. ?(_Reset_count==2) and (_Reset1 in _keys) and (_Reset2 in _keys): goto "Reset"
  72. ?(_Reset_count==3) and (_Reset1 in _keys) and (_Reset2 in _keys) and (_Reset3 in _keys): goto "Reset"
  73. ;;; =====================================================Horn
  74. ?(_Horn_count==1) and (_Horn1 in _keys): goto "Horn"
  75. ?(_Horn_count==2) and (_Horn1 in _keys) and (_Horn2 in _keys): goto "Horn"
  76. ?(_Horn_count==3) and (_Horn1 in _keys) and (_Horn2 in _keys) and (_Horn3 in _keys): goto "Horn"
  77. ;;; =====================================================off
  78. ?(_off_count==1) and (_off1 in _keys): goto "off"
  79. ?(_off_count==2) and (_off1 in _keys) and (_off2 in _keys): goto "off"
  80. ?(_off_count==3) and (_off1 in _keys) and (_off2 in _keys) and (_off3 in _keys): goto "off"
  81. ;;; =====================================================L_R
  82. ?(_Left_count==1) and (_Left1 in _keys) and (_Status==2): goto "off"
  83. ?(_Left_count==2) and (_Left1 in _keys) and (_Left2 in _keys) and (_Status==2): goto "off"
  84. ?(_Left_count==3) and (_Left1 in _keys) and (_Left2 in _keys) and (_Left3 in _keys) and (_Status==2): goto "off"
  85. ;;; ===========================
  86. ?(_Right_count==1) and (_Right1 in _keys) and (_Status==1): goto "off"
  87. ?(_Right_count==2) and (_Right1 in _keys) and (_Right2 in _keys) and (_Status==1): goto "off"
  88. ?(_Right_count==3) and (_Right1 in _keys) and (_Right2 in _keys) and (_Right3 in _keys) and (_Status==1): goto "off"
  89. ;;; =====================================================Left
  90. ?(_Left_count==1) and (_Left1 in _keys) and (_Status==0): [_Unit,"L"] exec "\BT_DeLorean\Script\Povorotnik.sqs"; _Status=1
  91. ?(_Left_count==2) and (_Left1 in _keys) and (_Left2 in _keys) and (_Status==0): [_Unit,"L"] exec "\BT_DeLorean\Script\Povorotnik.sqs"; _Status=1
  92. ?(_Left_count==3) and (_Left1 in _keys) and (_Left2 in _keys) and (_Left3 in _keys) and (_Status==0): [_Unit,"L"] exec "\BT_DeLorean\Script\Povorotnik.sqs"; _Status=1
  93.  
  94. ;;; =====================================================Right
  95. ?(_Right_count==1) and (_Right1 in _keys) and (_Status==0): [_Unit,"R"] exec "\BT_DeLorean\Script\Povorotnik.sqs"; _Status=2
  96. ?(_Right_count==2) and (_Right1 in _keys) and (_Right2 in _keys) and (_Status==0): [_Unit,"R"] exec "\BT_DeLorean\Script\Povorotnik.sqs"; _Status=2
  97. ?(_Right_count==3) and (_Right1 in _keys) and (_Right2 in _keys) and (_Right3 in _keys) and (_Status==0): [_Unit,"R"] exec "\BT_DeLorean\Script\Povorotnik.sqs"; _Status=2
  98. ;;; =====================================================Sleep
  99. #Sleep
  100. ~0.1
  101. goto "Loop"
  102. ;;; =====================================================Help
  103. #Help
  104. _Reload=0
  105. ~2
  106. goto "Loop"
  107. ;;; =====================================================Horn
  108. #Horn
  109. _Unit animate ["Trg_Horn", 1]
  110. ~2
  111. goto "Loop"
  112. ;;; =====================================================Reset
  113. #Reset
  114. _Unit animate ["Triger_Reset",1]
  115. _Unit AddWeapon "BT_DeLorean_TRG_Reset"
  116. TRG_Addon_BT_DeLorean_Unit_R=_Unit
  117. publicVariable"TRG_Addon_BT_DeLorean_Unit_R"
  118. ~2
  119. goto "Loop"
  120. ;;; =====================================================off
  121. #off
  122. _Status=0
  123. [_Unit,"Off"] exec "\BT_DeLorean\Script\Povorotnik.sqs"
  124. ~1
  125. goto "Loop"
  126. ;;; =====================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement