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

Mouse event conflicts with pullEventRaw

Started by latias1290, 19 January 2014 - 09:10 AM
latias1290 #1
Posted 19 January 2014 - 10:10 AM
hello,
I am trying to make a login system for my PC that involves user-friendly looking windows and supports mouse clicks. However, a major security leak in my program causes, whenever someone tries to ctrl+T their way into my PC, raise an error message saying:

startup:65: attempt to compare nil with number
It then terminates, allowing anyone to get in like any other poor-quality lock.
This is very likely due to my program using both

event, button, x, y = os.pullEvent("mouse_click")
to catch mouse clicks, as well as

os.pullEvent = os.pullEventRaw
to stop the program from terminating.
I cant post the full code now, but I might be able to later today.
How can I stop the program from being force-terminated while retaining mouse support?
Lyqyd #2
Posted 19 January 2014 - 01:47 PM
Post the full code. And you probably don't want to be filtering events anyway if you're trying to make something complex like that.
latias1290 #3
Posted 19 January 2014 - 01:58 PM
And you probably don't want to be filtering events anyway if you're trying to make something complex like that.
What exactly do you mean by "filtering events"? Because this program is supposed to not have one of the biggest security flaws out there, like any other security program. Also, the mouse clicks are not truly necessary, but I just want to have something snazzy like that :)/>
CometWolf #4
Posted 19 January 2014 - 02:07 PM
Filtering events means you're only catching a specific event with your os.pullEvent. That's what the argument("mouse_click") does, now you only get mouse_click events.
latias1290 #5
Posted 20 January 2014 - 02:13 PM
Well then, is there any way to catch mouse clicks without filtering them?
Lyqyd #6
Posted 20 January 2014 - 03:04 PM
They come in like any other event, so just os.pullEvent().