RX14 / autokey

Automatically exported from code.google.com/p/autokey
GNU General Public License v3.0
0 stars 0 forks source link

JSON saving goes wrong #123

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ok I am new to python so I think its funny that an if statements sees his next 
codeblock by looking to the indents, so I wrote my first bit.
what the purpose is of my code is, when "1" is pressed it should sent a 
different character out of an array, this every 1 second, and if "1" isn't 
pressed in 2 seconds then the function should start at the beginning of the 
array.
To explain; I play a MMORPG game where some keys cant be macro-ed ingame, so I 
want to rotate keys, so I only have to press 1 button, but when I got a new 
enemy I want to start from the beginning again, hence the 2 seconds delay.

I would like this in micro-seconds, and maybe use a different button to reset 
the array. (so listen to 2 different keys and know in script which key, or 2 
scripts interacting with each other)

But this is my first startup.

While writing this script, I had to restart Autokey a couple of times, and 
remove the Autokey.JSON file.
First of all when editing sometimes the app doesn't write a correct JSON file.
When that happends the save button is disabled but navigating somewhere else 
gives a "you want to save changes" button. The only option is to kill the 
autokey process.
Then when you startup you get a JSON error.
So you need to delete /home/user/.config/autokey/autokey.json file.

I understand that my code is wrong, but this bug is enoying cause I need to 
restart from scratch.

Next I will paste the autokey.txt that I'll save and reproduces the problem.

hang on to my next comment.

Original issue reported on code.google.com by rienk.bo...@gmail.com on 11 Jun 2011 at 12:17

Attachments:

GoogleCodeExporter commented 9 years ago
now this strange, I hustled a bit with the script settings and got the save 
dialog while it was saved, so the JSON was corrupted again, replaced old copy 
of the json and json~ file, tried it again to pin point it to write it in here 
and I couldn't reproduce it...
When I get it I will write more here...

Original comment by rienk.bo...@gmail.com on 11 Jun 2011 at 12:26

GoogleCodeExporter commented 9 years ago
When I saved the code, then I switched application or to other script I got the 
dialog, but it is not always. Its with this code:

import time

choices = ["<", "z", "x","c","v","b"]
#timedelay = 0.25
debugchar = 0
timereset = 2
oldtime = -1
currtime = time.localtime
run = -1
#0 = no, 1 = yes
sentkey = ""

#keyboard.send_key(choices[0],1)
if store.has_key("currtime"):
    oldtime = store.get_value("currtime")
    sentkey = "[OT:" % oldtime % "]"
else:
    store.set_value("currtime", currtime)
    sentkey = "[NOT STORED]"

keyboard.send_key(sentkey)

what should be send_keys...
didn't valadite yet, just switched apps after save

Original comment by rienk.bo...@gmail.com on 11 Jun 2011 at 1:45

GoogleCodeExporter commented 9 years ago
Thanks for tasking the time to report this problem. I am working on a total 
rewrite of AutoKey without such a complex GUI which will make this bug no 
longer relevant.

Original comment by cdekter on 13 Jun 2011 at 12:01