Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global varsArray := Object()
  2.  
  3. ; vars system
  4. class variable
  5. {
  6.     static name, value
  7.  
  8.     __New(varName, defaultValue) {
  9.         IniRead, tempvalue, %a_temp%\bind.ini, section, %varName%, %defaultValue%
  10.         this.value := tempvalue
  11.         this.Name := varName
  12.         varsArray.Insert(varName)
  13.     }
  14.  
  15.     setValue(newValue) {
  16.         s := this.name
  17.         addBindMessage(COLOR_WHITE, this.name ": " COLOR_ORANGE this.value COLOR_WHITE " > " COLOR_ORANGE newValue)
  18.         IniWrite, %newValue%, %a_temp%\bind.ini, section, %s%
  19.         this.value := newValue
  20.     }
  21.  
  22. }
  23.  
  24. slot1 := new variable("slot1", 25)
  25. slot2 := new variable("slot2", 20)
  26. slot3 := new variable("slot3", 100)
  27.  
  28. ; Обновление значения переменной: /new [имя переменной] [новое значение]
  29. :B0?:/new::
  30. Input, varName, T V, {space}
  31. Input, varValue, T V, {enter}
  32. a = % varName
  33. %a%.setValue(varValue)
  34. return
  35.  
  36. ; Просмотр доступных переменных: /vars
  37. :B0?:/vars::
  38. addBindMessage(COLOR_GREEN, "Доступные параметры:")
  39. for i, el in varsArray
  40. {
  41.     b = % el
  42.     addBindMessage(COLOR_LIGHTBLUE, el ": " COLOR_ORANGE %b%.value)
  43. }
  44. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement