PDA

View Full Version : Eldevin Copper Miner [Beta]



bg5
06-26-2014, 08:37 AM
One day I was bored, so I started my scripting adventure in Lape... I don't really know much about this game, but it was fun to make that script.


1. Instalation

Script uses ETL (https://villavu.com/forum/showthread.php?t=106263)for debug purpose:

a) Unzip and put this in Simba/Plugins :

23437

b) Put this in Simba/Include

23438

c) Script also uses part of SRL-6 library (https://github.com/SRL/SRL-6) : mouse.simba (https://github.com/SRL/SRL-6/blob/master/lib/core/mouse.simba) and math.simba (https://github.com/SRL/SRL-6/blob/master/lib/utilities/math.simba). If you don't have SRL-6 library already you should download it from github or optionally download only those 2 files. Make sure that include path in the header of files is correct!


d) Get the script:
23439
23892 v 1.1
24461 v 1.1b Fixed Version




2. Settings

http://puu.sh/9KGTT/aadcca3e04.png

http://puu.sh/9KGLw/394bf9fd9b.png

3. Known Issues

a) Script breaks when it clicks on another player and opens his interface
b) Script breaks when it clicks on rock, which is only partially visible on screen (Exception in Script: Runtime error: "You passed a wrong xe to a finder function...blah blah blah) - Now I'm looking for elegant solution. Solved in v1.1

4. Enjoy!



5. Changelog

Version 1.1

Solved issue with CountColor() breaking script
Added customization - now you can adjust script to any ore you want in 3 easy steps! Read code for details...


Version 1.1b

Script is now compatible with updated SRL-6 version

Novite666
07-31-2014, 02:00 PM
Any examples of your Lave code? Sounds interesting.

MaxGreden
08-06-2014, 03:59 PM
The way the bot is made is intriguing. Nice. One problem with it, it sometimes right clicks the ore so that the interface comes up and interferes with the green line detection, breaking the bot.

angelusgbi
08-15-2014, 08:36 AM
you can create or edit for bronze ore?


23800

bg5
08-23-2014, 03:08 PM
The way the bot is made is intriguing. Nice.

Yeah, thanks :P It's my first script in Lape, so I wanted to test it's abilities.


One problem with it, it sometimes right clicks the ore so that the interface comes up and interferes with the green line detection, breaking the bot.

I know about this error. It should be handled inside CountColor() function, instead of breaking a script it should at least just throw an exeption. The only way to fix it is constructing a wrapper, which checks if presumed position of green lines is out of client bounds and if yes, adjusts position to client bounds.If I remember well, FindColors... functions have this mechanism built in.



you can create or edit for bronze ore?

Shure, it's just little work in ACA. However, I don't guarantee big accuracy with just 1 base sample.

@Edit Sorry I can't do that with sample you've sent. It's .png, so picture is compressed and colors are broken. I need raw .bmp format. Or with new script version you can easy add it by yourself!

@Edit2

New version is out !

Cjey
11-14-2014, 01:07 AM
Error: Unknown declaration "MOUSE_MOVE" at line 308

What can I do?

akarigar
11-14-2014, 01:15 AM
Error: Unknown declaration "MOUSE_MOVE" at line 308

What can I do?

Make sure you follow the instructions under "How to install/setup Simba" section in this (https://villavu.com/forum/showthread.php?t=47714) guide.

a12312312
11-15-2014, 02:29 PM
i have the same issue MOUSE_MOVE

Fawflance
11-16-2014, 12:44 PM
I have the same problem, I followed the exact instructions, but still it gives same error

bg5
11-17-2014, 11:17 PM
I have the same problem, I followed the exact instructions, but still it gives same error


Error: Unknown declaration "MOUSE_MOVE" at line 308

What can I do?

Uhm..what?!

Took me some time to find out what happened...

Sorry guys, but it's Olly who screwed my script so blame him not me :P Basically change was done in mouse.simba ( https://github.com/SRL/SRL-6/commit/b7a664fb04869b99650159f12fb40601b398325f#diff-84eb4897dc6c868ce0fa6dd8dc00b736L68 ) and MOUSE_MOVE , MOUSE_LEFT etc constans were removed. Also other changes were done to SRL6... Well, it sucks that you can't now use parts of SRL library independently anymore. This script uses only SRL mouse procedures (because of their great simulation of human movements) so attaching whole big SRL library is unnecessary and I'm trying to avoid it.


Ok, here is solution. Change the header of the script to:

program EldevineCopperMiner; // v 1.1b (fixed)
{$loadlib ETL}
{$i etl_Lape.simba}

{$i SRL-6\lib\utilities\math.simba}
const
MOUSE_NONE = -1;
MOUSE_MOVE = 3;
MOUSE_BREAK = 8;
MOUSE_ACCURATE = 14;
MOUSE_HUMAN = 7;
{$i SRL-6\lib\core\mouse.simba}

daggen
11-29-2014, 08:51 AM
im having slight problem not sure whats happening, i think i set everything up correctly script runs and all but when it runs, it clicks the rock so to speak but eldevin does nothing like as if the mouse is not clicking the target its finding.