This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
cpcp800's profile picture

[Question][lua] Stop alongtimeago mid-play

Started by cpcp800, 20 December 2012 - 09:05 PM
cpcp800 #1
Posted 20 December 2012 - 10:05 PM
so i was writing a code that will play a movie when redstone is recieved and clear a monitor next time it recieves a redstone update
looking a bit like this:

local on = 0
while true do
event = os.pullEvent("redstone")
if on==0
on = 1
shell.run("monitor", "top", "secret/alongtimeago")
end
if on==1
on = 0
shell.run("monitor", "top", "clear")
end
end
the thing is i have to terminate the movie before the script moves on to clear it.
the problem is i dont know how to turn the movie off while its playing
i was hoping one of you could provide some help.
theoriginalbit #2
Posted 20 December 2012 - 10:34 PM
is this the only functionality the program will have? or will you have it do more after it has stopped the movie?
Sammich Lord #3
Posted 20 December 2012 - 10:34 PM
You will have to modify the source of the movie itself.
theoriginalbit #4
Posted 20 December 2012 - 10:43 PM
You will have to modify the source of the movie itself.
Not true. there was a post on here not that long ago that i think Orwell answered with a solution, however the solution means that after stopping the movie the program can't want to do anything else.
BigSHinyToys #5
Posted 20 December 2012 - 10:46 PM
You will have to modify the source of the movie itself.
No you don't
put this on the computer that is connected to the monitor
http://pastebin.com/V6DVJn8Y

and put this on a computer you want to control it from handles multiple different players at ounce.
http://pastebin.com/b1Y0u5zW

requires a advanced computer (gold)
theoriginalbit #6
Posted 20 December 2012 - 10:47 PM
You will have to modify the source of the movie itself.
No you don't
put this on the computer that is connected to the monitor
http://pastebin.com/V6DVJn8Y

and put this on a computer you want to control it from handles multiple different players at ounce.
http://pastebin.com/b1Y0u5zW

requires a advanced computer (gold)

Even that is overkill compared to the solution that who ever it was gave, but, it works :)/>
Sammich Lord #7
Posted 20 December 2012 - 10:51 PM
I need to stop trying to answering questions when I am tired at 2AM…
theoriginalbit #8
Posted 20 December 2012 - 10:51 PM
I found the post a few days ago that covered something similar to this…

its the second last comment from the bottom by "Kingdaro"

http://www.computercraft.info/forums2/index.php?/topic/7050-startstop-shellrun-by-redstone-input/
BigSHinyToys #9
Posted 20 December 2012 - 11:00 PM
Even that is overkill compared to the solution that who ever it was gave, but, it works :)/>

maybe it is but I think I should cram in few more features ;)/>
theoriginalbit #10
Posted 20 December 2012 - 11:01 PM
lol
Sammich Lord #11
Posted 20 December 2012 - 11:03 PM
lol
You have posted almost that same message("lol" here and "lol." in another post) twice within a minute.
theoriginalbit #12
Posted 20 December 2012 - 11:14 PM
lol
You have posted almost that same message("lol" here and "lol." in another post) twice within a minute.

really? what was the other post? and stalker much :P/>

EDIT: Nevermind, i remember.
Sammich Lord #13
Posted 20 December 2012 - 11:22 PM
lol
You have posted almost that same message("lol" here and "lol." in another post) twice within a minute.

really? what was the other post? and stalker much :P/>

EDIT: Nevermind, i remember.
I just constantly spam the "View New Content" button and see almost every new post. I still remember that day where you got about 150 posts in one day. I capture a picture of it earlier in the day before that. I sadly only captured the image when you got 117 posts in a day. http://i.imgur.com/KJFMs.png
theoriginalbit #14
Posted 20 December 2012 - 11:26 PM
YEH! Go me! :P/> And again stalker much having that photo :P/>
Sammich Lord #15
Posted 20 December 2012 - 11:29 PM
YEH! Go me! :P/> And again stalker much having that photo :P/>
I have the Imgur extension installed so I can take a photo in about 3 seconds. And this is getting wayyyyyy off topic. Now we just need to stop bumping this or Cloudy will yell at us.
cpcp800 #16
Posted 21 December 2012 - 12:03 AM
I found the post a few days ago that covered something similar to this…

its the second last comment from the bottom by "Kingdaro"

http://www.computerc...redstone-input/
what is parralel
theoriginalbit #17
Posted 21 December 2012 - 12:05 AM
I found the post a few days ago that covered something similar to this…

its the second last comment from the bottom by "Kingdaro"

http://www.computerc...redstone-input/
what is parralel

Parallel is an API that allows multitasking. all the functions called within parallel run concurrently (kinda).

EDIT: There are 2 kinds, waitForAll() which must wait for all function to finish before continuing. and waitForAny which can continue after the first one has completed.
Sammich Lord #18
Posted 21 December 2012 - 12:05 AM
I found the post a few days ago that covered something similar to this…

its the second last comment from the bottom by "Kingdaro"

http://www.computerc...redstone-input/
what is parralel
If you want the English definition then google it. But there is a parallel API in CC that runs one action for a short amount of time then another action for a short amount of time making it seem that they are running at the same time.
cpcp800 #19
Posted 21 December 2012 - 03:09 AM
If you want the English definition then google it. But there is a parallel API in CC that runs one action for a short amount of time then another action for a short amount of time making it seem that they are running at the same time.
ok thanks