Advertisement
Guest User

SourceScript Function parameters

a guest
Dec 14th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. naming standard
  2. functions LHS::RHS is turned into LHS__RHS
  3. parameters of functions that are functions are denoted by #. LHS__RHS#f
  4. if the function takes a function parameter with takes a function paraeter you create a chain of #. LHS__RHS#f#g and so on LHS_RHS#f#g#h
  5. there is one alias per function parameter. LSH::RHS(f(g()), h()) will have 3 sub aliases
  6. when defining specific functions parameter values you put an = after the # chain and then the parameter name. LHS__RHS#f=#LHS2__RHS2 or LHS__RHS#f#g=#h
  7. a # before the parameter name denotes the parameter is a function.
  8. only used if there is necessary translation of the function
  9.  
  10. I know this is terribly explained but I dont really know how to explain what is going on in my head.
  11.  
  12.  
  13. function Scout::fun(f(g())) {
  14. f(Scout::stuff)
  15. }
  16.  
  17. function Scout::bla(h()) {
  18. h()
  19. }
  20.  
  21. function Scout::stuff() {
  22. dostuff
  23. }
  24.  
  25. function Scout::otherstuff() {
  26. dootherstuff
  27. }
  28.  
  29. bind "MOUSE4" {
  30. Scout::fun(Scout::bla)
  31. }
  32.  
  33. //translates to
  34. alias "Scout__fun#f" ""
  35. alias "Scout__fun#f#g" ""
  36. alais "Scout__fun" "alias Scout__fun#f#g Scout__stuff; Scout__fun#f; alias Scout__fun#f#g Scout__otherstuff; Scout__fun#f"
  37.  
  38. alias "Scout__bla#h" ""
  39. alias "Scout_bla" "Scout__bla#h"
  40.  
  41. alias "Scout__stuff" "dostuff"
  42.  
  43. alias "Scout__otherstuff" "dootherstuff"
  44.  
  45.  
  46. alias "Scout__fun#f=#Scout__bla" "Scout__fun#f#g"
  47. bind "MOUSE4" "alias Scout__fun#f Scout__fun#f=#Scout__bla; Scout__fun"
  48.  
  49.  
  50. function Scout::fun(f(g(), h()), i(), j()) {
  51. f(i, j)
  52. f(j, i)
  53. }
  54.  
  55. function Scout::bla(j(), k()) {
  56. j()
  57. k()
  58. }
  59.  
  60. function Scout::stuff() {
  61. dostuff
  62. }
  63.  
  64. function Scout::otherstuff() {
  65. dootherstuff
  66. }
  67.  
  68. bind "MOUSE4" {
  69. Scout::fun(Scout::bla, Scout::stuff, Scout::otherstuff)
  70. }
  71.  
  72. alias "Scout__fun#f" ""
  73. alias "Scout__fun#f#g" ""
  74. alias "Scout__fun#f#h" ""
  75. alias "Scout__fun#i" ""
  76. alias "Scout__fun#j" ""
  77. alias "Scout__fun" "alias Scout__fun#f#g Scout__fun#i; alias Scout__fun#f#h Scout__fun#j; Scout__fun#f; alias Scout__fun#f#g Scout__fun#j; alias Scout__fun#f#h Scout__fun#i; Scout__fun#f"
  78.  
  79. alias "Scout__bla#j" ""
  80. alias "Scout__bla#k" ""
  81. alias "Scout__bla" "Scout__bla#j; Scout__bla#k"
  82.  
  83. alias "Scout__stuff" "dostuff"
  84.  
  85. alias "Scout__otherstuff" "dootherstuff"
  86.  
  87. alias "Scout__fun#f=#Scout__bla" "Scout__fun#f#g; Scout__fun#f#h"
  88. bind "MOUSE4" "alias Scout__fun#f Scout__fun#f=#Scout__bla; alias Scout__fun#i Scout__stuff; alias Scout__fun#j Scout__otherstuff; Scout__fun"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement