alphantomega

Documentation to turbo toggle bind script (rewrite)

Jan 28th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. for the actual bind script code go to here: http://pastebin.com/a6Z8udCZ
  2. To use the bind script have a look at the inofficial Vendetta-Online Wiki here: http://www.vo-wiki.com/wiki/Binds#Loading_a_Bind_.28.2Fload_filename.cfg.29
  3.  
  4. *** myTurbo v0.9 by Alphantomega 2014-01-29
  5. This is a pseudo-programming language which helps me personally to analyze and understand a problem
  6. and finding solutions. The "language" is inspired by C#, Javasript etc. There is no "real" or "right" syntax. Again, it is just to help me understand.
  7.  
  8. But: I can use these statements because of their structure and put them into "legal" "Vendetta Online bind script" code.
  9.  
  10. And: as I am tired and should be in bed for about 3 hours, there is (and will never be) a guarantee on this or any other documentation being in concense with the bind script code, and the other way around.
  11.  
  12. Still: enjoy!
  13.  
  14. By the way: this "tap to toggle and push and hold to turn on" thing can be used for many other things, e.g. "Flight Mode assist", mouse view toggling etc. But not now, later maybe.
  15.  
  16. external calls
  17. {
  18. +myTurbo = onButtonPress
  19. -myTurbo = onButtonRelease
  20. }
  21.  
  22. internal states
  23. {
  24. stateZero -- no key is tapped or pressed
  25. stateFirstPress -- a key has been tapped or pressed - indetermined until now
  26. stateSecondPress -- the previous key is still being pressed / has not been released yet
  27. substateTurbo -- helper for missing "if then" ability
  28. substateTurboIsOn -- if more/other/more precise states are required,
  29. substateTurboIsOff -- the naming should be done mor specific
  30. }
  31. internal functions
  32. {
  33. doToggleTurboOn =
  34. {
  35. doTurboOn
  36. substateTurbo = substateTurboIsOn
  37. }
  38. doToggleTurboOff =
  39. {
  40. doTurboOff
  41. substateTurbo = substateTurboIsOff
  42. stateZero
  43. }
  44. doTurboOn =
  45. {
  46. +turbo 1
  47. }
  48. doTurboOff =
  49. {
  50. +turbo 0
  51. }
  52. doNothing =
  53. {
  54. -- a nicer way (to say nil) than alias'ing empty brackets like ""
  55. }
  56. }
  57.  
  58. stateSetups
  59. {
  60. do stateZero
  61. {
  62. -- a disabled turbo is always in stateZero (so, doToggleTurboOff always returns to stateZero)
  63. -- but stateZero may have both states (on or off)
  64. onButtonPress = stateFirstPress
  65. onButtonRelease = doNothing -- actually, this cannot be called in stateZero
  66. -- because onButtonRelease reqires onButtonPress
  67. -- which would automatically put the state 1 shift up
  68. }
  69. do stateFirstPress
  70. {
  71. substateTurboIsOn =
  72. {
  73. onButtonPress = stateSecondPress
  74. onButtonRelease = doToggleTurboOff
  75. }
  76. substateTurboIsOff =
  77. {
  78. doToggleTurboOn
  79. onButtonPress = stateSecondPress
  80. onButtonRelease = stateZero
  81. }
  82. }
  83. do stateSecondPress
  84. {
  85. doToggleTurboOn
  86. onButtonPress = doTurboOn
  87. onButtonRelease = doToggleTurboOff
  88. }
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment