Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New_Plugin_ScreenShot #899

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions installer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ Image
img2pdf
pdf2image
python-nmap
pyautogui
30 changes: 30 additions & 0 deletions jarviscli/plugins/screenshot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import pyautogui
# some_file.py
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, 'jarviscli')

import CmdInterpreter
import requests
from colorama import Fore
from plugin import plugin, require
import os

@require(network=True)
@plugin("screenshot")
def ss(jarvis,s):
if (s):
data = CmdInterpreter.input()
if data == "":
jarvis.say("Sorry, an error occured", Fore.BLUE)
return
elif(data == "/ss") or (data == "/screenshot") or (data == "/capture") :
jarvis.say("Please give me a moment", Fore.BLUE)
incr += 1
incr = str(incr)
myScreenshot = pyautogui.screenshot()
myScreenshot.save(r'./../ss'+incr+'.png')
if(os.path.isfile('./../ss'+incr+'.png')==False):
jarvis.say("Success!", Fore.BLUE)
else:
jarvis.say("Sorry, an error occured retry using /ss , /screenshot, /capture", Fore.RED)