mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-04 21:03:58 +00:00
Assorted fixes to rednet, textutils, gps, chat.
As reported by @SquidDev.
This commit is contained in:
parent
06b2f3511f
commit
7e08662b95
@ -233,7 +233,7 @@ function run()
|
|||||||
if type( tMessage ) == "table" and tMessage.nMessageID then
|
if type( tMessage ) == "table" and tMessage.nMessageID then
|
||||||
if not tReceivedMessages[ tMessage.nMessageID ] then
|
if not tReceivedMessages[ tMessage.nMessageID ] then
|
||||||
tReceivedMessages[ tMessage.nMessageID ] = true
|
tReceivedMessages[ tMessage.nMessageID ] = true
|
||||||
tReceivedMessageTimeouts[ os.startTimer( 30 ) ] = nMessageID
|
tReceivedMessageTimeouts[ os.startTimer( 30 ) ] = tMessage.nMessageID
|
||||||
os.queueEvent( "rednet_message", nReplyChannel, tMessage.message, tMessage.sProtocol )
|
os.queueEvent( "rednet_message", nReplyChannel, tMessage.message, tMessage.sProtocol )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,7 @@ function slowWrite( sText, nRate )
|
|||||||
local nSleep = 1 / nRate
|
local nSleep = 1 / nRate
|
||||||
|
|
||||||
sText = tostring( sText )
|
sText = tostring( sText )
|
||||||
local x,y = term.getCursorPos(x,y)
|
local x,y = term.getCursorPos()
|
||||||
local len = string.len( sText )
|
local len = string.len( sText )
|
||||||
|
|
||||||
for n=1,len do
|
for n=1,len do
|
||||||
|
@ -57,10 +57,6 @@ elseif sCommand == "host" then
|
|||||||
x,y,z = gps.locate( 2, true )
|
x,y,z = gps.locate( 2, true )
|
||||||
if x == nil then
|
if x == nil then
|
||||||
print( "Run \"gps host <x> <y> <z>\" to set position manually" )
|
print( "Run \"gps host <x> <y> <z>\" to set position manually" )
|
||||||
if bCloseChannel then
|
|
||||||
print( "Closing GPS channel" )
|
|
||||||
modem.close( gps.CHANNEL_GPS )
|
|
||||||
end
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -310,14 +310,14 @@ elseif sCommand == "join" then
|
|||||||
function printMessage( sMessage )
|
function printMessage( sMessage )
|
||||||
term.redirect( historyWindow )
|
term.redirect( historyWindow )
|
||||||
print()
|
print()
|
||||||
if string.match( sMessage, "^\*" ) then
|
if string.match( sMessage, "^%*" ) then
|
||||||
-- Information
|
-- Information
|
||||||
term.setTextColour( highlightColour )
|
term.setTextColour( highlightColour )
|
||||||
write( sMessage )
|
write( sMessage )
|
||||||
term.setTextColour( textColour )
|
term.setTextColour( textColour )
|
||||||
else
|
else
|
||||||
-- Chat
|
-- Chat
|
||||||
local sUsernameBit = string.match( sMessage, "^\<[^\>]*\>" )
|
local sUsernameBit = string.match( sMessage, "^<[^>]*>" )
|
||||||
if sUsernameBit then
|
if sUsernameBit then
|
||||||
term.setTextColour( highlightColour )
|
term.setTextColour( highlightColour )
|
||||||
write( sUsernameBit )
|
write( sUsernameBit )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user