-
Corporal
[LuaKeys] Java Automation tool +Fishing Script
Last edited by kyperbelt; 05-15-2016 at 10:29 PM.
-
Post Thanks / Like - 1 Thanks
Dazzled (1 members gave Thanks to kyperbelt for this useful post)
-
Corporal
Ok guys had some free time today so i decided to put up an update for LuaKeys
here is a small changelog:
v0.2 5/14/16
Added:
- some advanced image searching/recognition is available through the sikuliX lib
- some human like behavior(semi organic mouse movement)
- sending key input to background windows is now possible
- added the ability to hook functions to key presses
- some simple memory reading and writing is added
Fixes:
- fixed a bug that cased key input to sometimes not go through
And here is is a simple anti afk script that i have been using a lot recently to avoid 20 hour queues in private servers.(should be included in the new download in OP)
Code:
local interval = 120; --time in seconds until next key press
local elapsed = 0; --elapsed time since last key press
local lastTime = script.time(); --last time elapsed time was updated
local key = Keys.W; --key to press to prevent afk
script.sleep(2000); --sleep for 2 seconds
log.write("initiating anti afk");
while true do
log.write("elapsed time:"..elapsed); --write the elapsed time to the log
elapsed = elapsed+(script.time() - lastTime)/1000; --update elapsed time
lastTime = script.time();
if((elapsed > interval))then --if elapsed time is greater than interval then press the key
log.write("pressing anti afk key");
input.keyDown(key);
script.sleep(5);
input.keyUp(key);
elapsed = 0; --reset the elapsed time
end
script.sleep(1000); --sleep for one second
end
Last edited by kyperbelt; 05-15-2016 at 10:29 PM.
-
Post Thanks / Like - 1 Thanks
Krack3n (1 members gave Thanks to kyperbelt for this useful post)
-
Corporal
added a jar only download for those who wish to not have to redownload the whole zip every time.
also included a simple script to capture screen images and save them to a res folder for use with other scripts.
here is the code:
Code:
local img = nil;
local savelocation = "res/";
local capture = false;
local save = false;
function captureImage()
log.write("capturing on screen image");
capture = true;
end
function saveImage()
if(img~=nil)then
log.write("saving image.....");
save = true;
end
end
input.hook(captureImage,Keys.C,Keys.ALT_MASK);
input.hook(saveImage,Keys.S,Keys.CTRL_MASK);
while true do
script.sleep(1000);
if capture then
img = screen.capture(screen.selectRegion("select image"));
capture = false;
log.write("done capturing on screen image.");
end
if save then
screen.saveImage(img,savelocation);
save = false;
log.write("Image saved successfuly!");
end
end
this is a windows only script at the moment but can be made to work with any os simply by removing the key hooks.
it comes included with the latest release download.
EDIT: when the script is running simply press ALT+C to capture an image and CTRL+S to save it to the "res/" folder(will create one if there is none)
You can change the image save directory by modifying savelocation variable
Last edited by kyperbelt; 05-15-2016 at 11:47 PM.
-
Active Member
Nice! Will give this a go. Looks great!
-
Member
Hi
Thanks for doing this! I've just tried to run the fishing script on OSX, but it doesn't seem to do anything and there isn't anything being written to the log - any ideas?
-
Member
Ah, looks like it wants to run in 32bit mode, but OSX only does 64bit - any ideas?
-
Member
Thanks for doing this!