Advertisement
michalmonday

autoDrugs.cs test

Jan 9th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. 0000:
  2.  
  3. repeat
  4. wait 50
  5. until 0AFA: is_samp_available
  6.  
  7. alloc 1@ 500
  8. 0B34: samp register_client_command "autodrugs" to_label @toggle
  9. 31@ = 0
  10.  
  11. if 0AAB: file_exists "CLEO\autoDrugsSettings.ini"
  12. then
  13. 0AF0: 10@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_buy_cmd"
  14. 0AF0: 11@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_buy_item_min"
  15. 0AF0: 12@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_buy_item_max"
  16. 0AF0: 13@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "after_all_buying"
  17. 0AF0: 14@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "before_sending_dialog_min"
  18. 0AF0: 15@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "before_sending_dialog_max"
  19. 0AF0: 16@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "before_next_produce_heroin"
  20. 0AF0: 17@ = get_int_from_ini_file "CLEO\autoDrugsSettings.ini" section "Settings" key "deactivation_key"
  21. //alloc 30@ 200
  22. //format 30@ "autoDrugsSettings: %d %d %d %d %d %d %d %d" 10@ 11@ 12@ 13@ 14@ 15@ 16@ 17@
  23. //chatmsg 30@ -1
  24. //free 30@
  25. else
  26. 0AF8: samp add_message_to_chat "{F7F694}CLEO\autoDrugsSettings.ini {FF4800}not found. {F7F694}The mod won't work"
  27. 0A93: end_custom_thread
  28. end
  29.  
  30. while true
  31. wait 0
  32. if 31@ == 1
  33. then
  34.  
  35. //deactivation by key
  36. call @DeactivationCheck 2 key 17@ state 31@ _returnedState 31@
  37.  
  38. say "/buy"
  39. wait 10@
  40. for 30@ = 1 to 5
  41. call @WaitRandomTime 2 lowerBorder 11@ higherBorder 12@
  42. 0B49: samp set_current_dialog_list_item 3 // 3 id could be 4th item
  43. wait 1000
  44. 0B47: samp close_current_dialog_with_button 1 //buy button
  45. wait 500
  46. end
  47. 0B47: samp close_current_dialog_with_button 2 //close button
  48. wait 13@
  49.  
  50. for 30@ = 1 to 5
  51. say "/produce heroin"
  52. // wait for dialog
  53.  
  54. for 29@ = 1 to 3
  55. while 8B4C: samp is_dialog_active -1
  56. wait 0
  57. wait 20
  58. call @DeactivationCheck 2 key 17@ state 31@ _returnedState 31@
  59. if 31@ == 0
  60. then
  61. break
  62. end
  63. end
  64.  
  65. 0BD7: 1@ //get text
  66. call @GetLast11CharactersFromString 1 stringPointer 1@ _returnedPointer 2@
  67. call @WaitRandomTime 2 lowerBorder 14@ higherBorder 15@
  68. call @SendDialogResponse 1 responseStringPointer 2@
  69. wait 100
  70. //printf 2@ 1000
  71.  
  72. call @DeactivationCheck 2 key 17@ state 31@ _returnedState 31@
  73. if 31@ == 0
  74. then
  75. break
  76. end
  77. end
  78.  
  79. wait 16@
  80. end
  81.  
  82. end
  83. end
  84.  
  85. :toggle
  86. 0B12: 31@ = 31@ 1
  87. if 31@ == 1
  88. then
  89. printf "autoDrugs is ~G~activated" 1000
  90. else
  91. printf "autoDrugs is ~R~deactivated" 1000
  92. end
  93. samp.CmdRet()
  94.  
  95. :GetLast11CharactersFromString
  96. 0C17: 31@ = strlen 0@
  97. 005A: 0@ += 31@ // (int)
  98. 0@ -= 11
  99. ret 1 0@
  100.  
  101. :DeactivationCheck
  102. if key_down 0@
  103. then
  104. printf "autoDrugs is ~R~deactivated" 1000
  105. 1@ = 0
  106. end
  107. ret 1 1@
  108.  
  109. :WaitRandomTime// 2 2873 3861
  110. 0209: 31@ = random_int_in_ranges 0@ 1@
  111. wait 31@
  112. ret 0
  113.  
  114. :SendDialogResponse
  115. 0B4B: samp set_current_dialog_editbox_text 0@
  116. 0B47: samp close_current_dialog_with_button 1
  117. ret 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement