Jump to content




How to run a program on access?


10 replies to this topic

#1 weirdwolf

  • Members
  • 5 posts

Posted 27 November 2016 - 01:15 AM

Alright, straight to the problem at hand.

I have made myself a password program (protected from Ctrl+T) that i would like to run on access to the computer, say you have a password protected door using a monitor on the side of the computer with a numpad lock, but anyone can right click the computer and change the password to said numpad (i like configurability) is there a way to make my password program run, as soon as the computer itself gets accessed?

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 27 November 2016 - 01:40 AM

http://www.computerc...fo/wiki/Startup

#3 weirdwolf

  • Members
  • 5 posts

Posted 27 November 2016 - 01:36 PM

Not quite what i was gunning for, what i'd like is for, when the computer is running a program already, when you then access the computer a password program will run, then if you get the correct password it'll go back to running the other program, and to make sure the first program is 'always' running, it would look for input, and if nothing has been written for a couple of seconds it would terminate and go back to the first program, so a loop of the two programs if you will

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 28 November 2016 - 12:10 AM

The computer can't tell if a user is sitting in front of it or not.

Is there any particular need to only run one program at a time? It sounds like you could just run your two scripts in different multishell tabs... assuming you couldn't just code all functionality into one script.

#5 weirdwolf

  • Members
  • 5 posts

Posted 28 November 2016 - 03:44 PM

there isn't a way to check if a player has clicked the computer? like checking where on a monitor a player has right-clicked?

#6 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 28 November 2016 - 09:07 PM

View Postweirdwolf, on 28 November 2016 - 03:44 PM, said:

there isn't a way to check if a player has clicked the computer? like checking where on a monitor a player has right-clicked?

Sure, it's possible to get mouse events, but they won't tell the program if a player interacted with the computer or not.

#7 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 28 November 2016 - 10:19 PM

First, make coroutine manager, or find one online. Also make a timer var On the coroutine manager run your program and rom/programs/shell. Next, create a whitelist with user-events.
Now, rig os.pullEventRaw to check against that list, and if it finds a match, then reset the timerVar. But do this after also rigging it to check timerVar, and if timer var is greater than 180000 than go back to the login screen.

Edited by EveryOS, 28 November 2016 - 10:22 PM.


#8 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 28 November 2016 - 10:24 PM

View PostEveryOS, on 28 November 2016 - 10:19 PM, said:

First, make coroutine manager, or find one online

No. Using the built-in coroutine manager is much better, as it is guaranteed to work properly.

#9 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 29 November 2016 - 11:39 AM

View PostKingofGamesYami, on 28 November 2016 - 10:24 PM, said:

View PostEveryOS, on 28 November 2016 - 10:19 PM, said:

First, make coroutine manager, or find one online

No. Using the built-in coroutine manager is much better, as it is guaranteed to work properly.
Might have been useful to have a link: http://www.computerc.../Parallel_(API)

#10 hbomb79

  • Members
  • 352 posts
  • LocationOrewa, New Zealand

Posted 02 December 2016 - 02:35 AM

View PostLupus590, on 29 November 2016 - 11:39 AM, said:

View PostKingofGamesYami, on 28 November 2016 - 10:24 PM, said:

View PostEveryOS, on 28 November 2016 - 10:19 PM, said:

First, make coroutine manager, or find one online

No. Using the built-in coroutine manager is much better, as it is guaranteed to work properly.
Might have been useful to have a link: http://www.computerc.../Parallel_(API)

I swear, 90% of the time someone says to make a custom coroutine manager, the built in API is adequate and as mentioned - will work properly.

#11 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 02 December 2016 - 11:51 AM

BB's guide to coroutines is overdue here.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users