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

Conversation

ShreyPatel4
Copy link

I am New to Open source
and I am stuck and need help with defining token/trigger words that activate my plugin
increment the progress from here

ScreenShot PLugin helps :
1. Ease of Access.
2. Keeping Log for Issues in Local Runtime
@ShreyPatel4 ShreyPatel4 changed the base branch from master to dev August 29, 2021 09:35
@pnhofmann pnhofmann changed the base branch from dev to master August 29, 2021 09:48
@pnhofmann
Copy link
Collaborator

import pyautogui
import requests
from colorama import Fore
from plugin import plugin, require, alias
import os

@require(network=True)
@alias("ss", "capture")
@plugin("screenshot")
def ss(jarvis,s):
    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)

So, you don't have to call something like CmdInterpreter.input() - the plugin will be called if the user types screenshot and then the parameter s contains everything the user typed apart from screenshot.

Also no need to modify python path ;).

You would just need to initialize incr. Probably use jarvis.get_data(key) and jarvis.update_data(key, data)

https://github.com/sukeesh/Jarvis/blob/master/doc/API.md#get_data

@ShreyPatel4
Copy link
Author

yes, I will work on the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants