Jump to content




"Open Link" function


19 replies to this topic

#1 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 21 June 2014 - 09:27 AM

So my idea is that a function, maybe os.openURL() could exist, allowing programs to open links in the user's default web browser. This would work like the "clicking links in chat" feature in Minecraft, where clicking on a link prompts the user to open the URL. However, it is called from a function.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,451 posts

Posted 21 June 2014 - 10:01 AM

That would almost certainly be used more for abusive/griefing purposes than anything else.

#3 Saldor010

  • Members
  • 467 posts
  • LocationThe United States

Posted 21 June 2014 - 02:28 PM

while true do
  os.openURL(MaliciousSite)
end


#4 awsmazinggenius

  • Members
  • 930 posts
  • LocationCanada

Posted 21 June 2014 - 03:46 PM

By default, in Minecraft, you are prompted before opening links, allowing the user to decide whether they want to open the link. This feature could be useful for many things, like a link to email or Skype chat with the program author, so I support it.

#5 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 21 June 2014 - 03:56 PM

Yes, but in normal minecraft, you have to explicitly click on the link in the chat window, it's solely a client side thing. The server shouldn't be able to do such stuff.

#6 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 21 June 2014 - 04:32 PM

Maybe CC can close the GUI and "whisper" the URL to the player.

#7 Bomb Bloke

    Hobbyist Coder

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

Posted 21 June 2014 - 05:24 PM

Assuming the user is prompted before opening the link (by ComputerCraft itself, as opposed to the script), and the prompt includes an option to terminate the script instead, I don't see any problems. Assuming common sense is incorporated into the implementation, this strikes me as a reasonable idea.

#8 Sebra

  • Members
  • 726 posts

Posted 21 June 2014 - 06:09 PM

1. Which user's browser you want to use? All around?
2. Computer cannot even beep now, how would it "whisper"? Special device?
3. Launching any external program without explicit user demand is quite bad. Especially inet access.

#9 Bomb Bloke

    Hobbyist Coder

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

Posted 21 June 2014 - 06:23 PM

View PostSebra, on 21 June 2014 - 06:09 PM, said:

1. Which user's browser you want to use? All around?

The default browser of the user that clicks the link.

View PostSebra, on 21 June 2014 - 06:09 PM, said:

3. Launching any external program without explicit user demand is quite bad. Especially inet access.

The idea is that the user is prompted - by ComputerCraft / MineCraft, as opposed to the script - as to whether or not the link should be opened.

#10 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 June 2014 - 07:19 PM

Again, this opens a whole can of worms, where someone could spam links constantly with an infinite loop, and hide the computer. This is just a bad idea.

#11 Symmetryc

  • Members
  • 434 posts

Posted 21 June 2014 - 07:34 PM

View PostCranium, on 21 June 2014 - 07:19 PM, said:

Again, this opens a whole can of worms, where someone could spam links constantly with an infinite loop, and hide the computer. This is just a bad idea.
What could happen is, as Bomb Bloke said, it could open up a prompt that allows you to either follow the link, not follow the link, or terminate the program. That way, if the program is simply spamming link prompts, you could just terminate it.

I think this idea would be quite nice.

#12 Bomb Bloke

    Hobbyist Coder

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

Posted 21 June 2014 - 07:43 PM

Though really, users would need to trigger even that prompt manually - it's no good if malicious users could simply restart the script over and over until someone mis-clicked and opened a webpage they didn't want to.

The way to go would be to define areas of an advanced system/monitor's display to act like a link. Some sort of special "print" function would be required, one that drew a line under the rendered text and flagged it as a URL.

It's certainly do-able, but a fair bit of work would be involved. The question is whether it's worth it.

#13 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 21 June 2014 - 07:54 PM

I think the only proper way to do it would be only from the gui, and the user MUST click on the url to visit the page, rather than a popup. That way, even if it's spammed, the person must click it to open it up, otherwise it's just a bit of text in the computer, and you can safely esc out of it.

#14 Slash0mega

  • Members
  • 74 posts

Posted 22 June 2014 - 02:19 PM

while i doubt that this will make it into computercraft, i think i got a solution to the loop worry

allow users to disable the promt from appering on there client with a "stop showing prompts this session" showing in the prompt. that way if a user loops the promt, you can click that and no matter how many times the script requests the promt, it wont effect you.

now, here is another problem, how would the computer know who to show the prompt too? whoever has the gui open at the time? if that was the the case another solution to prompt spam is just to not open that terminal again after it kicks you out of the cc interface for the prompt the second or third time.

#15 apemanzilla

  • Members
  • 1,421 posts

Posted 22 June 2014 - 02:53 PM

This feels like it would break the fourth wall too much and also allow too many malicious uses with the current system in place for links. Sorry.

#16 Sebra

  • Members
  • 726 posts

Posted 22 June 2014 - 06:17 PM

View PostBomb Bloke, on 21 June 2014 - 07:43 PM, said:

The way to go would be to define areas of an advanced system/monitor's display to act like a link. Some sort of special "print" function would be required, one that drew a line under the rendered text and flagged it as a URL.
This is even worse. You turn Computer into device_to_show_urls.

How about special button it GUI? Player can click on it, then any string on the screen to try to open it in default browser.
This way no special function needed, player initiate browser launch himself, no screen change needed.

#17 apemanzilla

  • Members
  • 1,421 posts

Posted 25 June 2014 - 12:48 AM

View PostSebra, on 22 June 2014 - 06:17 PM, said:

View PostBomb Bloke, on 21 June 2014 - 07:43 PM, said:

The way to go would be to define areas of an advanced system/monitor's display to act like a link. Some sort of special "print" function would be required, one that drew a line under the rendered text and flagged it as a URL.
This is even worse. You turn Computer into device_to_show_urls.

How about special button it GUI? Player can click on it, then any string on the screen to try to open it in default browser.
This way no special function needed, player initiate browser launch himself, no screen change needed.
How would you identify the entire string from the point where the player clicked? You could only accurately get a single character based on their click without havig to guess at what is and isn't part of what they tried to click.

#18 Saldor010

  • Members
  • 467 posts
  • LocationThe United States

Posted 25 June 2014 - 02:53 PM

I vote that we don't do this at all. I don't think CC computers should be allowed to access your real computers program (in this case, a web browser), no matter what method. It breaks the fourth wall way too much.

#19 Bomb Bloke

    Hobbyist Coder

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

Posted 25 June 2014 - 02:59 PM

*cough*paste event*cough*http API*cough*

#20 Sebra

  • Members
  • 726 posts

Posted 25 June 2014 - 09:11 PM

View Postapemanzilla, on 25 June 2014 - 12:48 AM, said:

How would you identify the entire string from the point where the player clicked? You could only accurately get a single character based on their click without havig to guess at what is and isn't part of what they tried to click.
Space separated.

View PostJiloacom, on 25 June 2014 - 02:53 PM, said:

I vote that we don't do this at all. I don't think CC computers should be allowed to access your real computers program (in this case, a web browser), no matter what method. It breaks the fourth wall way too much.
I'm agree.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users