summaryrefslogtreecommitdiff
path: root/scripts/devhook.lua
blob: db8131aad68811b10b5482965a0395a61ed07f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- SLIMax Mgr Lua Script v3.1
-- Copyright (c)2012-2013 by Zappadoc - All Rights Reserved.


-- param = device type (integer - see GetDeviceType() )
-- return 1 to send processed data to the device and bypass Mgr
-- return 0 to skip and give the control to Mgr
function deviceReport(deviceType)
	-- call custom script
	local result = custom_deviceReport(deviceType)
	-- if result = 0 bypass the script below and return 0
	-- if result = 1 bypass the script below and return 1
	if result <= 1 then return result end
	-- if result >= 2 continue

	-- call global custom script
	result = global_custom_deviceReport(deviceType)
	-- if result = 0 bypass the script below and return 0
	-- if result = 1 bypass the script below and return 1
	if result <= 1 then return result end
	-- if result >= 2 continue

	-- sim paused?
	local paused = GetContextInfo("paused")
	-- limiter ON?
	local spdLmt = GetCarInfo("speedlimiter")
	if paused or spdLmt == 0 then
	-- reset value
	SetDigitsAllowed(true)
	SetFanatecDigitsAllowed(true)
	end


	-- skip and give the control to Mgr
	return 0

end