Jump to content




screenshot API

api

6 replies to this topic

#1 louitzie

  • Members
  • 50 posts

Posted 26 November 2012 - 01:06 AM

I recently made an screen api that's able to save screenshots in rtf format

functions

screen.get() returns screen object used for term.redirect()
screen.takeScreenshot(path) to save screenshot to path
viewing in wordpad gives the best quality.

you can optionaly use the startup script to take screenshots using print screen key

enjoy this, I hope this wil be something usefull.

download: screenshotapi

pastebin: screen

please comment

#2 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 26 November 2012 - 03:11 AM

Please post it on pastebin so we can see if it is not a virus :D/>

#3 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 26 November 2012 - 10:15 AM

Thanks you for the pastebin post, with it I see your function are defined with a screen.function. The problem with that is if we use your api as screen api, to call a function we need to enter : screen.screen.function as the screen. is automatically added by the loadApi.

#4 louitzie

  • Members
  • 50 posts

Posted 26 November 2012 - 10:37 AM

View Postbjornir90, on 26 November 2012 - 10:15 AM, said:

Thanks you for the pastebin post, with it I see your function are defined with a screen.function. The problem with that is if we use your api as screen api, to call a function we need to enter : screen.screen.function as the screen. is automatically added by the loadApi.
thats not true use
term.redirect(screen.get())
screen.takeScreenshot(path_to_save_to)

thats the reason i used screen. before functions

#5 bjornir90

  • Members
  • 378 posts
  • LocationFrance

Posted 26 November 2012 - 07:26 PM

View Postlouitzie, on 26 November 2012 - 10:37 AM, said:

View Postbjornir90, on 26 November 2012 - 10:15 AM, said:

Thanks you for the pastebin post, with it I see your function are defined with a screen.function. The problem with that is if we use your api as screen api, to call a function we need to enter : screen.screen.function as the screen. is automatically added by the loadApi.
thats not true use
term.redirect(screen.get())
screen.takeScreenshot(path_to_save_to)

thats the reason i used screen. before functions
As I haven't tested your api, I cannot say this don't work but I think this need another screen. Before it. I will test it probably tomorrow cause this is very funny.

#6 TheVarmari

  • Members
  • 70 posts
  • LocationFinland

Posted 27 November 2012 - 03:57 AM

View Postlouitzie, on 26 November 2012 - 10:37 AM, said:

View Postbjornir90, on 26 November 2012 - 10:15 AM, said:

Thanks you for the pastebin post, with it I see your function are defined with a screen.function. The problem with that is if we use your api as screen api, to call a function we need to enter : screen.screen.function as the screen. is automatically added by the loadApi.
thats not true use
 term.redirect(screen.get()) screen.takeScreenshot(path_to_save_to) 
thats the reason i used screen. before functions
Let me explain you how os.loadAPI() works.

os.loadAPI() returns boolean success when trying to load an API. Then you can call that API by the file name. "screen"'s filename would be "screen", for example.
Now, the problem I see, without testing, is that you declare it screen.function, and when we use loadAPI we have to use screen.screen.function.

Now, the reason, again, I have not tested, you can use screen.function is because you have the API in the same file as the program.

#7 louitzie

  • Members
  • 50 posts

Posted 27 November 2012 - 04:14 AM

Quote

Quote

Quote

Thanks you for the pastebin post, with it I see your function are defined with a screen.function. The problem with that is if we use your api as screen api, to call a function we need to enter : screen.screen.function as the screen. is automatically added by the loadApi.
thats not true use
 term.redirect(screen.get()) screen.takeScreenshot(path_to_save_to) 
thats the reason i used screen. before functions
Let me explain you how os.loadAPI() works. os.loadAPI() returns boolean success when trying to load an API. Then you can call that API by the file name. "screen"'s filename would be "screen", for example. Now, the problem I see, without testing, is that you declare it screen.function, and when we use loadAPI we have to use screen.screen.function. Now, the reason, again, I have not tested, you can use screen.function is because you have the API in the same file as the program.

let me explain this a last time.

1 screen is a local table wich you cannot get using screen.screen use screen.get() instead
2 all functions of the screen table are overrides to the term functions (it takes the default term function if the function is not defined in the screen table)
3 use get() function to get the screen table





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users