Posted 23 January 2013 - 05:12 PM
I hate to post another topic but I get crap for asking unrelated questions in topics I've started.
As you can see in the photo, when the sleep commands are removed it prints the chats backwards and ignores the first one.
With them in place it only printed the first one, twice.
I'm noticing a trend of chats being doubled but commands work ok except they all seem to activate on setCommand without the runCommand.
As you can see in the photo, when the sleep commands are removed it prints the chats backwards and ignores the first one.
With them in place it only printed the first one, twice.
I'm noticing a trend of chats being doubled but commands work ok except they all seem to activate on setCommand without the runCommand.
Spoiler
local cmd = peripheral.wrap("right")
local function run()
cmd.runCommand()
end
local function clear()
term.clear()
term.setCursorPos(1,1)
end
clear()
print("The command block functions timer for Prot3ch")
-- Do the important stuff first!
cmd.setCommand("/gamerule doFireTick false")
run()
-- Lottery Timer
-- 10 minutes after every server restart 'give at random'
local Lottery = os.startTimer(600)
-- The IRC Chat
-- Displays every 20 minutes
local IRC = os.startTimer(30)
-- Reminder of the Forum Link
while true do
local event, p1 = os.pullEvent() -- wait for pull event, assign "timer, title"
if event == "timer" and p1 == Lottery then -- check which timer
cmd.setCommand("/give @p 46 1") -- lottery
-- firstTimer = os.startTimer( 10 ) -- timer reset (not used for lottery)
elseif event == "timer" and p1 == IRC then -- check which timer
cmd.setCommand("/say Thanks for playing on Prot3ch! We hope you have a great time!")
sleep (0.1)
cmd.setCommand("/say Ask questions at the IRC http://tinyurl.com/awfrqar")
sleep (0.1)
cmd.setCommand("/say Post about your builds at http://profserve.enjin.com")
sleep (0.1)
cmd.setCommand("/say Check the latest server news at profserve.blogspot.co.uk")
sleep (0.1)
-- cmd.setCommand("/say Report problems with griefing/theft/glitches at /warp Report")
secondTimer = os.startTimer(1200)
-- elseif event
end
end
-- TEST ZONE -----------------------------------------------
--cmd.setCommand("/w @p Success!")
--cmd.setCommand("/give @p 1 1")