SHOW:
|
|
- or go back to the newest paste.
1 | General Lua functions | |
2 | ||
3 | rgba(R, G, B, A) -- Returns a color with alpha channel | |
4 | rgb(R, G, B) -- Returns a color | |
5 | lerpColor(Color1, Color2, Alpha) -- Returns a linear interpolated color between Color1 and Color2 | |
6 | ||
7 | print(Text) -- Prints text to the console | |
8 | console(Text) -- Prints text to the console | |
9 | consoleRGB(Text, Color) -- Prints colored text to the console | |
10 | notify(Title, Text) -- Displays a notification | |
11 | ||
12 | modifySound(soundName, Pitch, Volume) -- Changes the pitch and volume of a sound | |
13 | modifySoundRe(regEx, Pitch, Volume) -- Changes the pitch and volume of all sounds matching regEx | |
14 | searchSound(regEx) -- Finds and displays the names of sounds matching regEx | |
15 | searchSoundRe(regEx) -- Finds and displays the names of sounds matching regEx | |
16 | ||
17 | bindKey(keyName, Event, Function) -- Binds a key to a Lua function | |
18 | unbindKey(keyName, Event) -- Unbinds a key | |
19 | searchTribesInputCommands(regEx) -- Finds and displays the Tribes keybinds matching regEx | |
20 | ||
21 | reloadSounds() -- Reloads all custom sound files | |
22 | ||
23 | stopwatch.toggle() -- Toggles the stopwatch on and off | |
24 | stopwatch.start() -- Starts or restarts the stopwatch | |
25 | stopwatch.stop() -- Stops the stopwatch | |
26 | stopwatch.isRunning() -- Returns 1 if the stopwatch is running, 0 otherwise | |
27 | stopwatch.time() -- Returns the stopwatch time as floating point number | |
28 | stopwatch.timeStr() -- Returns the stopwatch time as string in a typical stopwatch format | |
29 | ||
30 | state.save() -- Saves your current location, speed, health to slot number 1 | |
31 | state.saveTo(slotNumber) -- Saves your current location, speed, health to a certain slotNumber | |
32 | state.recall() -- Recalls location, speed, health of slot number 1 | |
33 | state.recallTo(slotNumber) -- Recalls location, speed, health of a certain slotNumber | |
34 | state.tp() -- Teleports you to the saved location of slot number 1 | |
35 | state.tpTo(slotNumber) -- Teleports you to the saved location of a certain slotNumber | |
36 | state.reset() -- Resets all saved slots | |
37 | state.setToSpawns() -- Sets the saved slots to the spawn locations of your team | |
38 | ||
39 | route.rec() -- Starts or stops route recording | |
40 | route.record() -- Starts or stops route recording | |
41 | route.recStart() -- Starts or restarts route recording | |
42 | route.recStop() -- Stops route recording | |
43 | route.replay() -- Starts or stops replaying of a recorded route | |
44 | route.replayStart(startTime) -- Starts or restarts replaying of a recorded route beginning from startTime | |
45 | route.replayStop() -- Stops replaying of a recorded route | |
46 | route.reset() -- Resets the currently recorded route | |
47 | route.save(Description) -- Saves the currently recorded route with Description | |
48 | route.load(routeNumber) -- Loads route recording routeNumber | |
49 | route.search(regEx) -- Displays route names matching regEx | |
50 | route.find(regEx) -- Displays route names matching regEx | |
51 | route.list() -- Loads and displays a list of all routes for the current map | |
52 | route.getAll() -- Loads all routes for the current map | |
53 | route.getEnemy() -- Loads all routes of the opposing team for the current map | |
54 | route.enableBot(Enable) -- Toggles or turns the route bot on or off | |
55 | ||
56 | toggleTurrets() -- Toggles base turrents on and off | |
57 | togglePower() -- Toggles the generator power on and off | |
58 | returnFlags() -- Returns all loose flags | |
59 | ||
60 | config.reloadVariables() -- Reloads all Lua config variables without reloading the whole configs | |
61 | config.reload() -- Reloads the Lua configs | |
62 | ||
63 | Canvas drawing functions | |
64 | ||
65 | drawText(Text, Color, X, Y, Alignment, Scaling) -- Draws text using the damage number font | |
66 | drawSmallText(Text, Color, X, Y, Alignment, shadowDistance, Scaling) -- Draws text using the small console font | |
67 | drawUTText(Text, Color, X, Y, Alignment, shadowDistance, Size) -- Draws text using the default UT HUD font | |
68 | getTextSize(Text, Scaling) -- Returns the text size of Text using the damage number font | |
69 | getSmallTextSize(Text, Scaling) -- Returns the text size of Text using the small console font | |
70 | getUTTextSize(Text, Size) -- Returns the text size of Text using the default UT HUD font | |
71 | drawRect(X1, Y1, X2, Y2, Color) -- Draws a rectangle | |
72 | drawBox(X1, Y1, X2, Y2, Color) -- Draws a box | |
73 | drawProgressBar(X1, Y1, X2, Y2, Color, Direction, fillPercentage) -- Draws a progress bar (Directions are: 0-Up 1-Right 2-Down 3-Left) | |
74 | draw2dLine(X1, Y1, X2, Y2, Color) -- Draws a 1 pixel 2D line (Alpha channel in color does not work with this) | |
75 | ||
76 | LuaRef functions (they get called by the game if they are declared in your code) | |
77 | ||
78 | onDamageNumberCreate(overheadNumbersArray, number, location, isShielDamage) -- Gets called whenever a damage number is created | |
79 | onDamageNumberUpdate(overheadNumbersArray, TrHUD, DeltaTime) -- Gets called whenever a damage number is updated | |
80 | onDrawCustomHud(canvasSizeX, canvasSizeY) -- Gets called every frame | |
81 | - | onAddToCombatLog(CombatType, AggressorName, WeaponIconId, VictimName) -- Gets called whenever a new message for the kill feed is created |
81 | + | onAddToCombatLog(AggressorTeam, AggressorName, WeaponIconId, VictimName, VictimTeam) -- Gets called whenever a new message for the kill feed is created |
82 | onChatMessage(SenderTeamId, Channel, SenderName, Message) -- Gets called whenever a new chat message arrives | |
83 | onGameMessage(Message, DisplayDuration) -- Gets called whenever a new game message is created | |
84 | onKillMessage(Text, VictimName) -- Gets called whenever we kill somebody | |
85 | onDrawHealthBar(LocationX, LocationY, isFriend, HealthPct) -- Gets called every frame to draw the IFF health bars | |
86 | onQueueAccolade(IconID, Title, Subtitle, IsBadge) Refer to http://pastebin.com/ACauRiwL for IconIDs | |
87 | ||
88 | Data getters | |
89 | ||
90 | viewPort.size() | |
91 | viewPort.isMainMenuOpen() | |
92 | viewPort.isScoreboardOpen() | |
93 | ||
94 | player.name() | |
95 | player.isAlive() | |
96 | player.isFirstPerson() | |
97 | player.isRaged() | |
98 | player.isVehicle() | |
99 | player.isShielded() | |
100 | player.hasFlag() | |
101 | player.energy() | |
102 | player.energyMax() | |
103 | player.energyPct() | |
104 | player.ping() | |
105 | player.classId() | |
106 | player.health() | |
107 | player.healthMax() | |
108 | player.speed() | |
109 | player.respawnTime() | |
110 | player.numDeployables() | |
111 | player.numMines() | |
112 | player.score() | |
113 | player.rabbitRank() | |
114 | player.teamNum() | |
115 | player.kills() | |
116 | player.deaths() | |
117 | player.assists() | |
118 | player.arenaSpawnsLeft() | |
119 | ||
120 | weapon.isReadyToFire(equipPointNumber) | |
121 | weapon.isReloading(equipPointNumber) | |
122 | weapon.isPack(equipPointNumber) | |
123 | weapon.isPassiveReady(equipPointNumber) | |
124 | weapon.isLowAmmo(equipPointNumber) | |
125 | weapon.ammo(equipPointNumber) | |
126 | weapon.ammoMax(equipPointNumber) | |
127 | weapon.ammoCarried(equipPointNumber) | |
128 | weapon.ammoMaxCarried(equipPointNumber) | |
129 | weapon.ammoTotal(equipPointNumber) | |
130 | weapon.name(equipPointNumber) | |
131 | ||
132 | currentWeapon.isReadyToFire() | |
133 | currentWeapon.isReloading() | |
134 | currentWeapon.isReloaded() | |
135 | currentWeapon.isPack() | |
136 | currentWeapon.isLowAmmo() | |
137 | currentWeapon.ammo() | |
138 | currentWeapon.ammoMax() | |
139 | currentWeapon.ammoCarried() | |
140 | currentWeapon.ammoMaxCarried() | |
141 | currentWeapon.ammoTotal() | |
142 | currentWeapon.reticuleIndex() | |
143 | currentWeapon.equippedAt() | |
144 | currentWeapon.name() | |
145 | ||
146 | vehicle.health() | |
147 | vehicle.healthMax() | |
148 | vehicle.energyPct() | |
149 | vehicle.ammo() | |
150 | vehicle.ammoMax() | |
151 | vehicle.speed() | |
152 | ||
153 | game.type() | |
154 | game.timeStr() | |
155 | game.spectators() | |
156 | game.isOfflinePlay() | |
157 | game.isOver() | |
158 | game.isGenUp(teamNumber) | |
159 | game.isWarmUp() | |
160 | game.genAutoRepairTime(teamNumber) | |
161 | game.overTimeLimit() | |
162 | game.score(teamNumber) | |
163 | game.scoreLimit() | |
164 | game.time() | |
165 | game.timeLimit() | |
166 | game.timeSeconds() | |
167 | game.realTimeSeconds() | |
168 | ||
169 | rabbit.leaderBoardScore(leaderBoardIndex) | |
170 | rabbit.leaderBoardName(leaderBoardIndex) | |
171 | rabbit.rabbitName() | |
172 | ||
173 | cah.pointsNum() | |
174 | cah.pointsHeld(teamNumber) | |
175 | cah.pointHolder(pointNumber) | |
176 | cah.pointLabel(pointNumber) | |
177 | ||
178 | arena.round() | |
179 | arena.roundScore(teamNumber) | |
180 | arena.playerStatus(teamNumber, playerNumber) | |
181 | ||
182 | flag.isHome(teamNumber) | |
183 | flag.returnTime(teamNumber) | |
184 | flag.holderName(teamNumber) |