· 6 years ago · Apr 20, 2020, 09:36 AM
1Skip to content
2Why GitHub?
3Team
4Enterprise
5Explore
6Marketplace
7Pricing
8Search
9
10Sign in
11Sign up
12xx0m
13/
14cyrus
15101
16 Code Issues 0 Pull requests 0 Actions Projects 0 Security Insights
17Join GitHub today
18GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
19
20cyrus/Cyrus.lua
21@xx0m xx0m Update Cyrus.lua
22cec9496 8 hours ago
232178 lines (1956 sloc) 86.1 KB
24
25local C = {}
26
27--client['exec']('clear')
28
29C['Config'] = {
30 ['Panel'] = 'LUA',
31 ['Side'] = 'A'
32}
33
34C['JS'] = panorama['open']()
35C['JS']['Funcs'] = panorama['loadstring']([[
36 return {
37 GetLastTranslation: function() {
38 return cyrus_last_translation;
39 },
40 GetJSON: function() {
41 return cyrus_json;
42 }
43 }
44]])()
45
46C['Libs'] = {
47 ['ChatPrint'] = {
48 -- credits to Aviartia for Chat Print https://github.com/Aviarita/lua-scripts/blob/master/hudchat/print_to_hudchat.lua
49 ['Initialise'] = function()
50 local ffi = require("ffi")
51 ffi.cdef[[
52 // create cdata typedef
53 typedef void***(__thiscall* FindHudElement_t)(void*, const char*);
54 typedef void(__cdecl* ChatPrintf_t)(void*, int, int, const char*, ...);
55 ]]
56
57
58 local signature_gHud = "\xB9\xCC\xCC\xCC\xCC\x88\x46\x09"
59 local signature_FindElement = "\x55\x8B\xEC\x53\x8B\x5D\x08\x56\x57\x8B\xF9\x33\xF6\x39\x77\x28"
60
61 -- find signature_gHud in client_panorama.dll
62 local match = client.find_signature("client_panorama.dll", signature_gHud) or error("sig1 not found") -- returns void***
63 -- cast the match from find_signature to a char* so it can be used for addition and add 1 to it
64 local char_match = ffi.cast("char*", match) + 1
65 -- cast match + 1 back to a void***, so it can be dereferenced to get its vtable
66 local hud = ffi.cast("void**", char_match)[0] or error("hud is nil") -- returns void**
67
68 -- find signature_FindElement in client_panorama.dll
69 match = client.find_signature("client_panorama.dll", signature_FindElement) or error("FindHudElement not found")
70 -- cast the lightuserdata to a type that we can dereference
71 local find_hud_element = ffi.cast("FindHudElement_t", match)
72 -- use the returned cfunc find_hud_element with the parameter hud and "CHudChat" to get the CHudChat class pointer
73 local hudchat = find_hud_element(hud, "CHudChat") or error("CHudChat not found")
74 -- dereference the pointer to get its vtable
75 local chudchat_vtbl = hudchat[0] or error("CHudChat instance vtable is nil")
76
77 -- vtable is an array of functions, the 27th is ChatPrintf
78 local raw_print_to_chat = chudchat_vtbl[27] -- void*
79
80 -- cast the function pointer to a callable type
81 local print_to_chat = ffi.cast('ChatPrintf_t', raw_print_to_chat)
82
83 local function Send(text)
84 print_to_chat(hudchat, 0, 0, text)
85 end
86
87 C['Libs']['ChatPrint']['Send'] = Send
88 end
89 },
90 ['URLEncoder'] = {
91 -- from https://gist.github.com/qpSHiNqp/84cda00abbba350f20a2
92 ['Initialise'] = function()
93 C['Libs']['URLEncoder']['Encode'] = function(str)
94 if (not str) then
95 return str
96 end
97
98 str = string.gsub (str, "\n", "\r\n")
99 str = string.gsub (str, "[^%w.%-_~]",
100 function (c) return string.format ("%%%02X", string.byte(c)) end)
101
102 return str
103 end
104
105 C['Libs']['URLEncoder']['Decode'] = function(str)
106 str = string.gsub(str, "%%([0-9a-fA-F][0-9a-fA-F])",
107 function (c) return string.char(tonumber("0x" .. c)) end)
108 str = string.gsub (str, "\n", "\r\n")
109 return str
110 end
111 end
112 },
113 ['JSON'] = {
114 ['Initialise'] = function()
115 local url = 'https://gist.githubusercontent.com/tylerneylon/59f4bcf316be525b30ab/raw/7f69cc2cea38bf68298ed3dbfc39d197d53c80de/json.lua'
116
117 panorama['loadstring']([[
118 $.AsyncWebRequest(']] .. url .. [[', {type: 'GET', complete: function(c) {
119 cyrus_json = c.responseText;
120 }});
121 ]])()
122
123 client['delay_call'](1, function()
124 local json = C['JS']['Funcs'].GetJSON()
125
126 C['Libs']['JSON']['Funcs'] = loadstring(json)()
127 end)
128 end
129 }
130}
131
132for _, lib in pairs(C['Libs']) do
133 lib['Initialise']()
134end
135
136C['ChangeLogs'] = {
137 '',
138 '===== 1.01 (Apr 20 2020) =====',
139 'Fixed \'Show OG messages\' not disabling when you disable translator',
140 'Improved reliability & added end match round count for end of match ping',
141 'Added auto update [to forum post]',
142 'Fixed !buy from being used by yourself',
143 'Changed way chat commands work, they now pass speaker as argument so team handling is within each function',
144 'Added chat command tsay, eg !tsay ru hello world [ you can change chat command prefixes ctrl + f \'CmdPrefix\' default is ! ]'
145}
146
147C['Colours'] = {
148 ['White'] = '\x01',
149 ['Red'] = '\x02',
150 ['Purple'] = '\x03',
151 ['Green'] = '\x04',
152 ['YellowGreen'] = '\x05',
153 ['LightGreen'] = '\x06',
154 ['LightRed'] = '\x07',
155 ['Gray'] = '\x08',
156 ['LightYellow'] = '\x09',
157 ['Gray2'] = '\x0A',
158 ['Blue'] = '\x0B',
159 ['DarkBlue'] = '\x0C',
160 ['Gold'] = '\x10',
161 ['RGB'] = {
162 ['White'] = {
163 ['r'] = 255,
164 ['g'] = 255,
165 ['b'] = 255
166 },
167 ['Yellow'] = {
168 ['r'] = 234,
169 ['g'] = 237,
170 ['b'] = 37
171 },
172 ['Green'] = {
173 ['r'] = 126,
174 ['g'] = 215,
175 ['b'] = 135
176 },
177 ['Red'] = {
178 ['r'] = 200,
179 ['g'] = 82,
180 ['b'] = 76
181 },
182 ['Blue'] = {
183 ['r'] = 105,
184 ['g'] = 140,
185 ['b'] = 255
186 },
187 ['Orange'] = {
188 ['r'] = 200,
189 ['g'] = 140,
190 ['b'] = 56
191 },
192 }
193}
194
195--this is done so so so horrendously lmao
196C['Notifications'] = {
197 ['Send'] = function(var, bool, ...)
198 local col = C['Colours']
199 local cyrusText = col['White'] .. '[' .. col['Blue'] .. 'Cyrus' .. col['White'] .. '] ' .. col['Gold']
200 local enabled = (bool and col['LightGreen'] .. 'Enabled' or col['LightRed'] .. 'Disabled')
201 local str = ''
202
203 local arg1, arg2, arg3 = ...
204
205 local tab = ui['get'](C['UI']['Utilities']['Notification Type']['Element'])
206 local hasValue = C['Funcs']['table.HasValue']
207
208 if (not ...) then
209 str = str .. col['White'] .. ' was ' .. enabled
210
211 if (hasValue(tab, 'Chat Print')) then
212 C['Libs']['ChatPrint']['Send'](cyrusText .. var .. str)
213 end
214
215 if (hasValue(tab, 'Console')) then
216 C['Notifications']['ConsoleLog'](var .. str, bool, arg1, arg2)
217 end
218 elseif (arg2) then
219 str = str .. col['White'] .. arg1
220
221 if (hasValue(tab, 'Chat Print')) then
222 C['Libs']['ChatPrint']['Send'](cyrusText .. var .. str)
223 end
224
225 if (hasValue(tab, 'Console')) then
226 C['Notifications']['ConsoleLog'](var .. str, bool, arg1, arg2)
227 end
228 elseif (arg1) then
229 str = str .. col['White'] .. ' (' .. col['Purple'] .. arg1 .. col['White'] .. ') was ' .. enabled
230
231 if (hasValue(tab, 'Chat Print')) then
232 C['Libs']['ChatPrint']['Send'](cyrusText .. var .. str)
233 end
234
235 if (hasValue(tab, 'Console')) then
236 C['Notifications']['ConsoleLog'](var .. str, bool, arg1, arg2)
237 end
238 end
239 end,
240 ['ConsoleLog'] = function(var, bool, ...)
241 local col = C['Colours']['RGB']
242 local green = col['Green']
243 local white = col['White']
244 local blue = col['Blue']
245 local red = col['Red']
246 local orange = col['Orange']
247
248 local log = client['color_log']
249
250 log(white['r'], white['g'], white['b'], '[\0')
251 log(blue['r'], blue['g'], blue['b'], 'Cyrus\0')
252 log(white['r'], white['g'], white['b'], '] \0')
253 log(white['r'], white['g'], white['b'], '- \0')
254
255 local arg1, arg2 = ...
256
257 if (arg2) then
258 log(white['r'], white['g'], white['b'], var .. ' ')
259 elseif (bool) then
260 log(green['r'], green['g'], green['b'], var .. ' ')
261 elseif (not bool) then
262 log(red['r'], red['g'], red['b'], var .. ' ')
263 end
264 end,
265 ['ConsoleHelpLog'] = function(var, bool, args, ...)
266 local col = C['Colours']['RGB']
267 local green = col['Green']
268 local white = col['White']
269 local blue = col['Blue']
270 local red = col['Red']
271 local orange = col['Orange']
272
273 local log = client['color_log']
274
275 if (bool) then
276 log(white['r'], white['g'], white['b'], '[\0')
277 log(blue['r'], blue['g'], blue['b'], 'Cyrus\0')
278 log(white['r'], white['g'], white['b'], '] \0')
279
280 log(green['r'], green['g'], green['b'], var .. ' ')
281 else
282 log(orange['r'], orange['g'], orange['b'], '\t ' .. var .. '\0')
283 log(white['r'], white['g'], white['b'], ' ' .. (#args >= 1 and '-' or '' ) .. ' \0')
284 log(green['r'], green['g'], green['b'], args .. ' ')
285 end
286 end
287}
288
289C['P'] = {
290 ['MyPersonaAPI'] = C['JS']['MyPersonaAPI'],
291 ['LobbyAPI'] = C['JS']['LobbyAPI'],
292 ['PartyListAPI'] = C['JS']['PartyListAPI'],
293 ['MatchInfoAPI'] = C['JS']['MatchInfoAPI'],
294 ['GameStateAPI'] = C['JS']['GameStateAPI']
295}
296
297C['ConCmd'] = {
298 ['Cmds'] = {
299 ['help'] = {
300 ['Func'] = function(str)
301 local log = C['Notifications']['ConsoleHelpLog']
302 log('The following commands are available:', true, '')
303
304 for cmd, v in pairs(C['ConCmd']['Cmds']) do
305 log(cmd, false, v['Usage'])
306 end
307
308 log('', false, '')
309 end,
310 ['Usage'] = ''
311 },
312 ['id'] = {
313 ['Func'] = function(str)
314 if (str[2] == nil or str[2] == '' or #str[2] < 15) then
315 C['Notifications']['ConsoleLog']('Invalid use, exmaple usage: cyrus_id 123456789012345', false, '', '')
316 else
317 C['Notifications']['ConsoleLog']('Set your discord acc id to: ' .. str[2], false, '', '')
318 database['write'](C['DB']['Ping']['ID'], str[2])
319 end
320 end,
321 ['Usage'] = '<your discord id here>'
322 },
323 ['webhook'] = {
324 ['Func'] = function(str)
325 if (str[2] == nil or str[2] == '' or #str[2] < 20) then
326 C['Notifications']['ConsoleLog']('Invalid use, exmaple usage: cyrus_webhook https://discordapp.com/api/webhooks/xxxxxxxxxxx/xxxxxxxxxxxxxxxx-xxxx', false, '', '')
327 else
328 C['Notifications']['ConsoleLog']('Set your discord channel webhook to: ' .. str[2], false, '', '')
329 database['write'](C['DB']['Ping']['Webhook'], str[2])
330 end
331 end,
332 ['Usage'] = '<channel webhook here>'
333 },
334 ['webhook_end'] = {
335 ['Func'] = function(str)
336 if (str[2] == nil or str[2] == '' or #str[2] < 20) then
337 C['Notifications']['ConsoleLog']('Invalid use, exmaple usage: cyrus_webhook_end https://discordapp.com/api/webhooks/xxxxxxxxxxx/xxxxxxxxxxxxxxxx-xxxx', false, '', '')
338 else
339 C['Notifications']['ConsoleLog']('Set your discord channel webhook to: ' .. str[2], false, '', '')
340 database['write'](C['DB']['Ping']['WebhookEnd'], str[2])
341 end
342 end,
343 ['Usage'] = '<channel webhook here>'
344 },
345 ['psay'] = {
346 ['Func'] = function(tab)
347 if (tab[2] == nil or tab[2] == '') then
348 C['Notifications']['ConsoleLog']('Invalid use, exmaple usage: cyrus_pchat Hello World!', false, '', '')
349 else
350 local str = ''
351
352 for _, v in pairs(tab) do
353 str = str .. v .. ' '
354 end
355
356 C['Funcs']['PartyChatSay'](str)
357 end
358 end,
359 ['Usage'] = '<text here>'
360 },
361 ['tsay'] = {
362 ['Func'] = function(tab)
363 if (ui['get'](C['UI']['Other']['Translator']['Element'])) then
364 if (not C['Vars']['Translator']['OnCD']) then
365 if (tab[2] == nil or tab[2] == '') then
366 C['Notifications']['ConsoleLog']('Invalid use, exmaple usage: cyrus_tsay Hello World!', false, '', '')
367 else
368 local str = ''
369
370 for _, v in pairs(tab) do
371 str = str .. v .. ' '
372 end
373
374 C['Funcs']['DoChatTranslation'](str, false, true)
375 end
376 else
377 C['Notifications']['ConsoleLog']('You\'re currently rate limited & cannot use this.', false, '', '')
378 end
379 else
380 C['Notifications']['ConsoleLog']('You have the translator disabled.', false, '', '')
381 end
382 end,
383 ['Usage'] = '<text to translate>'
384 }
385 }
386}
387
388C['DB'] = {
389 ['Ping'] = {
390 ['ID'] = 'cyrus.ping.id',
391 ['Webhook'] = 'cyrus.ping.webhook',
392 ['WebhookEnd'] = 'cyrus.ping.webhookend'
393 }
394}
395
396C['Ranks'] = {
397 ['MM'] = {
398 'SI',
399 'S2',
400 'S3',
401 'S4',
402 'SE',
403 'SEM',
404
405 'GN1',
406 'GN2',
407 'GN3',
408 'GNM',
409 'MG1',
410 'MG2',
411
412 'MGE',
413 'DMG',
414 'LE',
415 'LEM',
416 'SMFC',
417 'GE'
418 },
419 ['DZ'] = {
420 'Lab Rat I',
421 'Lab Rat II',
422
423 'Sprinting Hare I',
424 'Sprinting Hare II',
425
426 'Wild Scout I',
427 'Wild Scout II',
428 'Wild Scout Elite',
429
430 'Hunter Fox I',
431 'Hunter Fox II',
432 'Hunter Fox III',
433 'Hunter Fox Elite',
434
435 'Timber Wolf',
436 'Ember Wolf',
437 'Wildfire Wolf',
438
439 'The Howling Alpha'
440 }
441}
442
443-- credits to LegendOfRobbo for the shit post in here
444C['Chat'] = {
445 ['CmdPrefix'] = '!',
446 ['Commands'] = {
447 ['buy'] = {
448 ['Func'] = function(args, speaker)
449 local speakerTeam = C['Funcs']['GetTeam'](speaker)
450 local me = entity['get_local_player']()
451 local myTeam = C['Funcs']['GetTeam'](me)
452
453 if (speakerTeam == myTeam and speaker ~= me) then
454 if (ui['get'](C['UI']['MM']['AFK Buy-Drop']['Element'])) then
455 if (args) then
456 local wep = args[2]
457
458 if (#wep >= 2 and #wep <= 8) then
459 local base = C['Vars']['BuyBot']['WeaponData'][wep]
460 local mode = C['Funcs']['GetChatMode']()
461 local cmd = client['exec']
462
463 if (base) then
464 local money = C['Funcs']['GetMoney'](entity['get_local_player']())
465 local ent, cost = base['ent'], base['cost']
466
467 if (money >= cost) then
468 cmd('buy ', ent)
469
470 client['delay_call'](1, function()
471 cmd('slot0')
472
473 client['delay_call'](0, function()
474 cmd('drop')
475 end)
476 end)
477 else
478 cmd(mode, 'I\'m too much of a poor fag to afford it :^(')
479 end
480 else
481 cmd(mode, 'Invalid weapon name provided \'' .. wep .. '\'')
482 end
483 end
484 end
485 end
486 end
487 end
488 },
489 },
490 ['Spam'] = {
491 ['LastChatMessage'] = globals['tickcount'](),
492 ['LastRadioMessage'] = globals['tickcount'](),
493 ['RadioMessage'] = 'getout',
494 ['DefaultMessage'] = 'your tears are currently being harvested',
495 ['Types'] = {
496 ['Kill'] = 'Off',
497 ['Death'] = 'Off',
498 ['Chat'] = 'Off'
499 }
500 },
501 ['Words'] = {
502 ['Openers'] = {
503 'get fucked',
504 'eat shit',
505 'fuck a baboon',
506 'suck my dingleberries',
507 'choke on steaming cum',
508 'die in a fire',
509 'gas yourself',
510 'sit on garden shears',
511 'choke on scrotum',
512 'shove a brick up your ass',
513 'swallow barbed wire',
514 'move to sweden',
515 'fuck a pig',
516 'bow to me',
517 'suck my ball sweat',
518 'come back when you aren\'t garbage',
519 'i will piss on everything you love',
520 'kill yourself',
521 'livestream suicide',
522 'neck yourself',
523 'go be black somewhere else',
524 'rotate on it',
525 'choke on it',
526 'blow it out your ass',
527 'go browse tumblr',
528 'go back to casual',
529 'sit on horse cock',
530 'drive off a cliff',
531 'rape yourself',
532 'get raped by niggers',
533 'fuck right off',
534 'you mother is a whore',
535 'come at me',
536 'go work the corner',
537 'you are literal cancer',
538 'why haven\'t you killed yourself yet',
539 'why do you even exist',
540 'shoot your balls off with a shotgun',
541 'sterilize yourself',
542 'convert to islam',
543 'drink bleach',
544 'remove yourself',
545 'choke on whale cock',
546 'suck shit',
547 'suck a cock',
548 'lick my sphincter',
549 'set yourself on fire',
550 'drink jenkem',
551 'get beaten to death by your dad',
552 'choke on your uncle\'s cock',
553 'get sat on by a 200kg feminist',
554 'blow off',
555 'join isis',
556 'stick your cock in a blender',
557 'OD yourself on meth',
558 'lie under a truck',
559 'lick a wall socket',
560 'swallow hot coals',
561 'die slowly',
562 'explode yourself',
563 'swing from the noose',
564 'end yourself',
565 'take your best shot',
566 'get shot in a gay bar',
567 'drink pozzed cum',
568 'marry a muslim',
569 'rub your dick on a cheese grater',
570 'wrap a rake with barbed wire and sodomize yourself',
571 'close your gaping cunt',
572 },
573 ['Joiners'] = {
574 'cancer infested',
575 'cock sucking',
576 'fuck faced',
577 'cunt eyed',
578 'nigger fucking',
579 'candy ass',
580 'fairy ass fucking',
581 'shit licking',
582 'unlovable',
583 'disgusting',
584 'degenerate',
585 'fuck headed',
586 'dick lipped',
587 'autismal',
588 'gook eyed',
589 'mongoloided',
590 'cunt faced',
591 'dick fisted',
592 'worthless',
593 'hillary loving',
594 'maggot infested',
595 'boot lipped',
596 'chink eyed',
597 'shit skinned',
598 'nigger headed',
599 'lgbt supporting',
600 'cum stained',
601 },
602 ['Enders'] = {
603 'fuck face',
604 'poofter',
605 'jew cunt',
606 'fagmaster',
607 'goat rapist',
608 'rag head',
609 'cock cheese',
610 'vaginaphobe',
611 'coon',
612 'nigger',
613 'slag cunt',
614 'garbage man',
615 'paeodophile',
616 'kiddy toucher',
617 'pony fucker',
618 'tumblrite',
619 'sperglord',
620 'gorilla\'s dick',
621 'shit licker',
622 'shit slick',
623 'redditor',
624 'pig fucker',
625 'spastic',
626 'cuckold',
627 'chode gobbler',
628 'fuckwit',
629 'retard',
630 'mongoloid',
631 'elephants cunt',
632 'cunt',
633 'gook',
634 'fag lord',
635 'shit stain',
636 'mpgh skid',
637 'batch coder',
638 'pony fucker',
639 'furfag',
640 'half caste',
641 'double nigger',
642 'cock socket',
643 'cunt rag',
644 'anal wart',
645 'maggot',
646 'knob polisher',
647 'fudge packer',
648 'cock slave',
649 'trashmaster',
650 'shitskin',
651 'curry muncher',
652 'gator bait',
653 'bootlip',
654 'camel jockey',
655 'wog cunt',
656 'hooknosed kike',
657 'feminist',
658 'wop cunt',
659 'abo',
660 'porch monkey',
661 'dago',
662 'anal secretion',
663 'pig cunt',
664 'insect',
665 'sub human',
666 'mental defect',
667 'fat whore',
668 'cunt rag',
669 'cotton picker',
670 'bum tickling fag',
671 'degenerate faggot',
672 'smegma lump',
673 'darkie',
674 'fuck toy',
675 'underage midget cunt',
676 'twelvie',
677 'faggot teenager',
678 'ankle biter',
679 'fat cunt american',
680 'bernie loving washout',
681 'fucking failure',
682 'cum dumpster',
683 'waste of skin',
684 'petrol sniffing coon',
685 'jenkem bottle',
686 'dirty jew',
687 'casual retard',
688 'cuck master',
689 'barrel of piss',
690 'tankard of shit',
691 'cock wart',
692 },
693 ['CancerStrike'] = {
694 'LOL fuk u silver scUm',
695 'nice aim doEs It cume in NOT N00be?',
696 'u r terible my doode',
697 'u almost hit me that time LOL',
698 'ur aim iz a joke my man',
699 'get shrekt skrub xdddd',
700 'u just got shitted on kidddd',
701 'i bet u r silver on csgo xD',
702 'u never stood a chance against my pSkillz',
703 'ur just 2bad to kill me :^(',
704 'dam im good',
705 'u wil never beat aimware hax kidd :^)',
706 'eat shit and die xdd',
707 'i laugh at ur shit skillz :D',
708 'get fukn owned kid xd',
709 'i kill u every time u shud try harder :^(',
710 'all u can do is die LOL',
711 'N00bez like u cant beat me LOL',
712 'u tried but im jus 2 gud 4 u',
713 'u cant even hit me LOL uninstall kid xd',
714 'git GUD skrub u r an embarasment',
715 'pathetic LOL',
716 '2 bad so sad u just bad :^(',
717 'im global elit in csgo xd',
718 'thx 4 free kill loser :D',
719 'r u even trying???',
720 'top kekt u got rekt',
721 'fuken smashed kunt :D',
722 'u shud add me so i can teach u how 2 shoot LOL',
723 'ur jus 2 weak and sad to beat me xd',
724 'looks liek ur sad life isnt working out 2 well 4 u :D',
725 'dats all u got??? LOL!',
726 },
727 ['SuperCancerStrike'] = {
728 'dont upsetti hav some spagetti',
729 'eat my asse like a bufet (3 corse meal xd)',
730 'i ownt u in ur gay butth0le',
731 'umade noobe?',
732 'le troled hard',
733 'go wach naturo and play wif urself fag REKT',
734 'LOL i fuckd u so hard just like ur mum lst nit fag',
735 'u play liek a blynd stefen hawkin haha',
736 'ARE U GUEYS NEW??',
737 'are u as bad at life as u are in csgo??',
738 'omg this is 2 ezy are U even trying??',
739 'why dont u go play halo an fist ur butthol faget',
740 'hey granma is that u???? LOL so bad',
741 'time for you 2 uninstale the game shit stane',
742 'congrtulations ur the worlds worst csgo player',
743 'dose ur aim come in NOT NOOBE? LMAO',
744 'lol i troled u so hard *OWNED*',
745 '\'i lik 2 eat daddys logs of poo for lucnh while jackn off 2 naturo\'- u',
746 'take a se4t faget $hitstain u got OWNDE',
747 'LOL scrub ur gettin rekt hardcroe',
748 'R u mad becouse ur bad nooby?',
749 'LMAO did u go to da buthurt king an g3t urself a butthurt with fries?!?',
750 'why dont u go and play manoppoly you noob',
751 'you hav no lyfe you cant evan play csgo propaly',
752 'im hi rite now on ganj but im stil ownen u xD',
753 'if u want my cum bake ask ur mum LOL',
754 'butdocter prognoses: OWND',
755 'cry 2 ur dads dick forver noob',
756 'lol troled autismal faget',
757 'LOL N3RD owned',
758 '\'i love to drink sprems all day\'- u',
759 'crushd nerd do u want a baindaid for that LOL',
760 'lol rectal rekage ur so sh1t lol',
761 'ass states - [_] NOT REKT [X] REKT',
762 'lmao do u even try????',
763 'are u slippan off ur chaire cos ur ass is bleeding so hard??',
764 'u better get a towel for all ur tears faget',
765 'u got ass asassenated by me rofl',
766 'u wont shit agen thats how rekt ur ass is',
767 'i bet youre anus is sore from me ownen u LOL',
768 'im gonna record a fragshow so i can watch me pwn u ova and ova LMAO',
769 'i almost feel sorry for you hahahaha',
770 'lol why dont u play COD so i can own you there too',
771 'how dose it feel to be owneded so hartd??',
772 'rekt u lol another one for the fraghsow',
773 'if i was as bade as u i would kil myself',
774 'dont fell bad not ervry one can be goode',
775 'do u need some loob for ur butt so it doesnt hurt so much when i fuck u',
776 'spesciall delivary for CAPTEN BUTTHURT',
777 'wats wrong cant play wif ur dads dik in ur mouth????',
778 'maybe if u put down the cheseburgers u could kill me lol fat nerd',
779 'getting mad u virgan nerd??',
780 'butt docta prognosis: buttfustrated',
781 '<<< OWEND U >>>',
782 'if u were a fish you wuld be a sperm whael LOL',
783 '>mfw i ownd u',
784 'rekt u noob *OWNED*',
785 'ur gonna have 2 wear dipers now cos ur ass got SHREDED by me',
786 'y dont u take a short strole to the fagot store and buy some skills scrub',
787 'school3d by a 13yo lol u r rely bad',
788 'ur pathetic nerd its like u have parkensons',
789 'u just got promoted 2 cumcaptain prestige',
790 'lol pwnd',
791 'u just got butt raped lol TROLLED U',
792 'did u learn 2 aim from stevie wondar??? LOL',
793 'tell ur mum to hand the keyboard and mosue back',
794 'how does it feel to be shit on by a 13 yer old',
795 'r u into scat porns or some thing cos it feel\'s like u want me 2 shit on u',
796 'u play csgo like my granpa and hes ded',
797 'are u new or just bad?? noobe',
798 'u play csgo lik a midget playin basket ball',
799 'welcome to the noob scoole bus first stop ur house <<PWND>>',
800 '>mfw i rek u',
801 '\'i got my ass kiked so hard im shittn out my mouf\' - u',
802 '<-(0.0)-< dats u gettn ownd LOL',
803 'u just got ur ass ablitterated <<<RECKT>>>',
804 'c=3 (dats ur tiney dik rofl)',
805 'just leeve the game and let the real mans play',
806 'ur so bad u make ur noobe team look good',
807 'CONGRASTULATIONS YOU GOT FRIST PRIZE IN BEING BUTT MAD (BUT LAST IN PENIS SIZE LMAO)',
808 'im not even trying to pwn u its just so easy',
809 'im only 13 an im better than u haha XD',
810 'u just got raped',
811 'some one an ambulance cos u just got DE_STROYED',
812 'i hope u got birth control coz u got rapped',
813 'lol pwnd scrubb',
814 'you play lik a girl',
815 '\'i got fukd so hard dat im cummin shit n shittn cum\'- u',
816 'ur gonna need tampons for ur ass afta that ownage',
817 '{{ scoooled u }}',
818 '(O.o) ~c======3 dats me jizzan on u',
819 'dont worry at least ur tryan XD',
820 'cya noob send me a post card from pwnd city ROFL',
821 'its ok if u keep practasing u will get bettar lol #rekt',
822 '\'evry time i fart 1 liter of cum sqerts out\' - u',
823 'rofl i pwnd u scrub #420 #based #mlgskill',
824 'u fail just like ur dads condom',
825 'if i pwnd u any harder it wud be animal abuse',
826 'uploaden this fragshow roflmao',
827 },
828 ['AnnoyingQuestions'] = {
829 'whats the max tabs you can have open on a vpn',
830 'whats the time',
831 'is it possible to make a clock in binary',
832 'how many cars can you drive at once',
833 'did you know there\'s more planes on the ground than there is submarines in the air',
834 'how many busses can you fit on 1 bus',
835 'how many tables does it take to support a chair',
836 'how many doors does it take to screw a screw',
837 'how long can you hold your eyes closed in bed',
838 'how long can you hold your breath for under spagetti',
839 'whats the fastest time to deliver the mail as a mail man',
840 'how many bees does it take to make a wasp make honey',
841 'If I paint the sun blue will it turn blue',
842 'how many beavers does it take to build a dam',
843 'how much wood does it take to build a computer',
844 'can i have ur credit card number',
845 'is it possible to blink and jump at the same time',
846 'did you know that dinosaurs were, on average, large',
847 'how many thursdays does it take to paint an elephant purple',
848 'if cars could talk how fast would they go',
849 'did you know theres no oxygen in space',
850 'do toilets flush the other way in australia',
851 'if i finger paint will i get a splinter',
852 'can you build me an ant farm',
853 'did you know australia hosts 4 out of 6 of the deadliest spiders in the world',
854 'is it possible to ride a bike in space',
855 'can i make a movie based around your life',
856 'how many pants can you put on while wearing pants',
857 'if I paint a car red can it wear pants',
858 'how come no matter what colour the liquid is the froth is always white',
859 'can a hearse driver drive a corpse in the car pool lane',
860 'how come the sun is cold at night',
861 'why is it called a TV set when there is only one',
862 'if i blend strawberries can i have ur number',
863 'if I touch the moon will it be as hot as the sun',
864 'did u know ur dad is always older than u',
865 'did u know the burger king logo spells burger king',
866 'did u know if u chew on broken glass for a few mins, it starts to taste like blood',
867 'did u know running is faster than walking',
868 'did u know the colour blue is called blue because its blue',
869 'did u know a shooting star isnt a star',
870 'did u know shooting stars dont actually have guns',
871 'did u know the great wall of china is in china',
872 'statistictal fact: 100% of non smokers die',
873 'did u kmow if you eat you poop it out',
874 'did u know rain clouds r called rain clouds cus they are clouds that rain',
875 'if cows drink milk is that cow a cannibal',
876 'did u know you cant win a staring contest with a stuffed animal',
877 'did u know if a race car is at peak speed and hits someone they\'ll die',
878 'did u know the distance between the sun and earth is the same distance as the distance between the earth and the sun',
879 'did u know flat screen tvs arent flat',
880 'did u know aeroplane mode on ur phone doesnt make ur phone fly',
881 'did u know too many birthdays can kill you',
882 'did u know rock music isnt for rocks',
883 'did u know if you eat enough ice you can stop global warming',
884 'if ww2 happened before vietnam would that make vietnam world war 2',
885 'did u know 3.14 isn\'t a real pie',
886 'did u know 100% of stair accidents happen on stairs',
887 'can vampires get AIDS',
888 'what type of bird was a dodo',
889 'did u know dog backwards is god',
890 'did you know on average a dog barks more than a cat',
891 'did u know racecar backwards is racecar'
892 }
893 }
894}
895
896C['Vars'] = {
897 ['TeamKillData'] = {},
898 ['HitLog'] = {
899 ['Hit Groups'] = {
900 [0] = 'Body',
901 'Head',
902 'Chest',
903 'Stomach',
904 'Left Arm',
905 'Right Arm',
906 'Left Leg',
907 'Right Leg',
908 'Neck',
909 '?',
910 'Gear'
911 },
912 ['Hit'] = {},
913 ['ShotInfo'] = {},
914
915 },
916 ['BuyBot'] = {
917 ['WeaponData'] = {
918 ['glock'] = {
919 ['ent'] = 'glock',
920 ['cost'] = 200
921 },
922 ['p2k'] = {
923 ['ent'] = 'hkp2000',
924 ['cost'] = 200
925 },
926 ['p2000'] = {
927 ['ent'] = 'hkp2000',
928 ['cost'] = 200
929 },
930 ['usp'] = {
931 ['ent'] = 'usp_silencer',
932 ['cost'] = 200
933 },
934 ['dualies'] = {
935 ['ent'] = 'elite',
936 ['cost'] = 400
937 },
938 ['p250'] = {
939 ['ent'] = 'p250',
940 ['cost'] = 300
941 },
942 ['tec9'] = {
943 ['ent'] = 'tec9',
944 ['cost'] = 500
945 },
946 ['57'] = {
947 ['ent'] = 'fn57',
948 ['cost'] = 500
949 },
950 ['deagle'] = {
951 ['ent'] = 'deagle',
952 ['cost'] = 700
953 },
954 ['r8'] = {
955 ['ent'] = 'deagle',
956 ['cost'] = 600
957 },
958
959
960
961 ['galil'] = {
962 ['ent'] = 'galilar',
963 ['cost'] = 2000
964 },
965 ['famas'] = {
966 ['ent'] = 'famas',
967 ['cost'] = 2050
968 },
969 ['ak'] = {
970 ['ent'] = 'ak47',
971 ['cost'] = 2700
972 },
973 ['ak47'] = {
974 ['ent'] = 'ak47',
975 ['cost'] = 2700
976 },
977 ['ak-47'] = {
978 ['ent'] = 'ak47',
979 ['cost'] = 2700
980 },
981 ['m4a4'] = {
982 ['ent'] = 'm4a1',
983 ['cost'] = 3100
984 },
985 ['m4a1'] = {
986 ['ent'] = 'm4a1_silencer',
987 ['cost'] = 2900
988 },
989 ['scout'] = {
990 ['ent'] = 'ssg08',
991 ['cost'] = 1700
992 },
993 ['ssg'] = {
994 ['ent'] = 'ssg08',
995 ['cost'] = 1700
996 },
997 ['aug'] = {
998 ['ent'] = 'aug',
999 ['cost'] = 3300
1000 },
1001 ['sg553'] = {
1002 ['ent'] = 'sg556',
1003 ['cost'] = 3000
1004 },
1005 ['sg'] = {
1006 ['ent'] = 'sg556',
1007 ['cost'] = 3000
1008 },
1009 ['awp'] = {
1010 ['ent'] = 'awp',
1011 ['cost'] = 4750
1012 },
1013 ['dak'] = {
1014 ['ent'] = 'scar20',
1015 ['cost'] = 5000
1016 },
1017 ['auto'] = {
1018 ['ent'] = 'scar20',
1019 ['cost'] = 5000
1020 },
1021
1022
1023
1024 ['nova'] = {
1025 ['ent'] = 'nova',
1026 ['cost'] = 1050
1027 },
1028 ['xm10'] = {
1029 ['ent'] = 'xm1014',
1030 ['cost'] = 2000
1031 },
1032 ['sawedoff'] = {
1033 ['ent'] = 'mag7',
1034 ['cost'] = 1100
1035 },
1036 ['mag7'] = {
1037 ['ent'] = 'mag7',
1038 ['cost'] = 1300
1039 },
1040 ['m249'] = {
1041 ['ent'] = 'm249',
1042 ['cost'] = 5200
1043 },
1044 ['negev'] = {
1045 ['ent'] = 'negev',
1046 ['cost'] = 1700
1047 },
1048
1049
1050
1051 ['mac10'] = {
1052 ['ent'] = 'mac10',
1053 ['cost'] = 1050
1054 },
1055 ['mp9'] = {
1056 ['ent'] = 'mp9',
1057 ['cost'] = 1250
1058 },
1059 ['mp7'] = {
1060 ['ent'] = 'mp7',
1061 ['cost'] = 1500
1062 },
1063 ['ump'] = {
1064 ['ent'] = 'ump45',
1065 ['cost'] = 1200
1066 },
1067 ['p90'] = {
1068 ['ent'] = 'p90',
1069 ['cost'] = 2350
1070 },
1071 ['bizon'] = {
1072 ['ent'] = 'bizon',
1073 ['cost'] = 1400
1074 }
1075 }
1076 },
1077 ['UseSpam'] = {
1078 ['LastSwap'] = globals['tickcount'](),
1079 ['Swap'] = false
1080 },
1081 ['Translator'] = {
1082 ['OnCD'] = false,
1083 ['CDTimer'] = 300
1084 }
1085}
1086
1087-- credits to sapphyrus for the not shit vote handling
1088C['Votes'] = {
1089 ['IndicesNoteam'] = {
1090 [0] = "kick",
1091 [1] = "changelevel",
1092 [3] = "scrambleteams",
1093 [4] = "swapteams",
1094 },
1095 ['IndicesTeam'] = {
1096 [1] = 'starttimeout',
1097 [2] = 'surrender'
1098 },
1099 ['Descriptions'] = {
1100 ['changelevel'] = 'change the map',
1101 ['scrambleteams'] = 'scramble the teams',
1102 ['starttimeout'] = 'start a timeout',
1103 ['surrender'] = 'surrender',
1104 ['kick'] = 'kick'
1105 },
1106
1107 ['OnGoingVotes'] = {},
1108 ['VoteOptions'] = {}
1109}
1110
1111C['Funcs'] = {
1112 ['PrintChangelogs'] = function()
1113 local col = C['Colours']['RGB']
1114 local green = col['Green']
1115 local white = col['White']
1116 local blue = col['Blue']
1117 local red = col['Red']
1118 local orange = col['Orange']
1119
1120 local log = client['color_log']
1121
1122 log(white['r'], white['g'], white['b'], '[\0')
1123 log(blue['r'], blue['g'], blue['b'], 'Cyrus\0')
1124 log(white['r'], white['g'], white['b'], '] - \0')
1125 log(orange['r'], orange['g'], orange['b'], 'by x0m\0')
1126
1127 for _, v in pairs(C['ChangeLogs']) do
1128 if (v:sub(1,1) == '=') then
1129 log(red['r'], red['g'], red['b'], '\t' .. v .. ' ')
1130 elseif (v ~= '') then
1131 log(green['r'], green['g'], green['b'], '\t• ' .. v .. ' ')
1132 else
1133 log(green['r'], green['g'], green['b'], ' ')
1134 end
1135 end
1136 end,
1137 ['GetShitPost'] = function(type)
1138 local rand = C['Funcs']['table.Random']
1139
1140 if (type == 'Insult') then
1141 local words = C['Chat']['Words']
1142 return rand(words['Openers']) .. ' you ' .. rand(words['Joiners']) .. ' ' .. rand(words['Enders'])
1143 elseif (type == 'Insult (Caps)') then
1144 local words = C['Chat']['Words']
1145 return string['upper'](rand(words['Openers']) .. ' you ' .. rand(words['Joiners']) .. ' ' .. rand(words['Enders']))
1146 elseif (type == 'Cancer Strike') then
1147 return rand(C['Chat']['Words']['CancerStrike'])
1148 elseif (type == 'Super Cancer Strike') then
1149 return rand(C['Chat']['Words']['SuperCancerStrike'])
1150 else
1151 return rand(C['Chat']['Words']['AnnoyingQuestions'])
1152 end
1153 end,
1154 ['table.Random'] = function(table)
1155 return table[ client['random_int'](1, #table) ]
1156 end,
1157 ['table.HasValue'] = function(table, value)
1158 if (type(table) ~= 'table') then
1159 return false
1160 end
1161
1162 for _, v in pairs(table) do
1163 if (value == v) then
1164 return true
1165 end
1166 end
1167
1168 return false
1169 end,
1170 ['string.Explode'] = function(separator, str)
1171 local ret = {}
1172 local currentPos = 1
1173
1174 for i = 1, #str do
1175 local startPos, endPos = string['find'](str, separator, currentPos)
1176 if ( not startPos ) then break end
1177 ret[ i ] = string['sub']( str, currentPos, startPos - 1 )
1178 currentPos = endPos + 1
1179 end
1180
1181 ret[#ret + 1] = string['sub']( str, currentPos )
1182
1183 return ret
1184 end,
1185 ['GetPlayerProperty'] = function(property, index)
1186 return entity['get_prop'](entity['get_player_resource'](), property, index)
1187 end,
1188 ['GetProperty'] = function(property, index, ...)
1189 return (... and entity['get_prop'](index, property, ...) or entity['get_prop'](index, property))
1190 end,
1191 ['IsConnected'] = function(index)
1192 return C['Funcs']['GetPlayerProperty']('m_bConnected', index) == 1
1193 end,
1194 ['IsBot'] = function(index)
1195 local base = C['Funcs']['GetPlayerProperty']
1196 return base('m_iBotDifficulty', index) >= 0 and base('m_iBotDifficulty', index) <= 4
1197 end,
1198 ['IsHuman'] = function(index)
1199 return C['Funcs']['GetPlayerProperty']('m_iBotDifficulty', index) == -1
1200 end,
1201 ['GetTeam'] = function(index)
1202 return C['Funcs']['GetPlayerProperty']('m_iTeam', index)
1203 end,
1204 ['GetCompWins'] = function(index)
1205 return C['Funcs']['GetPlayerProperty']('m_iCompetitiveWins', index)
1206 end,
1207 ['GetCompRank'] = function(index)
1208 local rankID = C['Funcs']['GetPlayerProperty']('m_iCompetitiveRanking', index)
1209 return (string['find'](globals['mapname'](), 'dz') and (C['Ranks']['DZ'][rankID] or 'unranked') or (C['Ranks']['MM'][rankID] or 'unranked'))
1210 end,
1211 ['GetChatMode'] = function()
1212 return (ui['get'](C['UI']['Utilities']['Team Only']['Element']) and 'say_team' or 'say') .. ' '
1213 end,
1214 ['GetChatDelay'] = function(i)
1215 return 1 * (i * 0.80) + (C['Funcs']['GetPlayerProperty']('m_iPing', entity['get_local_player']()) * 0.01) -- these doubles come out my ass but seem to be stable
1216 end,
1217 ['GetMoney'] = function(index)
1218 return C['Funcs']['GetProperty']('m_iAccount', index)
1219 end,
1220 ['IsValidChatCmd'] = function(text)
1221 return C['Chat']['Commands'][text:lower()]
1222 end,
1223 ['HasTaser'] = function(ent)
1224 for i = 0, 9 do
1225 if (entity['get_classname'](C['Funcs']['GetProperty']('m_hMyWeapons', ent, i)) == 'CWeaponTaser') then
1226 return true
1227 end
1228 end
1229
1230 return false
1231 end,
1232 ['SteamID3To64'] = function(id)
1233 local y
1234 local z
1235
1236 if ((id % 2) == 0) then
1237 y = 0
1238 z = (id / 2)
1239 else
1240 y = 1
1241 z = ((id - 1) / 2)
1242 end
1243
1244 return '7656119' .. ((z * 2) + (7960265728 + y))
1245 end,
1246 ['IsValidConsoleCmd'] = function(text)
1247 return C['ConCmd']['Cmds'][text:lower()]
1248 end,
1249 ['GetTeamInitials'] = function(bool)
1250 local myTeam = C['Funcs']['GetTeam'](entity['get_local_player']())
1251 local enemyTeam = (myTeam == 3) and 2 or 3
1252
1253 if (bool) then
1254 return myTeam == 3 and 'CT' or 'T'
1255 else
1256 return enemyTeam == 3 and 'CT' or 'T'
1257 end
1258 end,
1259 ['GetTeamRounds'] = function(bool)
1260 local myTeam = C['Funcs']['GetTeam'](entity['get_local_player']())
1261 local enemyTeam = (myTeam == 3) and 2 or 3
1262 local gameData = C['P']['GameStateAPI']['GetScoreDataJSO']()['teamdata']
1263 local team = ''
1264
1265 if (bool) then
1266 team = myTeam == 3 and 'CT' or 'TERRORIST'
1267 else
1268 team = enemyTeam == 3 and 'CT' or 'TERRORIST'
1269 end
1270
1271 return gameData[team]['score']
1272 end,
1273 ['StartPlayerTable'] = function(bool)
1274 local base = C['Funcs']
1275 local myTeam = base['GetTeam'](entity['get_local_player']())
1276 local str = ''
1277
1278 for i = 0, globals['maxplayers']() do
1279 local playerTeam = base['GetTeam'](i)
1280
1281 if ((playerTeam == 2 or playerTeam == 3) and base['IsConnected'](i)) then
1282 if (myTeam == playerTeam and bool) or (myTeam ~= playerTeam and not bool) then
1283 local nick = entity['get_player_name'](i)
1284 local rank = base['GetCompRank'](i)
1285 local sid64 = base['SteamID3To64'](entity['get_steam64'](i))
1286 local sid64Format = 'https://steamcommunity.com/profiles/' .. sid64 .. '/'
1287 local isBot = base['IsBot'](i)
1288
1289 if (isBot) then
1290 str = str .. [[\n\t● ]] .. nick .. ' (BOT)'
1291 else
1292 str = str .. [[\n\t● ]] .. nick .. ' ([' .. sid64 .. '](' .. sid64Format .. ' )) ' .. '(' .. rank .. ')'
1293 end
1294 end
1295 end
1296 end
1297
1298 return str .. [[\n\n]]
1299 end,
1300 ['EndPlayerTable'] = function(bool)
1301 local base = C['Funcs']
1302 local str = ''
1303 local arr = {}
1304
1305 for i = 0, globals['maxplayers']() do
1306 local playerTeam = base['GetTeam'](i)
1307 local myTeam = base['GetTeam'](entity['get_local_player']())
1308
1309 if ((playerTeam == 2 or playerTeam == 3) and base['IsConnected'](i)) then
1310 local score = base['GetPlayerProperty']('m_iScore', i)
1311
1312 if (myTeam == playerTeam and bool) or (myTeam ~= playerTeam and not bool) then
1313 table.insert(arr, {player = i, score = score})
1314 end
1315 end
1316 end
1317
1318 table.sort(arr, function(a,b) return a.score > b.score end)
1319
1320 for _, v in pairs(arr) do
1321 local i = v.player
1322 local nick = entity['get_player_name'](i)
1323 local rank = base['GetCompRank'](i)
1324 local sid64 = base['SteamID3To64'](entity['get_steam64'](i))
1325 local isBot = base['IsBot'](i)
1326 local kills = base['GetPlayerProperty']('m_iKills', i)
1327 local deaths = base['GetPlayerProperty']('m_iDeaths', i)
1328 local assists = base['GetPlayerProperty']('m_iAssists', i)
1329 local mvp = base['GetPlayerProperty']('m_iMVPs', i)
1330 local score = v.score
1331
1332 if (isBot) then
1333 str = str .. [[\n\t● ]] .. nick .. ' (BOT)'
1334 else
1335 str = str .. [[\n\t● ]] .. nick .. ' ([' .. sid64 .. '](https://steamcommunity.com/profiles/' .. sid64 .. '/)) (' .. rank .. ')'
1336 end
1337
1338 str = str .. ' (' .. kills .. '/' .. assists .. '/ ' .. deaths .. ') (mvp: ' .. mvp .. ' score: ' .. score .. ')'
1339 end
1340
1341 return str .. [[\n\n]]
1342 end,
1343 ['PartyChatSay'] = function(text)
1344 C['P']['PartyListAPI']['SessionCommand']('Game::Chat', 'run all xuid ' .. C['P']['MyPersonaAPI']['GetXuid']() .. ' chat ' .. text)
1345 end,
1346 ['DoChatTranslation'] = function(text, bool, me, toLang)
1347 local baseCD = C['Vars']['Translator']
1348 if (not baseCD['OnCD']) then
1349 local get = ui['get']
1350 local col = C['Colours']
1351 local baseTranslator = C['UI']['Other']['Translator']
1352 local baseHidden = baseTranslator['Hidden']
1353 local url = 'https://translate.googleapis.com/translate_a/single?client=gtx&sl=' .. get(baseHidden['Source']) .. '&tl='
1354
1355 local languageToTranslateTo = toLang or get(baseHidden['To'])
1356
1357 if (bool) then
1358 url = url .. get(baseHidden['Local'])
1359 else
1360 url = url .. languageToTranslateTo
1361 end
1362
1363 url = url .. '&dt=t&q=' .. C['Libs']['URLEncoder']['Encode'](text)
1364
1365 panorama['loadstring']([[
1366 $.AsyncWebRequest(']] .. url .. [[', {type: 'GET', complete: function(c) {
1367 cyrus_last_translation = c;
1368 }});
1369 ]])()
1370
1371 client['delay_call'](1, function()
1372 local response = C['JS']['Funcs'].GetLastTranslation()
1373
1374 if (response['responseText'] and response['statusText'] ~= 'error') then
1375 local txt = response['responseText']
1376 local tab = C['Libs']['JSON']['Funcs']['parse'](txt)
1377 local translatedText = tab[1][1][1]
1378 local fromText = tab[1][1][2]
1379 local detectedLang = tab[9][1][1]
1380
1381 if (detectedLang ~= get(baseHidden['Local']) and bool) then
1382 C['Notifications']['Send'](col['White'] .. '[' .. col['Red'] .. detectedLang .. col['White'] .. '] ' , true, translatedText, 'translate')
1383 elseif (me) then
1384 client['exec'](C['Funcs']['GetChatMode'](), translatedText)
1385
1386 if (get(baseTranslator['Element']) and get(C['UI']['Other']['Translator']['Hidden']['OGMsg']['Element'])) then
1387 client['delay_call'](0.1, function()
1388 C['Notifications']['Send'](col['White'] .. '[' .. col['Red'] .. 'og msg' .. col['White'] .. '] ' , true, fromText, 'translate')
1389 end)
1390 end
1391 end
1392 elseif (me) then
1393 client['exec'](C['Funcs']['GetChatMode'](), text)
1394 client['delay_call'](0.1, function()
1395 C['Notifications']['Send'](col['White'] .. '[' .. col['Red'] .. 'translator' .. col['White'] .. '] ' , true, 'You\'re rate limited by google, sending normal message.', 'translate')
1396 end)
1397
1398 ui['set'](C['UI']['Other']['Translator']['Hidden']['Chat'], false)
1399 end
1400 end)
1401 end
1402 end
1403}
1404
1405C['UI'] = {
1406 ['Utilities'] = {
1407 ['Notification Type'] = {
1408 ['Element'] = ui['new_multiselect'](C['Config']['Panel'], C['Config']['Side'], 'Notification Type', {'Chat Print', 'Console'}),
1409 ['Callback'] = function(e)
1410 local msg = ''
1411 local col = C['Colours']
1412 local tab = ui['get'](e)
1413
1414 if (#tab > 0) then
1415 for _, v in pairs(tab) do
1416 msg = msg .. col['Purple'] .. v .. col['White'] .. ', '
1417 end
1418
1419 msg = msg:sub(1, #msg - 2)
1420
1421 C['Notifications']['Send']('Notification Type', true, msg)
1422 end
1423 end
1424 },
1425 ['AFK Mode'] = {
1426 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'AFK Mode'),
1427 ['Callback'] = function(e)
1428 local bool = ui['get'](e)
1429 client['exec']((bool and '+' or '-') .. 'duck')
1430
1431 C['Notifications']['Send']('AFK Mode', bool)
1432 end
1433 },
1434 ['Radio Spam'] = {
1435 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Radio Spam'),
1436 ['Hidden'] = {
1437 ['Speed'] = ui['new_slider'](C['Config']['Panel'], C['Config']['Side'], 'Spam Delay', 50, 150, 70, true, '%')
1438 },
1439 ['Callback'] = function(e)
1440 local bool = ui['get'](e)
1441 ui['set_visible'](C['UI']['Utilities']['Radio Spam']['Hidden']['Speed'], bool)
1442 C['Notifications']['Send']('Radio Spam', bool)
1443 end
1444 },
1445 ['Vote Revealer'] = {
1446 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Vote Revealer'),
1447 ['Callback'] = function(e)
1448 C['Notifications']['Send']('Vote Revealer', ui['get'](e))
1449 end
1450 },
1451 ['Team Only'] = {
1452 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Team Only [chat msgs]'),
1453 ['Callback'] = function(e)
1454 C['Notifications']['Send']('Team Only', ui['get'](e))
1455 end
1456 },
1457 ['Use Spam'] = {
1458 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Use Spam'),
1459 ['Hidden'] = {
1460 ['Speed'] = ui['new_slider'](C['Config']['Panel'], C['Config']['Side'], 'Spam Delay', 1, 100, 5, true, '%'),
1461 ['Key'] = ui['new_hotkey'](C['Config']['Panel'], C['Config']['Side'], 'Spam Key', true)
1462 },
1463 ['Callback'] = function(e)
1464 local bool = ui['get'](e)
1465 ui['set_visible'](C['UI']['Utilities']['Use Spam']['Hidden']['Speed'], bool)
1466 ui['set_visible'](C['UI']['Utilities']['Use Spam']['Hidden']['Key'], bool)
1467 C['Notifications']['Send']('Use Spam', bool)
1468 end
1469 },
1470 ['Plasma Shot'] = {
1471 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Plasma Shot'),
1472 ['Hidden'] = {
1473 ['Key'] = ui['new_hotkey'](C['Config']['Panel'], C['Config']['Side'], 'Key', true)
1474 },
1475 ['Callback'] = function(e)
1476 local bool = ui['get'](e)
1477 ui['set_visible'](C['UI']['Utilities']['Plasma Shot']['Hidden']['Key'], bool)
1478 C['Notifications']['Send']('Plasma Shot', bool)
1479 end
1480 },
1481 ['Auto Leave'] = {
1482 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Auto DC [end of game]'),
1483 ['Callback'] = function(e)
1484 C['Notifications']['Send']('Auto DC', ui['get'](e))
1485 end
1486 },
1487 ['Start Ping'] = {
1488 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Discord Ping [match start]'),
1489 ['Callback'] = function(e)
1490 local bool = ui['get'](e)
1491
1492 local base = C['DB']['Ping']
1493 local cmdBase = C['ConCmd']['Cmds']
1494
1495 if (database['read'](base['ID']) == nil or database['read'](base['Webhook']) == nil) then
1496 C['Notifications']['Send']('Error', not bool, 'You must set a discord id & webhook to use this.', 'err')
1497
1498 if (database['read'](base['ID']) == nil) then
1499 C['Notifications']['Send']('', not bool, 'Type ' .. cmdBase['id']['Usage'] .. ' in the console.', 'err')
1500 end
1501
1502 if (database['read'](base['Webhook']) == nil) then
1503 C['Notifications']['Send']('', not bool, 'Type cyrus_webhook ' .. cmdBase['webhook']['Usage'] .. ' in the console.', 'err')
1504 end
1505
1506 ui['set'](e, false)
1507 else
1508 C['Notifications']['Send']('Discord Match Start Ping', bool)
1509 end
1510 end
1511 },
1512 ['End Ping'] = {
1513 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Discord Ping [match end]'),
1514 ['Callback'] = function(e)
1515 local bool = ui['get'](e)
1516
1517 local base = C['DB']['Ping']
1518 local cmdBase = C['ConCmd']['Cmds']
1519
1520 if (database['read'](base['ID']) == nil or database['read'](base['WebhookEnd']) == nil) then
1521 C['Notifications']['Send']('Error', not bool, 'You must set a discord id & webhook to use this.', 'err')
1522
1523 if (database['read'](base['ID']) == nil) then
1524 C['Notifications']['Send']('', not bool, 'Type ' .. cmdBase['id']['Usage'] .. ' in the console.', 'err')
1525 end
1526
1527 if (database['read'](base['WebhookEnd']) == nil) then
1528 C['Notifications']['Send']('', not bool, 'Type cyrus_webhook_end ' .. cmdBase['webhook_end']['Usage'] .. ' in the console.', 'err')
1529 end
1530
1531 ui['set'](e, false)
1532 else
1533 C['Notifications']['Send']('Discord Match End Message', bool)
1534 end
1535 end
1536 }
1537 },
1538 ['Spam'] = {
1539 ['Type'] = {
1540 ['Element'] = ui['new_combobox'](C['Config']['Panel'], C['Config']['Side'], 'Spam Type', {'-', 'Kill', 'Death', 'Chat'}),
1541 ['Hidden'] = {
1542 ['Messages'] = {
1543 ['Element'] = ui['new_combobox'](C['Config']['Panel'], C['Config']['Side'], 'Message', {'Off', 'Insult', 'Insult (Caps)', 'Cancer Strike', 'Super Cancer Strike', 'Annoying Question'}),
1544 ['Callback'] = function(e)
1545 local base = C['UI']['Spam']['Type']
1546 local type = ui['get'](base['Element'])
1547 local msg = ui['get'](base['Hidden']['Messages']['Element'])
1548 local chatBase = C['Chat']['Spam']['Types']
1549
1550 local bool = (msg == 'Off')
1551
1552 if (chatBase[type] ~= msg) then
1553 if (bool) then
1554 C['Notifications']['Send'](type .. ' Say', not bool)
1555 else
1556 C['Notifications']['Send'](type .. ' Say', not bool, msg)
1557 end
1558 end
1559
1560 if (type ~= '-') then
1561 chatBase[type] = msg
1562 end
1563 end
1564 },
1565 ['Speed'] = ui['new_slider'](C['Config']['Panel'], C['Config']['Side'], 'Spam Delay', 5, 150, 70, true, '%'),
1566 },
1567 ['Callback'] = function(e)
1568 local type = ui['get'](e)
1569 local bool = (type == '-')
1570 local base = C['UI']['Spam']['Type']['Hidden']
1571 local msgs = base['Messages']['Element']
1572 local speed = base['Speed']
1573
1574 if (bool) then
1575 ui['set_visible'](msgs, not bool)
1576 ui['set_visible'](speed, type == 'Chat')
1577 else
1578 ui['set_visible'](speed, type == 'Chat')
1579 ui['set_visible'](msgs, not bool)
1580
1581 ui['set'](msgs, C['Chat']['Spam']['Types'][ ui['get'](C['UI']['Spam']['Type']['Element']) ])
1582 end
1583 end
1584 },
1585 ['ShitPostList'] = {
1586 ['Element'] = ui['new_combobox'](C['Config']['Panel'], C['Config']['Side'], 'Shitpost List', {'Insult', 'Insult (Caps)', 'Cancer Strike', 'Super Cancer Strike', 'Annoying Question'}),
1587 ['Callback'] = function(e)
1588 local type = ui['get'](e)
1589 C['Notifications']['Send']('Shit Post', true, type)
1590 end
1591 },
1592 ['Execute'] = {
1593 ['Element'] = ui['new_button'](C['Config']['Panel'], C['Config']['Side'], 'Execute Shitpost', function(e) return end),
1594 ['Callback'] = function(e)
1595 local base = C['Funcs']
1596 local spamType = ui['get']( C['UI']['Spam']['ShitPostList']['Element'])
1597 local msg = base['GetShitPost'](spamType)
1598
1599 if (ui['get'](C['UI']['Other']['Translator']['Hidden']['Chat']) and not C['Vars']['Translator']['OnCD']) then
1600 base['DoChatTranslation'](msg, false)
1601 else
1602 local chatMode = base['GetChatMode']()
1603 client['exec'](chatMode, msg)
1604 end
1605 end
1606 }
1607 },
1608 ['MM'] = {
1609 ['AFK Buy-Drop'] = {
1610 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'AFK Buy-Drop [!buy xx]'),
1611 ['Callback'] = function(e)
1612 C['Notifications']['Send']('AFK Buy-Drop', ui['get'](e))
1613 end
1614 },
1615 ['Damage Logs'] = {
1616 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Damage Logs [against enemy team]'),
1617 ['Callback'] = function(e)
1618 C['Notifications']['Send']('Damage Logs', ui['get'](e))
1619 end
1620 },
1621 ['TD Notifier'] = {
1622 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Team Damage Notifications [ur team only]'),
1623 ['Callback'] = function(e)
1624 C['Notifications']['Send']('Team Damage Notifier', ui['get'](e))
1625 end
1626 },
1627 ['Target Team'] = {
1628 ['Element'] = ui['new_combobox'](C['Config']['Panel'], C['Config']['Side'], 'Target Team [rank dump]', {'Enemy', 'Team', 'All'}),
1629 ['Callback'] = function(e)
1630 C['Notifications']['Send']('Target Team', true, ui['get'](e))
1631 end
1632 },
1633 ['Notification Type'] = {
1634 ['Element'] = ui['new_multiselect'](C['Config']['Panel'], C['Config']['Side'], 'Notification Type [rank dump]', {'Chat Print', 'Chat Msg', 'Party Chat'}),
1635 ['Callback'] = function(e)
1636 local msg = ''
1637 local col = C['Colours']
1638 local tab = ui['get'](e)
1639
1640 if (#tab > 0) then
1641 for _, v in pairs(tab) do
1642 msg = msg .. col['Purple'] .. v .. col['White'] .. ', '
1643 end
1644
1645 msg = msg:sub(1, #msg - 2)
1646
1647 C['Notifications']['Send']('Rank Notification', true, msg)
1648 end
1649 end
1650 },
1651 ['Rank Dump'] = {
1652 ['Element'] = ui['new_button'](C['Config']['Panel'], C['Config']['Side'], 'Dump Rank + Wins', function(e) return end),
1653 ['Callback'] = function(e)
1654 local players = 0
1655 local col = C['Colours']
1656 local funcs = C['Funcs']
1657 local hasValue = funcs['table.HasValue']
1658 local tab = ui['get'](C['UI']['MM']['Notification Type']['Element'])
1659 local targetTeam = ui['get'](C['UI']['MM']['Target Team']['Element'])
1660 local myTeam = funcs['GetTeam'](entity['get_local_player']())
1661
1662 for i = 1, globals['maxplayers']() do
1663 local team = funcs['GetTeam'](i)
1664
1665 if (funcs['IsConnected'](i)) then
1666 if ((team == 2 or team == 3) and funcs['IsHuman'](i)) then
1667 if (targetTeam == 'Enemy' and team ~= myTeam) or (targetTeam == 'Team' and team == myTeam) or (targetTeam == 'All') then
1668 local nick = entity['get_player_name'](i)
1669 local wins = funcs['GetCompWins'](i)
1670 local rank = funcs['GetCompRank'](i)
1671
1672 local msg = nick.. ' has ' .. wins .. ' wins (' .. rank .. ')'
1673 local msg_chat = col['Gold'] .. nick .. col['White'] .. ' has ' .. col['Purple'] .. wins .. col['White'] .. ' wins (' .. col['Red'] .. rank .. col['White'] .. ')'
1674
1675 if (hasValue(tab,'Chat Msg')) then
1676 client['delay_call'](funcs['GetChatDelay'](players), function()
1677 client['exec'](funcs['GetChatMode'](), msg)
1678 end)
1679 end
1680
1681 if (hasValue(tab, 'Chat Print')) then
1682 C['Notifications']['Send']('', true, msg_chat, 'rank')
1683 end
1684
1685 if (hasValue(tab, 'Party Chat')) then
1686 msg = msg:gsub(' ', ' ')
1687 funcs['PartyChatSay'](msg)
1688 end
1689
1690 players = players + 1
1691 end
1692 end
1693 end
1694 end
1695 end
1696 }
1697 },
1698 ['Other'] = {
1699 ['Translator'] = {
1700 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Translator'),
1701 ['Hidden'] = {
1702 ['Chat'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Auto Translate Outoging Messages', false),
1703 ['OGMsg'] = {
1704 ['Element'] = ui['new_checkbox'](C['Config']['Panel'], C['Config']['Side'], 'Display OG message', false),
1705 ['Callback'] = function(e)
1706 C['Notifications']['Send']('Display OG Translation Message', ui['get'](e))
1707 end
1708 },
1709 ['lblLocal'] = ui['new_label'](C['Config']['Panel'], C['Config']['Side'], 'Local Language [yours]'),
1710 ['Local'] = ui['new_textbox'](C['Config']['Panel'], C['Config']['Side'], 'en'),
1711 ['lblSource'] = ui['new_label'](C['Config']['Panel'], C['Config']['Side'], 'From Language'),
1712 ['Source'] = ui['new_textbox'](C['Config']['Panel'], C['Config']['Side'], 'en'),
1713 ['lblTo'] = ui['new_label'](C['Config']['Panel'], C['Config']['Side'], 'To Language'),
1714 ['To'] = ui['new_textbox'](C['Config']['Panel'], C['Config']['Side'], 'ru')
1715 },
1716 ['Callback'] = function(e)
1717 local base = C['UI']['Other']['Translator']['Hidden']
1718 local get = ui['get']
1719 local bool = get(e)
1720
1721 if (get(base['Local']) == '') then
1722 ui['set'](base['Local'], 'en')
1723 end
1724
1725 if (get(base['Source']) == '') then
1726 ui['set'](base['Source'], 'auto')
1727 end
1728
1729 if (get(base['To']) == '') then
1730 ui['set'](base['To'], 'ru')
1731 end
1732
1733 for _, v in pairs(base) do
1734 if (type(v) ~= 'table') then
1735 ui['set_visible'](v, bool)
1736 end
1737 end
1738
1739 ui['set_visible'](base['OGMsg']['Element'], bool)
1740
1741 C['Notifications']['Send']('Translator', bool)
1742 end
1743 }
1744 }
1745}
1746
1747C['Events'] = {
1748 ['run_command'] = {
1749 ['Func'] = function(e)
1750 if (C['Chat']['Spam']['Types']['Chat'] ~= 'Off') then
1751 if (globals['tickcount']() >= (C['Chat']['Spam']['LastChatMessage'] + ui['get'](C['UI']['Spam']['Type']['Hidden']['Speed']))) then
1752 local spamType = C['Chat']['Spam']['Types']['Chat']
1753 local funcs = C['Funcs']
1754 local msg = funcs['GetShitPost'](spamType)
1755
1756 if (ui['get'](C['UI']['Other']['Translator']['Hidden']['Chat']) and not C['Vars']['Translator']['OnCD']) then
1757 funcs['DoChatTranslation'](msg, false)
1758 else
1759 local chatMode = funcs['GetChatMode']()
1760 client['exec'](chatMode, msg)
1761 end
1762
1763 C['Chat']['Spam']['LastChatMessage'] = globals['tickcount']()
1764 end
1765 end
1766
1767 if (ui['get'](C['UI']['Utilities']['Radio Spam']['Element'])) then
1768 if (globals['tickcount']() >= (C['Chat']['Spam']['LastRadioMessage'] + ui['get'](C['UI']['Utilities']['Radio Spam']['Hidden']['Speed']))) then
1769 client['exec'](C['Chat']['Spam']['RadioMessage'])
1770
1771 C['Chat']['Spam']['LastRadioMessage'] = globals['tickcount']()
1772 end
1773 end
1774
1775 if (ui['get'](C['UI']['Utilities']['Vote Revealer']['Element'])) then
1776 for team, vote in pairs(C['Votes']['OnGoingVotes']) do
1777 if (entity['get_prop'](vote['controller'], 'm_iActiveIssueIndex') ~= vote['IssueIndex']) then
1778 C['Votes']['OnGoingVotes'][team] = nil
1779 end
1780 end
1781 end
1782 end
1783 },
1784 ['setup_command'] = {
1785 ['Func'] = function(cmd)
1786 if (ui['get'](C['UI']['Utilities']['Use Spam']['Element'])) then
1787 local base = C['Vars']['UseSpam']
1788
1789 if (ui['get'](C['UI']['Utilities']['Use Spam']['Hidden']['Key'])) then
1790 if (globals['tickcount']() >= (base['LastSwap'] + ui['get'](C['UI']['Utilities']['Use Spam']['Hidden']['Speed']))) then
1791 base['LastSwap'] = globals['tickcount']()
1792 cmd.in_use = base['Swap']
1793 base['Swap'] = not base['Swap']
1794 end
1795 end
1796 end
1797 end
1798 },
1799 ['player_death'] = {
1800 ['Func'] = function(e)
1801 if (e['userid'] and e['attacker']) then
1802 local attacker = client['userid_to_entindex'](e['attacker'])
1803 local victim = client['userid_to_entindex'](e['userid'])
1804 local base = C['UI']
1805 local me = entity['get_local_player']()
1806
1807 if (C['Chat']['Spam']['Types']['Kill'] ~= 'Off' or C['Chat']['Spam']['Types']['Death'] ~= 'Off') then
1808 local funcs = C['Funcs']
1809 local chatMode = funcs['GetChatMode']()
1810
1811 if (C['Chat']['Spam']['Types']['Kill'] ~= 'Off' and attacker == me and entity['is_enemy'](victim)) then
1812 local spamType = C['Chat']['Spam']['Types']['Kill']
1813 local msg = funcs['GetShitPost'](spamType)
1814
1815 if (ui['get'](C['UI']['Other']['Translator']['Hidden']['Chat']) and not C['Vars']['Translator']['OnCD']) then
1816 funcs['DoChatTranslation'](msg, false)
1817 else
1818 client['exec'](chatMode, msg)
1819 end
1820 end
1821
1822 if (C['Chat']['Spam']['Types']['Death'] ~= 'Off' and entity['is_enemy'](attacker) and victim == me) then
1823 local spamType = C['Chat']['Spam']['Types']['Death']
1824 local msg = funcs['GetShitPost'](spamType)
1825
1826 if (ui['get'](C['UI']['Other']['Translator']['Hidden']['Chat']) and not C['Vars']['Translator']['OnCD']) then
1827 funcs['DoChatTranslation'](msg, false)
1828 else
1829 client['exec'](chatMode, msg)
1830 end
1831 end
1832 end
1833
1834 if (ui['get'](base['MM']['TD Notifier']['Element'])) then
1835 local getTeam = C['Funcs']['GetTeam']
1836
1837 if (getTeam(attacker) == getTeam(me) and getTeam(victim) == getTeam(me) and attacker ~= victim) then
1838 local col = C['Colours']
1839 local victimNick = col['Purple'] .. entity['get_player_name'](victim) .. col['White']
1840 local attackerNick = col['LightGreen'] .. entity['get_player_name'](attacker) .. col['White']
1841
1842 local id = e['attacker']
1843
1844 if (C['Vars']['TeamKillData'][id] == nil) then
1845 C['Vars']['TeamKillData'][id] = {['dmg'] = 0, ['kills'] = 0}
1846 end
1847
1848 C['Vars']['TeamKillData'][id]['kills'] = C['Vars']['TeamKillData'][id]['kills'] + 1
1849
1850 C['Notifications']['Send']('TK ', not bool, attackerNick .. ' killed ' .. victimNick .. ' (' .. C['Vars']['TeamKillData'][id]['kills'] .. '/3)', 'tk')
1851 end
1852 end
1853 end
1854 end
1855 },
1856 ['player_hurt'] = {
1857 ['Func'] = function(e)
1858 if (e['userid'] and e['attacker']) then
1859 local attacker = client['userid_to_entindex'](e['attacker'])
1860 local victim = client['userid_to_entindex'](e['userid'])
1861 local col = C['Colours']
1862 local me = entity['get_local_player']()
1863 local getTeam = C['Funcs']['GetTeam']
1864
1865 if (ui['get'](C['UI']['MM']['TD Notifier']['Element'])) then
1866 if (getTeam(attacker) == getTeam(me) and getTeam(victim) == getTeam(me) and attacker ~= victim) then
1867 local dmgDealt = col['Red'] .. e['dmg_health'] .. col['White']
1868 local victimNick = col['Purple'] .. entity['get_player_name'](victim) .. col['White']
1869 local attackerNick = col['LightGreen'] .. entity['get_player_name'](attacker) .. col['White']
1870 local id = e['attacker']
1871
1872 if (C['Vars']['TeamKillData'][id] == nil) then
1873 C['Vars']['TeamKillData'][id] = {['dmg'] = 0, ['kills'] = 0}
1874 end
1875
1876 C['Vars']['TeamKillData'][id]['dmg'] = C['Vars']['TeamKillData'][id]['dmg'] + e['dmg_health']
1877
1878 C['Notifications']['Send']('TK ', not bool, attackerNick .. ' hurt ' .. victimNick .. ' for ' .. dmgDealt .. ' (' .. C['Vars']['TeamKillData'][id]['dmg'] .. '/' .. cvar['mp_td_dmgtokick']:get_int() .. ')', 'tk')
1879 end
1880 end
1881
1882 if (ui['get'](C['UI']['MM']['Damage Logs']['Element']) and attacker == me and getTeam(me) ~= getTeam(victim)) then
1883 local victimNick = entity['get_player_name'](victim)
1884 local shot = C['Vars']['HitLog']['ShotInfo'][e['id']]
1885
1886 local msg = col['Gold'] .. victimNick .. col['White'] .. ' in: ' .. col['Purple'] .. C['Vars']['HitLog']['Hit Groups'][e['hitgroup']]
1887 msg = msg .. col['White'] .. ' for: ' .. col['Green'] .. e['dmg_health'] .. col['White'] .. ' dmg (' .. col['Red'] .. e['health'] .. col['White'] .. ' hp remaining)'
1888
1889 C['Notifications']['Send'](col['White'] .. 'Hit: ', true, msg, 'hitlog')
1890 end
1891 end
1892 end
1893 },
1894 ['round_announce_match_start'] = {
1895 ['Func'] = function(e)
1896 C['Vars']['TeamKillData'] = {}
1897
1898 if (ui['get'](C['UI']['Utilities']['Start Ping']['Element'])) then
1899 local map = globals['mapname']() .. [[\n\n]]
1900 local base = C['DB']['Ping']
1901 local teamInitials = C['Funcs']['GetTeamInitials']
1902 local pingPlyTbl = C['Funcs']['StartPlayerTable']
1903
1904 local content = '<@' .. database['read'](base['ID']) .. [[> CS:GO Match Started\n\n]]
1905 content = content .. '**Map:** ' .. map
1906 content = content .. '**Your Team (' .. teamInitials(true) .. ')**' .. pingPlyTbl(true)
1907 content = content .. '**Enemy Team (' .. teamInitials(false) .. ')**' .. pingPlyTbl(false)
1908
1909 panorama['loadstring']([[
1910 $.AsyncWebRequest(']] .. database['read'](base['Webhook']) .. [[',
1911 {
1912 type: 'POST',
1913 data: {
1914 'content': ']] .. content .. [['
1915 },
1916 complete: function (data){
1917 }
1918 });
1919 ]])()
1920 end
1921 end
1922 },
1923 ['cs_win_panel_match'] = {
1924 ['Func'] = function(e)
1925 C['Vars']['TeamKillData'] = {}
1926
1927 client.delay_call(0.1, function()
1928 if (ui['get'](C['UI']['Utilities']['End Ping']['Element'])) then
1929 local map = globals['mapname']() .. [[\n\n]]
1930 local base = C['DB']['Ping']
1931 local teamInitials = C['Funcs']['GetTeamInitials']
1932 local teamRounds = C['Funcs']['GetTeamRounds']
1933 local pingPlyTbl = C['Funcs']['EndPlayerTable']
1934 local gameScore = teamRounds(true) .. ':' .. teamRounds(false)
1935
1936 local content = [[CS:GO Match Finished\n\n]]
1937 content = content .. '**Map:** ' .. map
1938 content = content .. '**Score**: ' .. gameScore .. [[\n\n]]
1939 content = content .. '**Your Team (' .. teamInitials(true) .. ')**' .. pingPlyTbl(true)
1940 content = content .. '**Enemy Team (' .. teamInitials(false) .. ')**' .. pingPlyTbl(false)
1941
1942 panorama['loadstring']([[
1943
1944 $.AsyncWebRequest(']] .. database['read'](base['WebhookEnd']) .. [[',
1945 {
1946 type: 'POST',
1947 data: {
1948 'content': ']] .. content .. [['
1949 },
1950 complete: function (data){
1951 }
1952 });
1953 ]])()
1954 end
1955
1956 if (ui['get'](C['UI']['Utilities']['Auto Leave']['Element'])) then
1957 client['exec']('disconnect')
1958 end
1959 end)
1960 end
1961 },
1962 ['cs_game_disconnected'] = {
1963 ['Func'] = function(e)
1964 C['Vars']['TeamKillData'] = {}
1965 end
1966 },
1967 ['vote_options'] = {
1968 ['Func'] = function(e)
1969 C['Votes']['VoteOptions'] = {e.option1, e.option2, e.option3, e.option4, e.option5}
1970 for i =#C['Votes']['VoteOptions'], 1, -1 do
1971 if (C['Votes']['VoteOptions'][i] == '') then
1972 table['remove'](C['Votes']['VoteOptions'], i)
1973 end
1974 end
1975 end
1976 },
1977 ['vote_cast'] = {
1978 ['Func'] = function(e)
1979 client['delay_call'](0.3, function()
1980 if (ui['get'](C['UI']['Utilities']['Vote Revealer']['Element'])) then
1981 local team = e['team']
1982 local base = C['Votes']
1983
1984 if (C['Votes']['VoteOptions']) then
1985 local controller
1986 local voteControllers = entity['get_all']('CVoteController')
1987
1988 for i = 1, #voteControllers do
1989 if entity['get_prop'](voteControllers[i], 'm_iOnlyTeamToVote') == team then
1990 controller = voteControllers[i]
1991 break
1992 end
1993 end
1994
1995 if (controller) then
1996 local ongoingVote = {
1997 ['team'] = team,
1998 ['options'] = C['Votes']['VoteOptions'],
1999 ['controller'] = controller,
2000 ['IssueIndex'] = entity['get_prop'](controller, 'm_iActiveIssueIndex'),
2001 ['votes'] = {}
2002 }
2003
2004 for i = 1, #C['Votes']['VoteOptions'] do
2005 ongoingVote['votes'][C['Votes']['VoteOptions'][i]] = {}
2006 end
2007
2008 ongoingVote['type'] = C['Votes']['IndicesNoteam'][ongoingVote['IssueIndex']]
2009
2010 if (team ~= -1 and C['Votes']['IndicesTeam'][ongoingVote['IssueIndex']]) then
2011 ongoingVote['type'] = C['Votes']['IndicesTeam'][ongoingVote['IssueIndex']]
2012 end
2013
2014 C['Votes']['OnGoingVotes']['team'] = ongoingVote
2015 end
2016
2017 C['Votes']['VoteOptions'] = nil
2018 end
2019
2020 local ongoingVote = C['Votes']['OnGoingVotes']['team']
2021 if (ongoingVote) then
2022 local player = e['entityid']
2023 local col = C['Colours']
2024
2025 local voteText = ongoingVote['options'][e['vote_option'] + 1]
2026 local voteTextCol = (voteText == 'Yes' and col['Green'] .. 'Yes' .. col['White'] or col['Red'] .. 'No' .. col['White'])
2027
2028 table['insert'](ongoingVote['votes'][voteText], player)
2029
2030 local colToUse = (team == 3 and col['Blue'] or col['LightYellow'])
2031
2032 if (voteText == 'Yes' and ongoingVote['caller'] == nil) then
2033 ongoingVote['caller'] = player
2034
2035 if (ongoingVote['type'] ~= 'kick') then
2036 local msg = col['White'] .. ' - ' .. colToUse .. entity['get_player_name'](player) .. col['White'] .. ' called a vote to ' .. col['Purple'] .. C['Votes']['Descriptions'][ongoingVote['type']] .. col['White']
2037
2038 C['Notifications']['Send']('Vote', false, msg, 'vote')
2039 end
2040 end
2041
2042 if (ongoingVote['type'] == 'kick') then
2043 if (voteText == 'No') then
2044 if (ongoingVote['target'] == nil) then
2045 ongoingVote['target'] = player
2046
2047 local teamName = 'The ' .. (team == 3 and 'CT\'s' or 'T\'s') .. col['White']
2048
2049 local msg = col['White'] .. ' - ' .. col['White'] .. colToUse .. teamName .. ' called a vote to ' .. col['Purple'] .. C['Votes']['Descriptions'][ongoingVote['type']] .. ' ' .. colToUse .. entity['get_player_name'](ongoingVote['target']) .. col['White']
2050
2051 C['Notifications']['Send']('Vote', false, msg, 'vote')
2052 end
2053 end
2054 end
2055
2056 local msg = col['White'] .. ' - ' .. colToUse .. entity['get_player_name'](player) .. col['White'] .. ' voted ' .. voteTextCol
2057 C['Notifications']['Send']('Vote', false, msg, 'vote')
2058
2059 end
2060 end
2061 end)
2062 end
2063 },
2064 ['aim_fire'] = {
2065 ['Func'] = function(e)
2066 C['Vars']['HitLog']['ShotInfo'][e['id']] = e
2067 end
2068 },
2069 ['aim_hit'] = {
2070 ['Func'] = function(e)
2071 C['Vars']['HitLog']['Hit'][e['target']] = e['id']
2072 end
2073 },
2074 ['aim_miss'] = {
2075 ['Func'] = function(e)
2076 if (ui['get'](C['UI']['MM']['Damage Logs']['Element'])) then
2077 local target = e['target']
2078 local nick = entity['get_player_name'](target)
2079 local shot = C['Vars']['HitLog']['ShotInfo'][e['id']]
2080 local col = C['Colours']
2081
2082 local white = col['White']
2083
2084 local msg = col['Gold'] .. nick .. white .. '\'s ' .. col['Purple'] .. C['Vars']['HitLog']['Hit Groups'][shot['hitgroup']]
2085 msg = msg .. white .. ' (R: ' .. col['LightGreen'] .. e['reason'] .. white .. ', HC: ' .. col['LightRed'] .. math['floor'](shot['hit_chance'])
2086 msg = msg .. white .. ', Damage: ' .. col['LightRed'] .. shot['damage'] .. white .. ')'
2087
2088 C['Notifications']['Send'](white .. 'Missed: ', true, msg, 'hitlog')
2089 end
2090 end
2091 },
2092 ['player_chat'] = {
2093 ['Func'] = function(e)
2094 local speaker = e['entity']
2095 local speakerTeam = C['Funcs']['GetTeam'](speaker)
2096 local me = entity['get_local_player']()
2097 local myTeam = C['Funcs']['GetTeam'](me)
2098 local text = e['text']
2099
2100 if (ui['get'](C['UI']['MM']['AFK Buy-Drop']['Element'])) then
2101 local prefix = C['Chat']['CmdPrefix']
2102
2103 if (text:sub(1,#prefix) == prefix) then
2104 text = C['Funcs']['string.Explode'](' ', text)
2105 local cmd = text[1]:sub(#prefix + 1, #text[1])
2106
2107 if (C['Funcs']['IsValidChatCmd'](cmd)) then
2108 text[1] = nil
2109 C['Chat']['Commands'][cmd]['Func'](text, speaker)
2110 end
2111 end
2112 end
2113
2114 if (ui['get'](C['UI']['Other']['Translator']['Element']) and not C['Vars']['Translator']['OnCD'] and speaker ~= me) then
2115 C['Funcs']['DoChatTranslation'](text, true, speaker == me)
2116 end
2117 end
2118 },
2119 ['weapon_fire'] = {
2120 ['Func'] = function(e)
2121 if (ui['get'](C['UI']['Utilities']['Plasma Shot']['Element'])) then
2122 local me = entity['get_local_player']()
2123 local shooter = client['userid_to_entindex'](e['userid'])
2124
2125 if (C['Funcs']['HasTaser'](me) and ui['get'](C['UI']['Utilities']['Plasma Shot']['Hidden']['Key'])) then
2126 if (shooter == me) then
2127 local cmd = client['exec']
2128
2129 cmd('use weapon_taser')
2130
2131 client['delay_call'](C['Funcs']['GetChatDelay'](0.001), function()
2132 cmd('lastinv')
2133 end)
2134
2135 end
2136 end
2137 end
2138 end
2139 },
2140 ['console_input'] = {
2141 ['Func'] = function(text)
2142 if (text:sub(1, 5) == 'cyrus') then
2143 text = C['Funcs']['string.Explode'](' ', text)
2144 local cmd = text[1]:sub(#'cyrus_' + 1, #text[1])
2145
2146 if (C['Funcs']['IsValidConsoleCmd'](cmd)) then
2147 text[1] = nil
2148 C['ConCmd']['Cmds'][cmd]['Func'](text)
2149 return true
2150 else
2151 C['Notifications']['ConsoleLog']('Invalid command entered, see cyrus_help for list of commands.', true, '')
2152 end
2153 end
2154 end
2155 },
2156 ['string_cmd'] = {
2157 ['Func'] = function(e)
2158 local text = e['text']
2159 local message = text:sub(#'say "' + 1, #text - 1)
2160
2161 if (ui['get'](C['UI']['Other']['Translator']['Element'])) then
2162 if (message:sub(1, #'.tsay ') == '.tsay ') then
2163 local language = message:sub(#'.tsay ' + 1, string.find(message, ' ', #'.tsay ' + 1) - 1)
2164 local translateMsg = message:sub(#('.tsay ' .. language) + 2, #message)
2165
2166 C['Funcs']['DoChatTranslation'](translateMsg, false, true, language)
2167 return true
2168 end
2169
2170 if (ui['get'](C['UI']['Other']['Translator']['Hidden']['Chat']) and not C['Vars']['Translator']['OnCD']) then
2171 if (text:sub(1, 5) == 'say "' and text ~= 'say ""' and text ~= 'say " "') then
2172 C['Funcs']['DoChatTranslation'](message, false, true)
2173 return true
2174 end
2175 end
2176 end
2177 end
2178 }
2179}
2180
2181for event, entry in pairs(C['Events']) do
2182 client['set_event_callback'](event, entry['Func'])
2183end
2184
2185for cat, entry in pairs(C['UI']) do
2186 for var, table in pairs(entry) do
2187 if (table['Hidden']) then
2188 for _, hidden in pairs(table['Hidden']) do
2189 if (type(hidden) == 'table') then
2190 ui['set_callback'](hidden['Element'], hidden['Callback'])
2191 ui['set_visible'](hidden['Element'], false)
2192 else
2193 ui['set_visible'](hidden, false)
2194 end
2195 end
2196 end
2197
2198 ui['set_callback'](table['Element'], table['Callback'])
2199 end
2200end
2201
2202C['Funcs']['PrintChangelogs']()
2203© 2020 GitHub, Inc.
2204Terms
2205Privacy
2206Security
2207Status
2208Help
2209Contact GitHub
2210Pricing
2211API
2212Training
2213Blog
2214About