· 5 years ago · May 25, 2020, 11:54 PM
1client.set_event_callback
2client.unset_event_callback
3client.log
4client.color_log
5client.error_log
6client.exec
7client.userid_to_entindex
8client.draw_debug_text
9client.draw_hitboxes
10client.random_int
11client.random_float
12client.screen_size
13client.visible
14client.trace_line
15client.trace_bullet
16client.scale_damage
17client.delay_call
18client.latency
19client.camera_angles
20client.camera_position
21client.timestamp
22client.eye_position
23client.set_clan_tag
24client.system_time
25client.unix_time
26client.reload_active_scripts
27client.create_interface
28client.find_signature
29client.key_state
30client.get_model_name
31client.register_esp_flag
32config.load
33config.export
34cvar.set_string
35cvar.get_string
36cvar.set_float
37cvar.set_raw_float
38cvar.get_float
39cvar.set_int
40cvar.set_raw_int
41cvar.get_int
42cvar.invoke_callback
43database.write
44database.read
45entity.get_local_player
46entity.get_all
47entity.get_players
48entity.get_game_rules
49entity.get_player_resource
50entity.get_classname
51entity.set_prop
52entity.get_prop
53entity.is_enemy
54entity.is_alive
55entity.is_dormant
56entity.get_player_name
57entity.get_player_weapon
58entity.hitbox_position
59entity.get_steam64
60entity.get_bounding_box
61entity.get_origin
62entity.get_esp_data
63globals.realtime
64globals.curtime
65globals.frametime
66globals.absoluteframetime
67globals.maxplayers
68globals.tickcount
69globals.tickinterval
70globals.framecount
71globals.mapname
72globals.lastoutgoingcommand
73globals.oldcommandack
74globals.commandack
75globals.chokedcommands
76panorama.open
77panorama.loadstring
78materialsystem.get_name
79materialsystem.reload
80materialsystem.color_modulate
81materialsystem.alpha_modulate
82materialsystem.set_shader_param
83materialsystem.get_shader_param
84materialsystem.set_material_var_flag
85materialsystem.get_material_var_flag
86materialsystem.find_material
87materialsystem.find_materials
88materialsystem.find_texture
89materialsystem.get_model_materials
90materialsystem.arms_material
91materialsystem.chams_material
92plist.set
93plist.get
94renderer.text
95renderer.measure_text
96renderer.rectangle
97renderer.line
98renderer.gradient
99renderer.circle
100renderer.circle_outline
101renderer.triangle
102renderer.world_to_screen
103renderer.indicator
104renderer.texture
105renderer.load_svg
106renderer.load_png
107renderer.load_jpg
108renderer.load_rgba
109ui.new_checkbox
110ui.new_slider
111ui.new_combobox
112ui.new_multiselect
113ui.new_hotkey
114ui.new_button
115ui.new_color_picker
116ui.new_textbox
117ui.new_listbox
118ui.new_string
119ui.new_label
120ui.reference
121ui.set
122ui.get
123ui.set_callback
124ui.set_visible
125ui.is_menu_open
126ui.mouse_position
127ui.menu_position
128ui.menu_size
129ui.name
130client.set_event_callback
131syntax: client.set_event_callback(event_name, callback)
132
133event_name - Name of the event.
134
135callback - Lua function to call when this event occurs.
136
137Raises an error and prints a message in console upon failure.
138
139Back to TOC
140
141
142client.unset_event_callback
143syntax: client.unset_event_callback(event_name, callback)
144
145event_name - Name of the event
146
147callback - Lua function that was passed to set_event_callback
148
149Removes a callback that was previously set using set_event_callback
150
151Back to TOC
152
153
154client.log
155syntax: client.log(msg, ...)
156
157msg - The message
158
159... - Optional comma-separated arguments to concatenate with msg.
160
161Back to TOC
162
163
164client.color_log
165syntax: client.color_log(r, g, b, msg, ...)
166
167r - Red (0-255)
168
169g - Green (0-255)
170
171b - Blue (0-255)
172
173msg - The message
174
175... - Optional comma-separated arguments to concatenate with msg.
176
177Back to TOC
178
179
180client.error_log
181syntax: client.error_log(msg)
182
183msg - The error message
184
185Back to TOC
186
187
188client.exec
189syntax: client.exec(cmd, ...)
190
191cmd - The console command(s) to execute.
192
193... - Optional comma-separated arguments to concatenate with cmd.
194
195Back to TOC
196
197
198client.userid_to_entindex
199syntax: client.userid_to_entindex(userid)
200
201userid - This is given by some game events.
202
203Returns the entity index, or 0 on failure.
204
205Back to TOC
206
207
208client.draw_debug_text
209syntax: client.draw_debug_text(x, y, z, line_offset, duration, r, g, b, a, ...)
210
211x - Position in world space
212
213y - Position in world space
214
215z - Position in world space
216
217line_offset - Used for vertical alignment, use 0 for the first line.
218
219duration - Time in seconds that the text will remain on the screen.
220
221r - Red (1-255)
222
223g - Green (1-255)
224
225b - Blue (1-255)
226
227a - Alpha (1-255)
228
229... - The text that will be drawn
230
231Avoid calling this during the paint event.
232
233Back to TOC
234
235
236client.draw_hitboxes
237syntax: client.draw_hitboxes(entindex, duration, hitboxes, r, g, b, a, tick)
238
239entindex - Entity index
240
241duration - Time in seconds
242
243hitboxes - Either the hitbox index, an array of hitbox indices, or 19 for all hitboxes
244
245r - Red (1-255)
246
247g - Green (1-255)
248
249b - Blue (1-255)
250
251a - Alpha (1-255)
252
253tick - Optional integer
254
255Draws hitbox overlays. Avoid calling this during the paint event.
256
257Back to TOC
258
259
260client.random_int
261syntax: client.random_int(minimum, maximum)
262
263minimum - Lowest possible result
264
265maximum - Highest possible result
266
267Returns a random integer between minimum and maximum.
268
269Back to TOC
270
271
272client.random_float
273syntax: client.random_float(minimum, maximum)
274
275minimum - Lowest possible result
276
277maximum - Highest possible result
278
279Returns a random float between minimum and maximum.
280
281Back to TOC
282
283
284client.screen_size
285syntax: client.screen_size()
286
287Returns (width, height).
288
289Back to TOC
290
291
292client.visible
293syntax: client.visible(x, y, z)
294
295x - Position in world space
296
297y - Position in world space
298
299z - Position in world space
300
301Returns true if the position is visible. For example, you could use a player's origin to see if they are visible.
302
303Back to TOC
304
305
306client.trace_line
307syntax: client.trace_line(skip_entindex, from_x, from_y, from_z, to_x, to_y, to_z)
308
309skip_entindex - Ignore this entity while tracing
310
311from_x - Position in world space
312
313from_y - Position in world space
314
315from_z - Position in world space
316
317to_x - Position in world space
318
319to_y - Position in world space
320
321to_z - Position in world space
322
323Returns fraction, entindex. fraction is a percentage in the range [0.0, 1.0] that tells you how far the trace went before hitting something, so 1.0 means nothing was hit. entindex is the entity index that hit, or -1 if no entity was hit.
324
325Back to TOC
326
327
328client.trace_bullet
329syntax: client.trace_bullet(from_player, from_x, from_y, from_z, to_x, to_y, to_z, skip_players)
330
331from_player - Entity index of the player whose weapon will be used for this trace
332
333from_x - Position in world space
334
335from_y - Position in world space
336
337from_z - Position in world space
338
339to_x - Position in world space
340
341to_y - Position in world space
342
343to_z - Position in world space
344
345skip_players - Optional, pass true to skip expensive hitbox checks.
346
347Returns entindex, damage. Entindex is nil when no player is hit or if players are skipped.
348
349Back to TOC
350
351
352client.scale_damage
353syntax: client.scale_damage(entindex, hitgroup, damage)
354
355entindex - Player entity index
356
357hitgroup - Hit group index
358
359damage - Damage
360
361Returns adjusted damage for the specified hitgroup
362
363Back to TOC
364
365
366client.delay_call
367syntax: client.delay_call(delay, callback, ...)
368
369delay - Time in seconds to wait before calling callback.
370
371callback - The lua function that will be called after delay seconds.
372
373... - Optional arguments that will be passed to the callback.
374
375Back to TOC
376
377
378client.latency
379syntax: client.latency()
380
381Returns your latency in seconds.
382
383Back to TOC
384
385
386client.camera_angles
387syntax: client.camera_angles()
388
389Returns pitch, yaw, roll of where you are looking.
390
391Back to TOC
392
393
394client.camera_position
395syntax: client.camera_position()
396
397Returns x, y, z world coordinates of the camera position.
398
399Back to TOC
400
401
402client.timestamp
403syntax: client.timestamp()
404
405Returns high precision timestamp in milliseconds.
406
407Back to TOC
408
409
410client.eye_position
411syntax: client.eye_position()
412
413Returns x, y, z world coordinates of the local player's eye position, or nil on failure.
414
415Back to TOC
416
417
418client.set_clan_tag
419syntax: client.set_clan_tag(...)
420
421... - The text that will be drawn
422
423The clan tag is removed if no argument is passed or if it is an empty string. Additional arguments will be concatenated similar to client.log.
424
425Back to TOC
426
427
428client.system_time
429syntax: client.system_time()
430
431Returns hour, minute, seconds, milliseconds.
432
433local h, m, s, ms = client.system_time()
434
435Back to TOC
436
437
438client.unix_time
439syntax: client.unix_time()
440
441Returns hour, minute, seconds, milliseconds.
442
443local time = client.unix_time()
444
445Back to TOC
446
447
448client.reload_active_scripts
449syntax: client.reload_active_scripts()
450
451Reloads all scripts the following frame.
452
453Back to TOC
454
455
456client.create_interface
457syntax: client.create_interface(module_name, interface_name)
458
459module_name - Filename of the module that contains the interface
460
461interface_name - Name of the interface
462
463Returns a pointer to the interface, or nil on failure.
464
465Back to TOC
466
467
468client.find_signature
469syntax: client.find_signature(module_name, pattern)
470
471module_name - Filename of the module that contains the interface
472
473pattern - String in the form of '\x01\x02\xCC\x03'
474
475Finds the specified pattern and returns its address, or nil if not found. CC is wildcard.
476
477Back to TOC
478
479
480client.key_state
481syntax: client.key_state(virtual_key)
482
483virtual_key - Virtual key index
484
485Returns true if the key is pressed.
486
487Back to TOC
488
489
490client.get_model_name
491syntax: client.get_model_name(model_index)
492
493model_index - Model index
494
495Returns model name, or nil on failure.
496
497Back to TOC
498
499
500client.register_esp_flag
501syntax: client.register_esp_flag(flag, r, g, b, callback)
502
503flag - String of text that will be shown when callback returns true
504
505r - Red (1-255)
506
507g - Green (1-255)
508
509b - Blue (1-255)
510
511callback - Function that will be called for each entity while drawing the ESP
512
513Requires "Flags" is enabled in Player ESP
514
515Back to TOC
516
517
518config.load
519syntax: config.load(name, tab_name, container_name)
520
521name - Name of the config
522
523tab_name - Optional name of the tab
524
525container_name - Optional name of the container
526
527To load the specified config: config.load('Config name here') To load a tab from the specified config: config.load('Config name here', 'Tab name here') To load a container from the specified config: config.load('Config name here', 'Tab name here', 'Container name here')
528
529Back to TOC
530
531
532config.export
533syntax: config.export()
534
535Returns the current config as a string
536
537Back to TOC
538
539
540cvar.set_string
541syntax: cvar.set_string(value)
542
543value - String value
544
545Back to TOC
546
547
548cvar.get_string
549syntax: cvar.get_string()
550
551Returns nil on failure.
552
553Back to TOC
554
555
556cvar.set_float
557syntax: cvar.set_float(value)
558
559value - Float value
560
561cvar.cl_interp_ratio:set_float(1)
562
563Back to TOC
564
565
566cvar.set_raw_float
567syntax: cvar.set_raw_float(value)
568
569value - Float value
570
571This sets the float value without changing the integer and string values.
572
573Back to TOC
574
575
576cvar.get_float
577syntax: cvar.get_float()
578
579Returns nil if called on a ConCommand.
580
581Back to TOC
582
583
584cvar.set_int
585syntax: cvar.set_int(value)
586
587value - Integer value
588
589Back to TOC
590
591
592cvar.set_raw_int
593syntax: cvar.set_raw_int(value)
594
595value - Integer value
596
597This sets the integer value without changing the float and string values.
598
599Back to TOC
600
601
602cvar.get_int
603syntax: cvar.get_int()
604
605Returns nil if called on a ConCommand.
606
607Back to TOC
608
609
610cvar.invoke_callback
611syntax: cvar.invoke_callback()
612
613For ConCommands, optionally pass extra arguments and they will be forwarded to the callback. For ConVars, optionally pass an extra integer argument specifying the index of the change callback to invoke, otherwise all change callbacks will be invoked.
614
615cvar.snd_setmixer:invoke_callback("Ambient", "vol", "0") -- equivalent to typing "snd_setmixer Ambient vol 0" in console
616
617Back to TOC
618
619
620database.write
621syntax: database.write(key, value)
622
623key - Name of the database, must be a string
624
625value - Value or table
626
627Saves a persistent table, possibly overwriting any existing data
628
629Back to TOC
630
631
632database.read
633syntax: database.read(key)
634
635key - Unique string identifier
636
637Returns a table
638
639Back to TOC
640
641
642entity.get_local_player
643syntax: entity.get_local_player()
644
645Returns the entity index for the local player, or nil on failure.
646
647Back to TOC
648
649
650entity.get_all
651syntax: entity.get_all(classname)
652
653classname - Optional string that specifies the class name of entities that will be added to the list, for example "CCSPlayer".
654
655Returns an array of entity indices. Pass no arguments for all entities.
656
657Back to TOC
658
659
660entity.get_players
661syntax: entity.get_players(enemies_only)
662
663enemies_only - Optional. If true then you and the players on your team will not be added to the list.
664
665Returns an array of player entity indices. Dormant and dead players will not be added to the list.
666
667Back to TOC
668
669
670entity.get_game_rules
671syntax: entity.get_game_rules()
672
673Returns entity index of CCSGameRulesProxy instance, or nil if none exists.
674
675Back to TOC
676
677
678entity.get_player_resource
679syntax: entity.get_player_resource()
680
681Returns entity index of CCSPlayerResource instance, or nil if none exists.
682
683Back to TOC
684
685
686entity.get_classname
687syntax: entity.get_classname(ent)
688
689ent - Entity index.
690
691Returns the name of the entity's class, or nil on failure.
692
693Back to TOC
694
695
696entity.set_prop
697syntax: entity.set_prop(ent, propname, value, array_index)
698
699ent - Entity index.
700
701propname - Name of the networked property.
702
703value - The property will be set to this value. For vectors or angles, separate the components by commas.
704
705array_index - Optional. If propname is an array, the value at this array index will be set.
706
707Back to TOC
708
709
710entity.get_prop
711syntax: entity.get_prop(ent, propname, array_index)
712
713ent - Entity index.
714
715propname - Name of the networked property.
716
717array_index - Optional. If propname is an array, the value at this array index will be returned.
718
719Returns the value of the property, or nil on failure. For vectors or angles, this returns three values.
720
721Back to TOC
722
723
724entity.is_enemy
725syntax: entity.is_enemy(ent)
726
727ent - Entity index.
728
729Returns true if the entity is on the other team.
730
731Back to TOC
732
733
734entity.is_alive
735syntax: entity.is_alive(ent)
736
737ent - Entity index.
738
739Returns true if the player is not dead.
740
741Back to TOC
742
743
744entity.is_dormant
745syntax: entity.is_dormant(ent)
746
747ent - Entity index.
748
749Returns true if the player is not dormant.
750
751Back to TOC
752
753
754entity.get_player_name
755syntax: entity.get_player_name(ent)
756
757ent - Player entity index.
758
759Returns the player's name, or the string "unknown" on failure.
760
761Back to TOC
762
763
764entity.get_player_weapon
765syntax: entity.get_player_weapon(ent)
766
767ent - Player entity index.
768
769Returns the entity index of the player's active weapon, or nil if the player is not alive, dormant, etc.
770
771Back to TOC
772
773
774entity.hitbox_position
775syntax: entity.hitbox_position(player, hitbox)
776
777player - Entity index of the player.
778
779hitbox - Either a string of the hitbox name, or an integer index of the hitbox.
780
781Returns world coordinates x, y, z, or nil on failure.
782
783Back to TOC
784
785
786entity.get_steam64
787syntax: entity.get_steam64(player)
788
789player - Entity index of the player.
790
791Returns steamID3, or nil on failure.
792
793Back to TOC
794
795
796entity.get_bounding_box
797syntax: entity.get_bounding_box(player)
798
799player - Entity index of the player.
800
801Returns x1, y1, x2, y2, alpha_multiplier. The contents of x1, y1, x2, y2 must be ignored when alpha_multiplier is zero, which indicates that the bounding box is invalid and should not be drawn.
802
803Back to TOC
804
805
806entity.get_origin
807syntax: entity.get_origin(player)
808
809player - Entity index
810
811Returns x, y, z world coordinates of the entity's origin, or nil if the entity is dormant and dormant ESP information is not available.
812
813Back to TOC
814
815
816entity.get_esp_data
817syntax: entity.get_esp_data(player)
818
819player - Entity index
820
821Returns a table containing alpha, health, and weapon_id, or nil on failure.
822
823Back to TOC
824
825
826globals.realtime
827syntax: globals.realtime()
828
829Returns the local time in seconds.
830
831Back to TOC
832
833
834globals.curtime
835syntax: globals.curtime()
836
837Returns the game time in seconds. This number is synchronized with the server.
838
839Back to TOC
840
841
842globals.frametime
843syntax: globals.frametime()
844
845Returns the number of seconds elapsed during the last game frame.
846
847Back to TOC
848
849
850globals.absoluteframetime
851syntax: globals.absoluteframetime()
852
853Returns the number of seconds elapsed during the last game frame.
854
855Back to TOC
856
857
858globals.maxplayers
859syntax: globals.maxplayers()
860
861Returns the maximum number of players in the server.
862
863Back to TOC
864
865
866globals.tickcount
867syntax: globals.tickcount()
868
869Returns the number of ticks elapsed in the server.
870
871Back to TOC
872
873
874globals.tickinterval
875syntax: globals.tickinterval()
876
877Returns the time elapsed in one game tick in seconds.
878
879Back to TOC
880
881
882globals.framecount
883syntax: globals.framecount()
884
885Returns the number of frames since the game started
886
887Back to TOC
888
889
890globals.mapname
891syntax: globals.mapname()
892
893Returns the name of the loaded map, or nil if you are not in game.
894
895Back to TOC
896
897
898globals.lastoutgoingcommand
899syntax: globals.lastoutgoingcommand()
900
901Returns the command number of the last outgoing command.
902
903Back to TOC
904
905
906globals.oldcommandack
907syntax: globals.oldcommandack()
908
909Returns the command number of the previous server-acknowledged command.
910
911Back to TOC
912
913
914globals.commandack
915syntax: globals.commandack()
916
917Returns the command number of the most recent server-acknowledged command.
918
919Back to TOC
920
921
922globals.chokedcommands
923syntax: globals.chokedcommands()
924
925Returns the number of choked commands, i.e. the number of commands that haven't yet been sent to the server.
926
927Back to TOC
928
929
930panorama.open
931syntax: panorama.open(panel)
932
933panel - Optional panel name
934
935Back to TOC
936
937
938panorama.loadstring
939syntax: panorama.loadstring(js_code, panel)
940
941js_code - String containing JavaScript code
942
943panel - Optional panel name
944
945Back to TOC
946
947
948materialsystem.get_name
949syntax: materialsystem.get_name()
950
951Returns name of the material
952
953Back to TOC
954
955
956materialsystem.reload
957syntax: materialsystem.reload()
958
959Resets the material
960
961Back to TOC
962
963
964materialsystem.color_modulate
965syntax: materialsystem.color_modulate(r, g, b)
966
967r - Red (0-255)
968
969g - Green (0-255)
970
971b - Blue (0-255)
972
973Back to TOC
974
975
976materialsystem.alpha_modulate
977syntax: materialsystem.alpha_modulate(alpha)
978
979alpha - Opacity (0-255)
980
981Back to TOC
982
983
984materialsystem.set_shader_param
985syntax: materialsystem.set_shader_param(param_name, value, force)
986
987param_name - Name of the shader parameter
988
989value - New value
990
991force - Optional boolean. Add the var if it does not exist in the material
992
993Back to TOC
994
995
996materialsystem.get_shader_param
997syntax: materialsystem.get_shader_param(param_name)
998
999param_name - Name of the shader parameter
1000
1001Back to TOC
1002
1003
1004materialsystem.set_material_var_flag
1005syntax: materialsystem.set_material_var_flag(index, enabled)
1006
1007index - Index of MaterialVarFlags_t
1008
1009enabled - Boolean
1010
1011Back to TOC
1012
1013
1014materialsystem.get_material_var_flag
1015syntax: materialsystem.get_material_var_flag(index)
1016
1017index - Index of MaterialVarFlags_t
1018
1019Returns true if the specified flag is set
1020
1021Back to TOC
1022
1023
1024materialsystem.find_material
1025syntax: materialsystem.find_material(path, force_load)
1026
1027path - Path to material including filename
1028
1029force_load - Optional boolean. Load the material if it isn't loaded
1030
1031Returns a reference to the material
1032
1033Back to TOC
1034
1035
1036materialsystem.find_materials
1037syntax: materialsystem.find_materials(partial_path, force_load)
1038
1039partial_path - Partial path to material
1040
1041force_load - Optional boolean. Load each material if it isn't loaded
1042
1043Returns a table of references to materials that have partial_path in their name
1044
1045Back to TOC
1046
1047
1048materialsystem.find_texture
1049syntax: materialsystem.find_texture(path)
1050
1051path - Path to texture including filename
1052
1053Returns a reference to the texture that can be used with set_shader_param
1054
1055Back to TOC
1056
1057
1058materialsystem.get_model_materials
1059syntax: materialsystem.get_model_materials(entindex)
1060
1061entindex - Entity index
1062
1063Returns a table of references to materials used by the entity
1064
1065Back to TOC
1066
1067
1068materialsystem.arms_material
1069syntax: materialsystem.arms_material()
1070
1071Returns a reference to the arms material when 'Viewmodel arms' is enabled
1072
1073Back to TOC
1074
1075
1076materialsystem.chams_material
1077syntax: materialsystem.chams_material()
1078
1079Returns a reference to the player chams material
1080
1081Back to TOC
1082
1083
1084plist.set
1085syntax: plist.set(entindex, field, value)
1086
1087entindex - Player index
1088
1089field - Name of the field
1090
1091value - Value of the field
1092
1093Back to TOC
1094
1095
1096plist.get
1097syntax: plist.get(entindex, field)
1098
1099entindex - Player index
1100
1101field - Name of the field
1102
1103Back to TOC
1104
1105
1106renderer.text
1107syntax: renderer.text(x, y, r, g, b, a, flags, max_width, ...)
1108
1109x - Screen coordinate
1110
1111y - Screen coordinate
1112
1113r - Red (0-255)
1114
1115g - Green (0-255)
1116
1117b - Blue (0-255)
1118
1119a - Alpha (0-255)
1120
1121flags - "+" for large text, "-" for small text, "c" for centered text, "r" for right-aligned text, "b" for bold text, "d" for high DPI support. "c" can be combined with other flags. nil can be specified for normal sized uncentered text.
1122
1123max_width - Text will be clipped if it exceeds this width in pixels. Use 0 for no limit.
1124
1125... - Text that will be drawn
1126
1127This can only be called from the paint callback.
1128
1129Back to TOC
1130
1131
1132renderer.measure_text
1133syntax: renderer.measure_text(flags, ...)
1134
1135flags - "+" for large text, "-" for small text, or nil for normal sized text.
1136
1137... - Text that will be measured
1138
1139Returns width, height. This can only be called from the paint callback.
1140
1141Back to TOC
1142
1143
1144renderer.rectangle
1145syntax: renderer.rectangle(x, y, w, h, r, g, b, a)
1146
1147x - Screen coordinate
1148
1149y - Screen coordinate
1150
1151w - Width in pixels
1152
1153h - Height in pixels
1154
1155r - Red (0-255)
1156
1157g - Green (0-255)
1158
1159b - Blue (0-255)
1160
1161a - Alpha (0-255)
1162
1163This can only be called from the paint callback.
1164
1165Back to TOC
1166
1167
1168renderer.line
1169syntax: renderer.line(xa, ya, xb, yb, r, g, b, a)
1170
1171xa - Screen coordinate of point A
1172
1173ya - Screen coordinate of point A
1174
1175xb - Screen coordinate of point B
1176
1177yb - Screen coordinate of point B
1178
1179r - Red (0-255)
1180
1181g - Green (0-255)
1182
1183b - Blue (0-255)
1184
1185a - Alpha (0-255)
1186
1187This can only be called from the paint callback.
1188
1189Back to TOC
1190
1191
1192renderer.gradient
1193syntax: renderer.gradient(x, y, w, h, r1, g1, b1, a1, r2, g2, b2, a2, ltr)
1194
1195x - Screen coordinate
1196
1197y - Screen coordinate
1198
1199w - Width in pixels
1200
1201h - Height in pixels
1202
1203r1 - Red (0-255)
1204
1205g1 - Green (0-255)
1206
1207b1 - Blue (0-255)
1208
1209a1 - Alpha (0-255)
1210
1211r2 - Red (0-255)
1212
1213g2 - Green (0-255)
1214
1215b2 - Blue (0-255)
1216
1217a2 - Alpha (0-255)
1218
1219ltr - Left to right. Pass true for horizontal gradient, or false for vertical.
1220
1221This can only be called from the paint callback.
1222
1223Back to TOC
1224
1225
1226renderer.circle
1227syntax: renderer.circle(x, y, r, g, b, a, radius, start_degrees, percentage)
1228
1229x - Screen coordinate
1230
1231y - Screen coordinate
1232
1233r - Red (0-255)
1234
1235g - Green (0-255)
1236
1237b - Blue (0-255)
1238
1239a - Alpha (0-255)
1240
1241radius - Radius of the circle in pixels.
1242
1243start_degrees - 0 is the right side, 90 is the bottom, 180 is the left, 270 is the top.
1244
1245percentage - Must be within [0.0-1.0]. 1.0 is a full circle, 0.5 is a half circle, etc.
1246
1247This can only be called from the paint callback.
1248
1249Back to TOC
1250
1251
1252renderer.circle_outline
1253syntax: renderer.circle_outline(x, y, r, g, b, a, radius, start_degrees, percentage, thickness)
1254
1255x - Screen coordinate
1256
1257y - Screen coordinate
1258
1259r - Red (0-255)
1260
1261g - Green (0-255)
1262
1263b - Blue (0-255)
1264
1265a - Alpha (0-255)
1266
1267radius - Radius of the circle in pixels.
1268
1269start_degrees - 0 is the right side, 90 is the bottom, 180 is the left, 270 is the top.
1270
1271percentage - Must be within [0.0-1.0]. 1.0 is a full circle, 0.5 is a half circle, etc.
1272
1273thickness - Thickness of the outline in pixels.
1274
1275This can only be called from the paint callback.
1276
1277Back to TOC
1278
1279
1280renderer.triangle
1281syntax: renderer.triangle(x0, y0, x1, y1, x2, y2, r, g, b, a)
1282
1283x0 - Screen coordinate X for point A
1284
1285y0 - Screen coordinate Y for point A
1286
1287x1 - Screen coordinate X for point B
1288
1289y1 - Screen coordinate Y for point B
1290
1291x2 - Screen coordinate X for point C
1292
1293y2 - Screen coordinate Y for point C
1294
1295r - Red (0-255)
1296
1297g - Green (0-255)
1298
1299b - Blue (0-255)
1300
1301a - Alpha (0-255)
1302
1303This can only be called from the paint callback.
1304
1305Back to TOC
1306
1307
1308renderer.world_to_screen
1309syntax: renderer.world_to_screen(x, y, z)
1310
1311x - Position in world space
1312
1313y - Position in world space
1314
1315z - Position in world space
1316
1317Returns two screen coordinates (x, y), or nil if the world position is not visible on your screen. This can only be called from the paint callback.
1318
1319Back to TOC
1320
1321
1322renderer.indicator
1323syntax: renderer.indicator(r, g, b, a, ...)
1324
1325r - Red (0-255)
1326
1327g - Green (0-255)
1328
1329b - Blue (0-255)
1330
1331a - Alpha (0-255)
1332
1333... - The text that will be drawn
1334
1335Returns the Y screen coordinate (vertical offset) of the drawn text, or nil on failure. This can only be called from the paint callback.
1336
1337Back to TOC
1338
1339
1340renderer.texture
1341syntax: renderer.texture(id, x, y, w, h, r, g, b, a, mode)
1342
1343id - Texture ID
1344
1345x - X screen coordinate
1346
1347y - Y screen coordinate
1348
1349w - Width
1350
1351h - Height
1352
1353r - Red (0-255)
1354
1355g - Green (0-255)
1356
1357b - Blue (0-255)
1358
1359a - Alpha (1-255)
1360
1361mode - Optional string: "f" for fill, "r" for repeat, otherwise automatic
1362
1363In fill mode, the texture will be stretched to the specified size. This may cause textures to appear blurry if the specified size is not the same as the texture's size. In repeat mode, the texture will be tiled.
1364
1365Back to TOC
1366
1367
1368renderer.load_svg
1369syntax: renderer.load_svg(contents, width, height)
1370
1371contents - SVG file contents
1372
1373width - Width
1374
1375height - Height
1376
1377Returns a texture ID that can be used with renderer.texture, or nil on failure
1378
1379Back to TOC
1380
1381
1382renderer.load_png
1383syntax: renderer.load_png(contents, width, height)
1384
1385contents - PNG file contents
1386
1387width - Width
1388
1389height - Height
1390
1391Returns a texture ID that can be used with renderer.texture, or nil on failure
1392
1393Back to TOC
1394
1395
1396renderer.load_jpg
1397syntax: renderer.load_jpg(contents, width, height)
1398
1399contents - JPG file contents
1400
1401width - Width
1402
1403height - Height
1404
1405Returns a texture ID that can be used with renderer.texture, or nil on failure
1406
1407Back to TOC
1408
1409
1410renderer.load_rgba
1411syntax: renderer.load_rgba(contents, width, height)
1412
1413contents - RGBA buffer
1414
1415width - Width
1416
1417height - Height
1418
1419Returns a texture ID that can be used with renderer.texture, or nil on failure
1420
1421Back to TOC
1422
1423
1424ui.new_checkbox
1425syntax: ui.new_checkbox(tab, container, name)
1426
1427tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1428
1429container - The name of the existing container to which this control will be added.
1430
1431name - The name of the checkbox.
1432
1433Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.
1434
1435Back to TOC
1436
1437
1438ui.new_slider
1439syntax: ui.new_slider(tab, container, name, min, max, init_value, show_tooltip, unit, scale, tooltips)
1440
1441tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1442
1443container - The name of the existing container to which this control will be added.
1444
1445name - The name of the slider.
1446
1447min - The minimum value that can be set using the slider.
1448
1449max - The maximum value that can be set using the slider.
1450
1451init_value - Optional integer. The initial value. If not provided, the initial value will be min.
1452
1453show_tooltip - Optional boolean. true if the slider should display its current value.
1454
1455unit - Optional string that is two characters or less. This will be appended to the display value. For example, "px" for pixels or "%" for a percentage.
1456
1457scale - Optional The display value will be multiplied by this scale. For example, 0.1 will make a slider with the range [0-1800] show as 0.0-180.0 with one decimal place.
1458
1459tooltips - Optional table used to override the tooltip for the specified values. The key must be within min-max. The value is a string that will be shown instead of the numeric value whenever that value is selected.
1460
1461Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.
1462
1463Back to TOC
1464
1465
1466ui.new_combobox
1467syntax: ui.new_combobox(tab, container, name, ...)
1468
1469tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1470
1471container - The name of the existing container to which this control will be added.
1472
1473name - The name of the combobox.
1474
1475... - One or more comma separated string values that will be added to the combobox. Alternatively, a table of strings that will be added.
1476
1477Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.
1478
1479Back to TOC
1480
1481
1482ui.new_multiselect
1483syntax: ui.new_multiselect(tab, container, name, ...)
1484
1485tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1486
1487container - The name of the existing container to which this control will be added.
1488
1489name - The name of the multiselect.
1490
1491... - One or more comma separated string values that will be added to the combobox. Alternatively, a table of strings that will be added.
1492
1493Returns a special value that can be passed to ui.get and ui.set, or throws an error on failure.
1494
1495Back to TOC
1496
1497
1498ui.new_hotkey
1499syntax: ui.new_hotkey(tab, container, name, inline, default_hotkey)
1500
1501tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1502
1503container - The name of the existing container to which this control will be added.
1504
1505name - The name of the hotkey.
1506
1507inline - Optional boolean. If set to true, the hotkey will be placed to the right of the preceding menu item.
1508
1509default_hotkey - Optional virtual key
1510
1511Returns a special value that can be passed to ui.get to see if the hotkey is pressed, or throws an error on failure.
1512
1513Back to TOC
1514
1515
1516ui.new_button
1517syntax: ui.new_button(tab, container, name, callback)
1518
1519tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1520
1521container - The name of the existing container to which this checkbox will be added.
1522
1523name - The name of the button.
1524
1525callback - The lua function that will be called when the button is pressed.
1526
1527Throws an error on failure. The return value should not be used with ui.set or ui.get.
1528
1529Back to TOC
1530
1531
1532ui.new_color_picker
1533syntax: ui.new_color_picker(tab, container, name, r, g, b, a)
1534
1535tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1536
1537container - The name of the existing container to which this checkbox will be added.
1538
1539name - The name of the color picker. This will not be shown, it is only used to identify this item in saved configs.
1540
1541r - Optional initial red value (0-255)
1542
1543g - Optional initial green value (0-255)
1544
1545b - Optional initial blue value (0-255)
1546
1547a - Optional initial alpha value (0-255)
1548
1549Throws an error on failure. The color picker is placed to the right of the previous menu item.
1550
1551Back to TOC
1552
1553
1554ui.new_textbox
1555syntax: ui.new_textbox(tab, container, name)
1556
1557tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1558
1559container - The name of the existing container to which this textbox will be added.
1560
1561name - The name of the textbox
1562
1563Throws an error on failure. Returns a special value that can be used with ui.get
1564
1565Back to TOC
1566
1567
1568ui.new_listbox
1569syntax: ui.new_listbox(tab, container, name, items)
1570
1571tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA
1572
1573container - The name of the existing container to which this listbox will be added
1574
1575name - Name
1576
1577items - Optional table of items (strings)
1578
1579Throws an error on failure. Returns a special value that can be used with ui.get. Calling ui.get on a listbox will return the zero-based index of the currently selected string.
1580
1581Back to TOC
1582
1583
1584ui.new_string
1585syntax: ui.new_string(name, value)
1586
1587name - Name
1588
1589value - Optional string that specifies the default value.
1590
1591Returns a special value that can be used with ui.get and ui.set. This function does not create any menu items. The value will be stored in configs just like other menu items.
1592
1593Back to TOC
1594
1595
1596ui.new_label
1597syntax: ui.new_label(tab, container, name)
1598
1599tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA
1600
1601container - The name of the existing container to which this listbox will be added
1602
1603name - Name
1604
1605Returns a special value that can be used with ui.set
1606
1607Back to TOC
1608
1609
1610ui.reference
1611syntax: ui.reference(tab, container, name)
1612
1613tab - The name of the tab: RAGE, AA, LEGIT, VISUALS, MISC, SKINS, PLAYERS, LUA.
1614
1615container - The name of the existing container to which this checkbox will be added.
1616
1617name - The name of the menu item.
1618
1619Avoid calling this from inside a function. Returns a reference that can be passed to ui.get and ui.set, or throws an error on failure. This allows you to access a built-in pre-existing menu items. This function returns multiple values when the specified menu item is followed by unnamed menu items, for example a color picker or a hotkey.
1620
1621Back to TOC
1622
1623
1624ui.set
1625syntax: ui.set(item, value, ...)
1626
1627item - The result of either ui.new_* or ui.reference
1628
1629value - The value to which the menu item will be set
1630
1631... - Optional. For multiselect comboboxes, you may want to set more than one option.
1632
1633For checkboxes, pass true or false. For a slider, pass a number that is within the slider's minimum/maximum values. For a combobox, pass a string value. For a multiselect combobox, pass zero or more strings. For referenced buttons, value is ignored and the button's callback is invoked. For color pickers, pass the arguments r, g, b, a.
1634
1635Back to TOC
1636
1637
1638ui.get
1639syntax: ui.get(item)
1640
1641item - The special value returned by ui.new_checkbox, ui.new_slider, ui.new_combobox, ui.new_hotkey, or ui.reference.
1642
1643For a checkbox, returns true or false. For a slider, returns an integer. For a combobox, returns a string. For a multiselect combobox, returns an array of strings. For a hotkey, returns true if the hotkey is active. For a color picker, returns r, g, b, a. Throws an error on failure.
1644
1645Back to TOC
1646
1647
1648ui.set_callback
1649syntax: ui.set_callback(item, callback)
1650
1651item - The special value returned by ui.new_*. Do not try passing a reference to an existing menu item.
1652
1653callback - Lua function that will be called when the menu item changes values. For example, this will be called when the user checks or unchecks a checkbox.
1654
1655item is passed as an argument to the callback function.
1656
1657Back to TOC
1658
1659
1660ui.set_visible
1661syntax: ui.set_visible(item, visible)
1662
1663item - A menu item reference.
1664
1665visible - Boolean. Pass false to hide the control from the menu.
1666
1667Back to TOC
1668
1669
1670ui.is_menu_open
1671syntax: ui.is_menu_open()
1672
1673Returns true if the menu is currently open.
1674
1675Back to TOC
1676
1677
1678ui.mouse_position
1679syntax: ui.mouse_position()
1680
1681Returns current mouse coordinates x, y
1682
1683Back to TOC
1684
1685
1686ui.menu_position
1687syntax: ui.menu_position()
1688
1689Returns current window coordinates x, y
1690
1691Back to TOC
1692
1693
1694ui.menu_size
1695syntax: ui.menu_size()
1696
1697Returns current menu size width, height
1698
1699Back to TOC
1700
1701
1702ui.name
1703syntax: ui.name(item)
1704
1705item - Reference to menu item
1706
1707Returns the display name