Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local tSides = rs.getSides() -- this gest a list of the sides front back left right top bottom and and puts it in a table
- local tSorted = {} -- this will store a list to compair against latter
- for i = 1,#tSides do -- this will loop ounce for eatch of items in tSides this should be 6
- tSorted[tSides[i]] = "" -- use the strings from from tSdies as elemsnts in the table.
- end
- local function pulse(sSide,sColour,nRepeat) -- decalre pulse function
- for i = 1,nRepeat do -- start loop it will run for the number stored in nRepeat
- sleep(0.3) -- pause bstween redstone change
- rs.setBundledOutput(sSide,colors[sColour]) -- turn on the color
- sleep(0.3) -- pause bstween redstone change
- rs.setBundledOutput(sSide,0) -- turn off the color
- end
- end
- if #tArgs == 3 then -- check for three input values from user
- if tSorted[tArgs[1]] then -- test if the string given by the user is a elemsnt in this table. it will be true if et exists
- if colors[tArgs[2]] then -- test if it is realy a color
- local nLoop = tonumber(tArgs[3]) -- change the string to number if it cant it will be nill
- if nLoop then
- print("pulsing "..tArgs[1].." side "..tArgs[2].." "..tostring(nLoop).." times.")
- pulse(tArgs[1],tArgs[2],nLoop)
- else
- print("not a number")
- print("usage pulse <side> <color> <loops> ")
- end
- else -- if not color then tell then
- print("not a color")
- print("usage pulse <side> <color> <loops> ")
- end
- else -- if the user given srring is not one of the sides top bottom left right front back tell them
- print("not a side")
- print("usage pulse <side> <color> <loops> ") -- tell the user how to use program
- end
- else -- if not three input values then
- print("usage pulse <side> <color> <loops> ") -- tell the user how to use program
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement