Re: [Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-26 Thread bhavanitech
Question #698136 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698136

bhavanitech posted a new comment:
> I stopped looking at this years ago, since it is rather complicated
with little overall effect.

Thanks for this quote, saved my many hours, possible days of over-
researching just to satiate my perfectionism disorder (Yes,
perfectionism is a dis-order, struggling with it for decades, lol).

> I never really had problems with that even on machines with 4GB
physical memory

Yes, my system works jaggedly/slowly when I have it running along with
Chrome, chrome dev_tools, VSCode etc. I think this was due to the fact
that older apps were written in real high level performant programming
languages like C, C++ or .net with good memory and GC managment. In
contrast nowadays, most desktop apps are javascript based, or optimized
for JS runtime, Chrome (think multiple chrome extension, needing their
own separate ram allocation) VSCode, Notion (Electron, js based), which
isn't a real high level lang, essentially its a scripting interpreter
written in C++, an extra steps in talking to hardware. so modern apps
will never be as performant as older apps, still this is just my
opinion. It may be due to many other factors that you never had problem
with 4GB RAM.

I think I wouldn't be using Sikuli anymore. Looking over to AutoIT image
search/recognition. Anyways, thank you very much for your help and your
work in keeping this project alive over the years.  Good day and Have a
nice one. :) :)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-25 Thread RaiMan
Question #698136 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698136

RaiMan posted a new comment:
This is not abnormal. Java has a dynamic memory management. SikuliX
usage usually starts at about 300 MB. on longer runs it increases
towards 700 - 900 MB. This is due to the standard memory parameters of
Java.

If you think, this really has an impact on your system behavior, then
you have to dive into the memory management parameters of Java (-X
parameters).

I stopped looking at this years ago, since it is rather complicated with little 
overall effect.
I never really had problems with that even on machines with 4GB physical 
memory, which these days is the minimum recommended.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-25 Thread bhavanitech
Question #698136 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698136

Status: Answered => Solved

bhavanitech confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-24 Thread bhavanitech
Question #698136 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698136

bhavanitech posted a new comment:
RaiMan,

Thanks, that solved the issue, another issue I face is the script is
consuming too much of RAM like anywhere between 500MB - 1GB. Also
exported script is as a runnable jar but didn't notice much reduction of
RAM usage (may be slightly).

**SPECS**
Win7 (x64), 
6 GB RAM,  
500 GB HDD,  (C:\ - 12 GB free space)
Thinkpad T520 - intel i5 (4th Gen)
JAVA 8 (update 301 , 2021) - updated

**Screenshots**:

[Win Task Manger - ram usage by java.exe - sikuli _ide/  runnable
JAR](https://i.imgur.com/2rvmjuw.png)

[script:](https://i.imgur.com/dP845h9.png)


CODE start:--

def SetfocusDevToolStylesFilter(event):
wait(.05)
click(Pattern("btnstyles.png").similar(0.40).targetOffset(-30,0))
wait(.05)
click(Pattern("inputfilter.png").similar(0.50).targetOffset(-100,0))

Env.addHotkey(Key.END, KeyModifier.ALT+KeyModifier.CTRL, 
SetfocusDevToolStylesFilter)

def SetfocusDevToolComputedStylesFilter(event):
wait(.15)
click(Pattern("btncomputed.png").similar(0.52).targetOffset(-30,0))
wait(.1)

Env.addHotkey(Key.PAGE_DOWN, KeyModifier.ALT+KeyModifier.CTRL, 
SetfocusDevToolComputedStylesFilter)

def hkx(evt):
print "terminating"
global running
running = False

Env.addHotkey("x", KeyModifier.ALT+KeyModifier.CTRL, hkx);

running = True

while running:
wait(1)

CODE END:--

Also, how to cleanly exit/termiate the runnable jar, when I press the hotkey 
ctrl+alt+x (def hkx(evt)) to terminate it shows FATAL ERROR
"System.out is broken (console output) . You will not see any message anymore! 
Save your work and restart the IDE!"

[FATAL error screenshot](https://i.imgur.com/J3F5P3y.png)

Thanks for your help, very much appreciated.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-24 Thread RaiMan
Question #698136 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698136

Status: Open => Answered

RaiMan proposed the following answer:
This works for me:

def hk1(evt):
print "hk1"

def hk2(evt):
print "hk2"

def hkx(evt):
print "terminating"
global running
running = False

Env.addHotkey("x", KeyModifier.ALT+KeyModifier.CTRL, hkx);

Env.addHotkey("c", KeyModifier.ALT+KeyModifier.CTRL, hk1);

Env.addHotkey("v", KeyModifier.ALT+KeyModifier.CTRL, hk2);

running = True

while running:
wait(1)

You need something in your script, to keep it active  (here the while
loop) and a hotkey for script termination (here x).

Do not use exit() in a callback def, since this might stop the IDE (but
can be used if the script is run from commandline only).

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-24 Thread bhavanitech
Question #698136 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698136

Description changed to:
Hi,

I have two def function is the sikuli editor and both works but only
works when there is only one function, i.e.  if there are two function
definitions, one after the other (as shown in the linked screenshot)
then the bottom one works,  the top one doesn't work.

If I remove the bottom one, then the top one works and so both are
syntactically both are correct. Why is this, help me

See this screenshot:

https://i.imgur.com/m80LZNF.png


--CODE - BEGIN (DOESN'T WORK)--


def SetfocusDevToolStylesFilter(event):
wait(.35)
click(Pattern("1627068824162.png").targetOffset(-100,0))

Env.addHotkey("g", KeyModifier.ALT+KeyModifier.CTRL, 
SetfocusDevToolStylesFilter);

#Another hotkey begin;
def SetfocusDevToolStylesComputedFilter(event):
wait(.35)
click(Pattern("1627070834253.png").similar(0.92).targetOffset(-50,0))
   
Env.addHotkey(Key.PAGE_DOWN, KeyModifier.ALT+KeyModifier.CTRL, 
SetfocusDevToolStylesComputedFilter)

--CODE - END (DOESN'T WORK)- -

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #698136]: Two `def` functions, doesn't work, only bottom one works, why

2021-07-24 Thread bhavanitech
New question #698136 on SikuliX:
https://answers.launchpad.net/sikuli/+question/698136

Hi,

I have two def function is the sikuli editor and both works but only works when 
there is only one function, i.e.  if there are two function definitions, one 
after the other (as shown in the linked screenshot) then the bottom one works,  
the top one doesn't work. 

If I remove the bottom one, then the top one works and so both are 
syntactically both are correct. Why is this, help me 

See this screenshot:

[https://i.imgur.com/m80LZNF.png] (https://i.imgur.com/m80LZNF.png)


--DOESN'T WORK BEGIN--


def SetfocusDevToolStylesFilter(event):
wait(.35)
click(Pattern("1627068824162.png").targetOffset(-100,0))

Env.addHotkey("g", KeyModifier.ALT+KeyModifier.CTRL, 
SetfocusDevToolStylesFilter);

#Another hotkey begin;
def SetfocusDevToolStylesComputedFilter(event):
wait(.35)
click(Pattern("1627070834253.png").similar(0.92).targetOffset(-50,0))
   
Env.addHotkey(Key.PAGE_DOWN, KeyModifier.ALT+KeyModifier.CTRL, 
SetfocusDevToolStylesComputedFilter)

--DOESN'T WORK END- -

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp