Improved reactor adjustment steps
Improved exit for CC scripts
This commit is contained in:
parent
e9d2fb1492
commit
f6087f5320
4 changed files with 14 additions and 12 deletions
|
@ -486,22 +486,22 @@ function reactor_key(keycode)
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 34 then -- G
|
elseif keycode == 34 then -- G
|
||||||
data.reactor_rate = data.reactor_rate / 10
|
data.reactor_rate = data.reactor_rate - 1000
|
||||||
reactor_setMode()
|
reactor_setMode()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 20 then -- T
|
elseif keycode == 20 then -- T
|
||||||
data.reactor_rate = data.reactor_rate * 10
|
data.reactor_rate = data.reactor_rate + 1000
|
||||||
reactor_setMode()
|
reactor_setMode()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 36 then -- J
|
elseif keycode == 36 then -- J
|
||||||
data.reactor_laserAmount = data.reactor_laserAmount / 10
|
data.reactor_laserAmount = data.reactor_laserAmount - 500
|
||||||
reactor_setLaser()
|
reactor_setLaser()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 22 then -- U
|
elseif keycode == 22 then -- U
|
||||||
data.reactor_laserAmount = data.reactor_laserAmount * 10
|
data.reactor_laserAmount = data.reactor_laserAmount + 500
|
||||||
reactor_setLaser()
|
reactor_setLaser()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -1205,22 +1205,22 @@ function reactor_key(keycode)
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 34 then -- G
|
elseif keycode == 34 then -- G
|
||||||
data.reactor_rate = data.reactor_rate / 10
|
data.reactor_rate = data.reactor_rate - 1000
|
||||||
reactor_setMode()
|
reactor_setMode()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 20 then -- T
|
elseif keycode == 20 then -- T
|
||||||
data.reactor_rate = data.reactor_rate * 10
|
data.reactor_rate = data.reactor_rate + 1000
|
||||||
reactor_setMode()
|
reactor_setMode()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 36 then -- J
|
elseif keycode == 36 then -- J
|
||||||
data.reactor_laserAmount = data.reactor_laserAmount / 10
|
data.reactor_laserAmount = data.reactor_laserAmount - 500
|
||||||
reactor_setLaser()
|
reactor_setLaser()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif keycode == 22 then -- U
|
elseif keycode == 22 then -- U
|
||||||
data.reactor_laserAmount = data.reactor_laserAmount * 10
|
data.reactor_laserAmount = data.reactor_laserAmount + 500
|
||||||
reactor_setLaser()
|
reactor_setLaser()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
|
@ -2069,6 +2069,7 @@ repeat
|
||||||
if eventName == "key" then
|
if eventName == "key" then
|
||||||
keycode = params[2]
|
keycode = params[2]
|
||||||
if char == 88 or char == 120 or keycode == 45 then -- x for eXit
|
if char == 88 or char == 120 or keycode == 45 then -- x for eXit
|
||||||
|
os.pullEventRaw()
|
||||||
abort = true
|
abort = true
|
||||||
elseif char == 48 or keycode == 11 or keycode == 82 then -- 0
|
elseif char == 48 or keycode == 11 or keycode == 82 then -- 0
|
||||||
page = connections_page
|
page = connections_page
|
||||||
|
|
|
@ -950,6 +950,7 @@ repeat
|
||||||
if eventName == "key" then
|
if eventName == "key" then
|
||||||
keycode = params[2]
|
keycode = params[2]
|
||||||
if char == 88 or char == 120 or keycode == 45 then -- x for eXit
|
if char == 88 or char == 120 or keycode == 45 then -- x for eXit
|
||||||
|
os.pullEventRaw()
|
||||||
abort = true
|
abort = true
|
||||||
elseif char == 48 or keycode == 11 or keycode == 82 then -- 0
|
elseif char == 48 or keycode == 11 or keycode == 82 then -- 0
|
||||||
page = connections_page
|
page = connections_page
|
||||||
|
|
|
@ -442,22 +442,22 @@ function reactor_key(char, keycode)
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif char == 71 or char == 103 then -- G
|
elseif char == 71 or char == 103 then -- G
|
||||||
data.reactor_rate = data.reactor_rate / 10
|
data.reactor_rate = data.reactor_rate - 1000
|
||||||
reactor_setMode()
|
reactor_setMode()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif char == 84 or char == 116 then -- T
|
elseif char == 84 or char == 116 then -- T
|
||||||
data.reactor_rate = data.reactor_rate * 10
|
data.reactor_rate = data.reactor_rate + 1000
|
||||||
reactor_setMode()
|
reactor_setMode()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif char == 74 or char == 106 then -- J
|
elseif char == 74 or char == 106 then -- J
|
||||||
data.reactor_laserAmount = data.reactor_laserAmount / 10
|
data.reactor_laserAmount = data.reactor_laserAmount - 500
|
||||||
reactor_setLaser()
|
reactor_setLaser()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
elseif char == 85 or char == 117 then -- U
|
elseif char == 85 or char == 117 then -- U
|
||||||
data.reactor_laserAmount = data.reactor_laserAmount * 10
|
data.reactor_laserAmount = data.reactor_laserAmount + 500
|
||||||
reactor_setLaser()
|
reactor_setLaser()
|
||||||
data_save()
|
data_save()
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Add table
Reference in a new issue