Oxalist

Untitled

Dec 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.48 KB | None | 0 0
  1. on script load:
  2. wait 3 ticks
  3. invoke "iptalIhale" from "&cConsole"
  4. if folder "plugins/Auctions" doesn't exists:
  5. create folder "plugins/Auctions"
  6. command /auc [<text>] [<text>] [<text>]:
  7. aliases: auctions, a
  8. trigger:
  9. if arg 1 is not set:
  10. if player has permission "auctions.admin" or "auctions.*":
  11. set {_loopN} to 9
  12. else:
  13. set {_loopN} to 6
  14. send "%{AUC::Messages::Top_Title}%"
  15. loop {_loopN} times:
  16. send "%{AUC::Messages::Line_%loop-value%}%"
  17. send "%{AUC::Messages::Down_Title}%"
  18. else if arg 1 is "start" or "baslat":
  19. if player's tool isn't air:
  20. if {Auctions::Durum} is not set:
  21. set {_miktar} to "%arg 2%" parsed as integer
  22. if {_miktar} is set:
  23. if {_miktar} is greater than 0:
  24. set {_minimumPr} to "%arg 3%" parsed as number
  25. if {_minimumPr} is set:
  26. if {_minimumPr} is greater than 0:
  27. if number of player's tool in player's inventory is greater or equal to {_miktar}:
  28. if id of player's tool is not 403 or 421 or 387:
  29. set {_name} to name of player's tool
  30. set {Auctions::Name} to {_name}
  31. set {Auctions::Esya} to {_miktar} of held item
  32. set {Auctions::Miktar} to {_miktar}
  33. set {Auctions::Durum} to player
  34. set {Auctions::Tur} to "%type of player's tool%"
  35. remove {Auctions::Esya} from player's inventory
  36. send "%{AUC::Prefix}% %{AUC::Messages::Item_Received}%"
  37. set {Auctions::minimumPr} to {_minimumPr}
  38. clear {Auctions::Teklif_Verenler}
  39. set {Auctions::Teklif_Fiyatı} to 0
  40. set {_msg} to {AUC::Messages::Auc_Has_Been_Started}
  41. replace all "{PLAYER}" with "%player%" in {_msg}
  42. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg}
  43. replace all "{MINPR}" with "%{_minimumPr}%" in {_msg}
  44. set {_msg2} to {AUC::Action_Bars::Started}
  45. replace all "{PLAYER}" with "%player%" in {_msg2}
  46. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg2}
  47. replace all "{PR}" with "%{_minimumPr}%" in {_msg2}
  48. send action bar from "%{_msg2}%" to players
  49. set {_msg3} to {AUC::Titles::Started_SBT}
  50. replace all "{PLAYER}" with "%player%" in {_msg3}
  51. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg3}
  52. replace all "{PR}" with "%{_minimumPr}%" in {_msg3}
  53. set {_control} to single value "General.Titles" get of "plugins/Auctions/General.yml"
  54. if {_control} is "True":
  55. send players title "%{AUC::Titles::Main}%" with subtitle "%{_msg3}%"
  56. broadcast ""
  57. broadcast " &6&lAUCTIONS"
  58. broadcast ""
  59. broadcast "%{_msg}%"
  60. broadcast "%{AUC::Messages::Give_Offer_Or_See}%"
  61. broadcast ""
  62. set {_playedT} to single value "%player%.Played-Time" get of "plugins/Auctions/Players/%player%.yml" parsed as integer
  63. set {_playedT} to {_playedT} + 1
  64. set "%player%.Played-Time" to "%{_playedT}%" in yaml file "plugins/Auctions/Players/%player%.yml"
  65. set {_second} to 30
  66. while {_second} is not 0:
  67. if {Auctions::Durum} is set:
  68. if {_second} is 30 or 20 or 10 or 5 or 4 or 3 or 2 or 1:
  69. set {_msg} to {AUC::Messages::Remaining_Time}
  70. replace all "{TIME}" with "%{_second}%" in {_msg}
  71. broadcast "%{AUC::Prefix}% %{_msg}%"
  72. else if {_second} is 15:
  73. if {Auctions::Teklif_Verenler} isn't set:
  74. set {_msg} to {AUC::Messages::No_Bidder}
  75. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg}
  76. broadcast "%{AUC::Prefix}% %{_msg}%"
  77. set {_aucmsg} to {AUC::Action_Bars::Not_Offer}
  78. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_aucmsg}
  79. send action bar from "%{_aucmsg}%" to players
  80. set {_msg2} to {AUC::Messages::Item_Gived}
  81. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg2}
  82. send "%{AUC::Prefix}% %{_msg2}%" to player
  83. set {_msg3} to {AUC::Titles::No_Bidder_SBT}
  84. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg3}
  85. set {_control} to single value "General.Titles" get of "plugins/Auctions/General.yml"
  86. if {_control} is "True":
  87. send players title "%{AUC::Titles::Main}%" with subtitle "%{_msg3}%"
  88. give {Auctions::Esya} to player
  89. clear {Auctions::*}
  90. set {Auctions::Teklif_Fiyatı} to 0
  91. remove 1 from {_second}
  92. wait 1 seconds
  93. else:
  94. stop
  95. if {Auctions::Teklif_Verenler} is set:
  96. set {_msg} to {AUC::Messages::Bid_Finished}
  97. replace all "{PLAYER}" with "%{Auctions::Teklif_Verenler}%" in {_msg}
  98. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg}
  99. replace all "{PR}" with "%{Auctions::Teklif_Fiyatı}%" in {_msg}
  100. broadcast "%{AUC::Prefix}% %{_msg}%"
  101. remove {Auctions::Teklif_Fiyatı} from {Auctions::Teklif_Verenler}'s balance
  102. add {Auctions::Teklif_Fiyatı} to player's balance
  103. give {Auctions::Esya} to {Auctions::Teklif_Verenler}
  104. set {_msg2} to {AUC::Messages::You_Win_Bid}
  105. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg2}
  106. replace all "{PR}" with "%{Auctions::Teklif_Fiyatı}%" in {_msg2}
  107. send "%{AUC::Prefix}% %{_msg2}%" to {Auctions::Teklif_Verenler}
  108. set {_aucmsg} to {AUC::Action_Bars::Finished}
  109. replace all "{PLAYER}" with "%{Auctions::Teklif_Verenler}%" in {_aucmsg}
  110. replace all "{PR}" with "%{Auctions::Teklif_Fiyatı}%" in {_aucmsg}
  111. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_aucmsg}
  112. send action bar from "%{_aucmsg}%" to players
  113. set {_msg3} to {AUC::Titles::Finished_SBT}
  114. replace all "{PLAYER}" with "%{Auctions::Teklif_Verenler}%" in {_msg3}
  115. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg3}
  116. replace all "{PR}" with "%{_minimumPr}%" in {_msg3}
  117. set {_control} to single value "General.Titles" get of "plugins/Auctions/General.yml"
  118. if {_control} is "True":
  119. send players title "%{AUC::Titles::Main}%" with subtitle "%{_msg3}%"
  120. set {_depositP} to single value "%{Auctions::Teklif_Verenler}%.Deposit" get of "plugins/Auctions/Players/%{Auctions::Teklif_Verenler}%.yml" parsed as number
  121. set {_depositA} to single value "General.All-Deposit" get of "plugins/Auctions/General.yml" parsed as number
  122. set {_winP} to single value "%{Auctions::Teklif_Verenler}%.Win-Time" get of "plugins/Auctions/Players/%{Auctions::Teklif_Verenler}%.yml" parsed as integer
  123. set {_allP} to single value "General.All-Played" get of "plugins/Auctions/General.yml" parsed as integer
  124. set {_depositP} to {_depositA} + {Auctions::Teklif_Fiyatı}
  125. set {_depositA} to {_depositA} + {Auctions::Teklif_Fiyatı}
  126. set {_winP} to {_winP} + 1
  127. set {_allP} to {_allP} + 1
  128. set "%{Auctions::Teklif_Verenler}%.Deposit" to "%{_depositA}%" in yaml file "plugins/Auctions/Players/%{Auctions::Teklif_Verenler}%.yml"
  129. set "General.All-Deposit" to "%{_depositA}%" in yaml file "plugins/Auctions/General.yml"
  130. set "%{Auctions::Teklif_Verenler}%.Win-Time" to "%{_winP}%" in yaml file "plugins/Auctions/Players/%{Auctions::Teklif_Verenler}%.yml"
  131. set "General.All-Played" to "%{_allP}%" in yaml file "plugins/Auctions/General.yml"
  132. clear {Auctions::*}
  133. else:
  134. send "%{AUC::Prefix}% %{AUC::Messages::Not_Accept_Item}%"
  135. else:
  136. send "%{AUC::Prefix}% %{AUC::Messages::Not_Have}%"
  137. else:
  138. send "%{AUC::Prefix}% %{AUC::Messages::Integer_Greater_0}%"
  139. else:
  140. send "%{AUC::Prefix}% %{AUC::Messages::Correct_Money}%"
  141. else:
  142. send "%{AUC::Prefix}% %{AUC::Messages::Integer_Greater_0}%"
  143. else:
  144. send "%{AUC::Prefix}% %{AUC::Messages::Correct_Number}%"
  145. else:
  146. send "%{AUC::Prefix}% %{AUC::Messages::Bid_Right_Now}%"
  147. else:
  148. send "%{AUC::Prefix}% %{AUC::Messages::Not_Air}%"
  149. else if arg 1 is "bid" or "teklif":
  150. if {Auctions::Durum} is set:
  151. if {Auctions::Durum} isn't "%player%":
  152. if arg 2 is set:
  153. set {_offerPr} to "%arg 2%" parsed as number
  154. if {_offerPr} is set:
  155. if {_offerPr} is greater or equal to {Auctions::minimumPr}:
  156. if player's balance is greater or equal to {_offerPr}:
  157. if {_offerPr} is bigger than {Auctions::Teklif_Fiyatı}:
  158. set {Auctions::Teklif_Verenler} to player
  159. set {Auctions::Teklif_Fiyatı} to {_offerPr}
  160. set {_msg} to {AUC::Messages::Offered}
  161. replace all "{PLAYER}" with "%player%" in {_msg}
  162. replace all "{PR}" with "%{_offerPr}%" in {_msg}
  163. broadcast "%{AUC::Prefix}% %{_msg}%"
  164. set {_msg2} to {AUC::Messages::You_Join_The_Bid}
  165. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg2}
  166. replace all "{PR}" with "%{_offerPr}%" in {_msg2}
  167. send "%{AUC::Prefix}% %{_msg2}%"
  168. set {_aucmsg} to {AUC::Action_Bars::Offered}
  169. replace all "{PLAYER}" with "%{Auctions::Teklif_Verenler}%" in {_aucmsg}
  170. replace all "{PR}" with "%{Auctions::Teklif_Fiyatı}%" in {_aucmsg}
  171. send action bar from "%{_aucmsg}%" to players
  172. else:
  173. set {_msg} to {AUC::Messages::Low_Bid}
  174. replace all "{PR}" with {Auctions::minimumPr} in {_msg}
  175. send "%{_msg}%"
  176. else:
  177. send "%{AUC::Prefix}% %{AUC::Messages::Low_Balance}%"
  178. else:
  179. send "%{AUC::Prefix}% %{AUC::Messages::Low_EnteredMoney}%"
  180. else:
  181. send "%{AUC::Prefix}% %{AUC::Messages::Correct_Money}%"
  182. else:
  183. send "%{AUC::Prefix}% %{AUC::Messages::Correct_Money}%"
  184. else:
  185. send "%{AUC::Prefix}% %{AUC::Messages::Not_Join_Your_Bid}%"
  186. else:
  187. send "%{AUC::Prefix}% %{AUC::Messages::Not_Bid}%"
  188. else if arg 1 is "cancel" or "iptal":
  189. if {Auctions::Durum} is set:
  190. if {Auctions::Durum} is "%player%":
  191. invoke "iptalIhale" from "&9%player%"
  192. else:
  193. if player has permission "cancel.auctions":
  194. invoke "iptalIhale" from "&cOP Player"
  195. else:
  196. send "%{AUC::Prefix}% %{AUC::Messages::Not_Your_Bid}%"
  197. else:
  198. send "%{AUC::Prefix}% %{AUC::Messages::Not_Bid}%"
  199. else if arg 1 is "info" or "bilgi":
  200. if {Auctions::Durum} is set:
  201. wait 2 ticks
  202. open chest with 1 rows named "%{AUC::Menus::Bid}%" to player
  203. play raw sound "note.pling" at player with pitch 1 volume 0.1
  204. set {_i} to "%{Auctions::Tur}%" parsed as material
  205. set {_lore} to {AUC::Menus::Item_Lore}
  206. replace all "{PLAYER}" with "%{Auctions::Durum}%" in {_lore}
  207. replace all "{PR}" with "%{Auctions::minimumPr}%" in {_lore}
  208. replace all "{AMOUNT}" with "%{Auctions::Miktar}%" in {_lore}
  209. if {Auctions::Name} isn't set:
  210. format slot 4 of player with {_i} with lore "%{_lore}%" to be unstealable
  211. else:
  212. format slot 4 of player with {_i} named "%{Auctions::Name}%" with lore "%{_lore}%" to be unstealable
  213. else:
  214. send "%{AUC::Prefix}% %{AUC::Messages::Not_Bid}%"
  215. else if arg 1 is "admin":
  216. if player has permission "auctions.admin" or "auctions.*":
  217. wait 2 tick
  218. open chest with 1 rows named "%{AUC::Menus::Admin}%" to player
  219. set {_playedT} to single value "General.All-Played" get of "plugins/Auctions/General.yml" parsed as number
  220. format slot 0 of player with gray dye named "%{AUC::Menus::Played_Time}%" with lore "||&e- &a%{_playedT}% &7%{AUC::Menus::Times}%" to be unstealable
  221. set {_depositA} to single value "General.All-Deposit" get of "plugins/Auctions/General.yml" parsed as number
  222. format slot 2 of player with sunflower named "%{AUC::Menus::Deposited_Money}%" with lore "||&e- &a%{_depositA}%$" to be unstealable
  223. format slot 4 of player with diamond of unbreaking 10 named "&aVersion;" with lore "||&e- &a%{AUC::Version}%||&f" to be unstealable
  224. set {_titles} to single value "General.Titles" get of "plugins/Auctions/General.yml"
  225. if {_titles} is "True":
  226. set {_lore} to {AUC::Menus::Titles_Close}
  227. format slot 6 of player with gold nugget named "%{AUC::Menus::Title_On_Off}%" with lore "%{_lore}%" to close then run [invoke "setTitle" from player and "False"]
  228. else if {_titles} is "False":
  229. set {_lore} to {AUC::Menus::Titles_Open}
  230. format slot 6 of player with ghast tear named "%{AUC::Menus::Title_On_Off}%" with lore "%{_lore}%" to close then run [invoke "setTitle" from player and "True"]
  231. set {_purge} to single value "General.PurgePlayer-Spam" get of "plugins/Auctions/General.yml"
  232. if {_purge} is "True":
  233. set {_item} to "341" parsed as material
  234. set {_lore} to {AUC::Menus::Purge_Close}
  235. set {_cmd} to "False"
  236. else if {_purge} is "False":
  237. set {_item} to "378" parsed as material
  238. set {_lore} to {AUC::Menus::Purge_Open}
  239. set {_cmd} to "True"
  240. format slot 8 of player with {_item} named "%{AUC::Menus::PurgePlayer_Spam}%" with lore "%{_lore}%" to close then run [invoke "setPurge" from player and {_cmd}]
  241. else:
  242. send "%{AUC::Prefix}% %{AUC::Messages::No_Perm}%"
  243. else if arg 1 is "version":
  244. send "%{AUC::Messages::Top_Title}%"
  245. send ""
  246. send "&e- &aVersion: &7##%{AUC::Version}%"
  247. send "&e- &aCreated By: &7Murat Kandilli"
  248. send ""
  249. send "%{AUC::Messages::Down_Title}%"
  250. else if arg 1 is "stats" or "istatistik":
  251. open chest with 1 rows named "%{AUC::Menus::Stats}%" to player
  252. set {_deposit} to single value "%player%.Deposit" get of "plugins/Auctions/Players/%player%.yml" parsed as number
  253. set {_win} to single value "%player%.Win-Time" get of "plugins/Auctions/Players/%player%.yml" parsed as integer
  254. set {_start} to single value "%player%.Played-Time" get of "plugins/Auctions/Players/%player%.yml" parsed as integer
  255. format slot 1 of player with skull of player named "&a%player%" to be unstealable
  256. format slot 4 of player with sunflower named "%{AUC::Menus::Deposited}%" with lore "||&e- &a%{_deposit}%$||&f" to be unstealable
  257. format slot 5 of player with diamond of unbreaking 10 named "%{AUC::Menus::Win-Time}%" with lore "||&e- &a%{_win}% %{AUC::Menus::Times}%||&f" to be unstealable
  258. format slot 6 of player with flint named "&b%{AUC::Menus::Played-Time}%" with lore "||&e- &a%{_start}% %{AUC::Menus::Times}%||&f" to be unstealable
  259. else if arg 1 is "lang" or "dil":
  260. if player has permission "auctions.admin" or "auctions.*" or "auctions.lang":
  261. if arg 2 is set:
  262. if arg 2 is "en_EN" or "tr_TR":
  263. wait 1 ticks
  264. if file "plugins/Skript/scripts/Auctions-SYNC.sk" exists:
  265. download from "https://raw.githubusercontent.com/MuratKandilli/AUCTIONS/master/%arg 2%" to file "plugins/Skript/scripts/Auctions-SYNC.sk"
  266. wait 5 ticks
  267. execute console command "sk reload Auctions-SYNC"
  268. wait 30 ticks
  269. set {_msg} to {AUC::Messages::Lang_Setted}
  270. replace all "{LANG}" with "%arg 2%" in {_msg}
  271. send "%{AUC::Prefix}% %{_msg}%"
  272. else:
  273. set {_msg1} to {AUC::Messages::No_File-1}
  274. set {_msg2} to {AUC::Messages::No_File-2}
  275. send "%{AUC::Prefix}% %{_msg1}%"
  276. wait 2 tick
  277. send "%{AUC::Prefix}% %{_msg2}%"
  278. else:
  279. execute player command "a lang"
  280. else:
  281. send ""
  282. send "%{AUC::Messages::Current_Langs}%"
  283. loop 5 times:
  284. send "%{AUC::Messages::Current_Langs-%loop-value%}%"
  285. send ""
  286. else:
  287. send "%{AUC::Prefix}% %{AUC::Messages::No_Perm}%"
  288. else if arg 1 is "reload":
  289. if player has permission "auctions.admin" or "auctions.*" or "auctions.reload":
  290. send "%{AUC::Prefix}% %{AUC::Messages::Reloading_1}%"
  291. execute console command "sk reload Auctions-SYNC"
  292. send "%{AUC::Prefix}% %{AUC::Messages::Reloading_2}%"
  293. else:
  294. send "%{AUC::Prefix}% %{AUC::Messages::No_Perm}%"
  295. else:
  296. execute player command "auc"
  297. sub "setTitle":
  298. set {_p} to "%parameter 1%" parsed as player
  299. set {_cmd} to "%parameter 2%"
  300. set "General.Titles" to "%{_cmd}%" in yaml file "plugins/Auctions/General.yml"
  301. send "%{AUC::Prefix}% %{AUC::Messages::Turned_%{_cmd}%_Titles}%" to {_p}
  302. wait 4 tick
  303. execute {_p} command "a admin"
  304. sub "setPurge":
  305. set {_p} to "%parameter 1%" parsed as player
  306. set {_cmd} to "%parameter 2%"
  307. set "General.PurgePlayer-Spam" to "%{_cmd}%" in yaml file "plugins/Auctions/General.yml"
  308. send "%{AUC::Prefix}% %{AUC::Messages::Turned_%{_cmd}%_Purge}%" to {_p}
  309. wait 4 tick
  310. execute {_p} command "a admin"
  311. sub "iptalIhale":
  312. set {_p} to "%parameter 1%" parsed as player
  313. if {Auctions::Durum} is set:
  314. set {_msg} to {AUC::Messages::Bid_Canceled}
  315. replace all "{BY}" with "%{_p}%" in {_msg}
  316. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg}
  317. broadcast "%{AUC::Prefix}% %{_msg}%"
  318. set {Auctions::Teklif_Fiyatı} to 0
  319. give {Auctions::Esya} to {Auctions::Durum}
  320. set {_msg} to {AUC::Messages::Item_Gived}
  321. replace all "{ITEM}" with "%{Auctions::Miktar}% %{Auctions::Tur}%" in {_msg}
  322. send "%{AUC::Prefix}% %{_msg}%" to {Auctions::Durum}
  323. clear {Auctions::*}
Advertisement
Add Comment
Please, Sign In to add comment