PDA

View Full Version : [Thieving] Ancrath's safeCracker - Revamped



Ancrath
01-15-2015, 04:43 AM
Version: 1.6 Gem Cutter
Made by: Ancrath
Released: 27 Feb 15
Borrowed Script Authors: The Mayor, Ashaman, Coh3n, renzanity

There are safes in the Rogue's Den located underneath the bar in Taverley that give thieving xp (70), gold (20 or 40), and basic gems other than diamond. This script will crack said safes, will even use a Stethoscope, and then deposit the gems as your inventory becomes full. If/when your hp falls below 20% it will path itself over to the Taverley Bank to heal and then return to the safes. Recommended level would be 50+ along with the stethoscope, but can be started at level 25. The stethoscope is a non-tradeable item bought from Martin Thwait inside the Den, however you are required to have both 50 Agility and 50 Thieving to access his store. Now comes with progress reports to track all relevant information.

https://villavu.com/forum/attachment.php?attachmentid=24874&d=1422122399

Setup: Decide what break values you want, fill in the information in the procedure DeclarePlayers(), and place your character by the safes. If you have a pin, enter it in the const section. Place safeCracker.png in your RUNESCAPE_OTHER folder. If you want to use a Stethoscope then place it in the first slot of your bank. Put an overall or thieving xp tracker in you chatbox where the picture above says "Xp Bar Here." For the gem cutter, put sapphire, emerald, and ruby on your 1-3 hotkeys. If you don't want the script to cut your gems then go to the const section and change the boolean value there to false.


Author Note: Programming is a hobby for me that I do when I have the time and the motivation. I make an honest effort to check the status of my threads at least twice a week to reply and keep up with you guys, so bear with me. This script has been an ever evolving script that started off as a Frankenstein bit of code thrown together and turned into what I consider an efficient, working script as I learned the ropes of coding in Simba. If there is an obvious and better way of doing something in my code, please tell me because I probably didn't even know and appreciate the advice. Thanks for any current and future advice, hope you enjoy the infinite supply of gems.

Taric
01-15-2015, 03:47 PM
I... I love you. Will keep you posted on what bugs I find and whatnot...

Gratz on the re-release :p

Ancrath
01-15-2015, 05:25 PM
Thanks for the love. I need to add fail-safes for the fail-safes, but I personally haven't had any problems yet so haven't implemented any yet.

Taric
01-15-2015, 07:01 PM
Been running like a champ for 3 hours now. Still love you.

I'll get you something off the McDonald's dollar menu if you add a gem cutting feature. :3

Ancrath
01-16-2015, 02:45 PM
Hah, good to hear. I have a way in mind of doing it, I'll get around to it eventually but it might be a week or two before I even look at it. In a few days I'm going to be moving around a lot for a week or so, I'll definitely keep it in mind though man.

MadGuy
01-16-2015, 11:47 PM
-- Depositing
---- bankScreen.quickDeposit(): Clicked quick deposit id 0
-- isMouseOverText()
---- Current mouse-over text: "Withdraw-1 StetI1oscoF'e"
---- Found "Stet" in mouse-over string: "Withdraw-1 StetI1oscoF'e"
-- isMouseOverText(): True
---- bankscreen.withdraw(): result = true
-- Walking to safe
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 390 ms
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 406 ms
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 421 ms
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 405 ms
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 390 ms
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 406 ms
-- WARNING: sps.getPlayerPos(): Didn't find enough matches accurately calc your postion
-- sps.getPlayerPos(): result = {X = -1, Y = -1}, took 390 ms
-- sps.walkPath(): result = False


I don't know why but when he have full bag of gems then goes to bank, deposit them and then nothing happens just stand until i change camera angle to safes.(And script don't using map somehow, i tested healing in taverly but it's really buggy. From 10 tries 0 success.)

Any ideas? Thanks. (another scrips with maps and so on works fine, using same settings as recommended.)

Cyanempire
01-16-2015, 11:54 PM
Been running like a champ for 3 hours now. Still love you.

I'll get you something off the McDonald's dollar menu if you add a gem cutting feature. :3

Theres still mr.robotos version of this that does exactly what you want. but does not bank.

GRIM
01-17-2015, 04:45 AM
Grats on the re-release!
I'm looking into using this :D
what's xp/hr like for thiev?

Taric
01-17-2015, 05:28 AM
Grats on the re-release!
I'm looking into using this :D
what's xp/hr like for thiev?

I was getting about 30-45k per hour depending on how the anti-ban rolled. (With 75 thieving)

Ancrath
01-22-2015, 05:03 PM
Not too sure MadGuy. I'm assuming the map is in the correct folder? I just got back from a lot of travelling so I'll look into it.

Ancrath
01-24-2015, 09:33 AM
I've been running the script and couldn't replicate any errors other than not starting the script in front of the safes. I thought I had set it to catch that, but either something got through the cracks or I didn't do it. Like I said time is an issue for me and I don't remember every bit of the script in detail. I should have time tomorrow to look through things again and update any errors that I find. I'll keep you all updated to what I change.

Edit - I'll also look into making a proggy, but no promises. I never cared for them personally so long as the script is safe, reliable, and reliable against bans, but I understand the demand.

Ancrath
01-24-2015, 06:09 PM
Version 1.3 Failsafes and Proggy

Added in some more failsafes that should hopefully make the script more foolproof. This includes a lodestone teleport if it cannot find Emerald or a safe within 5 times of their respective attempts.

The proggy is fairly simple and requires that you have an XP tracker in your chat box. Sometimes the number returned isn't correct and this can cause weird output. The check for your xp upon startup works everytime for me however, so the proggy only is affected for one output. The variables continue to track your progress correctly so it will eventually give you an honest proggy.

If there is any problems with the new stuff on your end, please leave some feedback about what happened and I'll look into it.

ashley1
02-02-2015, 08:44 AM
how do you set up the healing feature as in where to put food or what?

falloutboy12
02-02-2015, 12:31 PM
This script is working great for me! Thanks for all the hard work you put into this! Healing is not done via food, when below 20 percent health, your player walks to nearby bank then back to the den.

Enigmatic
02-02-2015, 10:32 PM
Will post a nice proggy for you when I wake up, thanks for this.
I wonder if ring of wealth would affect this :c

Jayden C
02-02-2015, 11:20 PM
So this script makes decent thieving exp.. what kind of money does it make? :P

Ancrath
02-03-2015, 07:27 PM
Enigmatic, the ring of wealth does not effect the drop rates unfortunately. In my experience the Stethoscope does have an impact, whether that was personal luck or not I'm not sure. It effects success rates so that does inherently mean more gems.

Jayden C, I'll add in a proggy that addresses monetary gains hopefully soon. The gems you receive are extremely random so its hard to make a rough estimate. Just something that would be an average from an extended period.

Glad that you all enjoy it though and it's working as expected. Keep me posted with any new errors, hopefully no old ones still exist lol.

Pompus
02-04-2015, 02:23 AM
Holy jeez this worked a treat!!! The total XP was about 30k more than what the proggy actually says so xp p/h is better also.
Thanks a million.
-- XP : 100070
-- XPH : 10774.6546357287
-- Safes Cracked : 1429.57142857143
-- Safes Per Hour: 153.923637653267

ashley1
02-04-2015, 05:29 AM
can you make it so it doesnt lick on the same 3 pixels for the safe??

Cyanempire
02-04-2015, 05:36 AM
You can start opening these safes lvl 25 thieving.

The Mayor
02-04-2015, 07:42 AM
-- XP : 7420
-- XPH : 9530.37432193485
-- Safes Cracked : 106
-- Safes Per Hour: 136.148204599069


The safe cracking works sweet ;) but it has trouble finding the trapdoor on the way back and goes into a lodestone tele -> walk to trapdoor loop. It's most likely bad entrance colours.

E: Updated the colours and it works sweet. For a more reliable solution, you could find those coloured bottle things on the window and the offset to get the trapdoor.

EMMF
02-17-2015, 05:47 AM
Ran for 6 hours, still crackin them safes dawg. Nice script :)

Ancrath
02-21-2015, 09:07 PM
Little foreword, I took a longer break from even looking at this site let alone the code then I meant to. Just too easily distracted by life, got a lot going on the next few years actually so I do what I can when I actually remember to update things. Sorry for any inconveniences.

Pompous, glad to hear you enjoyed it and no problem.

ashley1, going to look into it now and see what I can do. Like the OP says, I originally made this a while ago and the colors worked then so I honestly didn't even mess with the color finding of the safes when I started working on this again. I'll try to make it more randomized so its safer.

Cyanempire, cool to know, I'll add that to the OP

The Mayor, that's a pretty good idea, I had to do that with exit of the den itself and didn't even think to try that with the entrance.

EMMF, glad to hear another person found it reliable even with current problems.

Ancrath
02-21-2015, 10:15 PM
New Update: Changed the entrance values to The Mayor's suggestion of using the vials next to the entrance as a reference point. I suspect this might be the most likely to cause problems for others, the color recognition is working brilliantly for me, so need feedback from others on it. For ashley1's suggestion of different pixels to choose on the safe, not sure why but the damn thing is pretty stubborn about clicking the middle of the safe. The colors that the script is searching for are the wooden beams of the safe but will still click near the middle. To slightly remedy this I added in different colors from the safe to choose from in a case statement and I've noticed very slight changes in where it clicks. Not the best solution, but it works.

If any of these changes mess the script up and you want it to work, the original color values are commented out in the beginning. Just read the comments I put above the commented out section for the changes that need to be made, thanks. That or just back up your current version.

I still need to implement the progress reports on gold per hour and gems that Jayden C asked for, this is something that I've never scripted before so will take some time. Haven't forgotten about it though.

Trollcrank
02-21-2015, 10:54 PM
Works great, no problems. I did, however, update the entrance colors before using it due to the Mayor mentioning it wasn't working. Also, I'm using a slightly older version but idc it works good.

Suggestions: Take out any standard waits and replace them with at least a little randomness. You could use DTM's for the progress report and update the progress report if banking succeeds.(glad you have forgotten that, as stated in the post above this). Maybe add a breaking system, not necessary though. It could also be updated to use the SRL form but I personally prefer not having it.

Ancrath
02-22-2015, 05:46 PM
Those are definitely some good ideas to add in, I'll keep them in mind.

The first version of the entrance color changes I uploaded started causing problems for me so I updated it to hopefully be more accurate. Anyone using this new version tell me if you run into any problems on your end.

Edit: Changed the mouse movement values to hopefully account for both of the vials the script searches for. Was going into an infinite loop if it used the bottom one exclusively.

Ancrath
02-27-2015, 07:35 AM
UPDATE: v1.5 Progress Report and Random Wait Overhaul

Progress Report -
I thought this update was going to be harder to pull off than it was because it uses code I've never touched in Simba before, mainly DTMs. The major part of the update is an overhaul of the progress reports in Simba's debug box. I added in an actual procedure named progressReport to trim down some fat in the code and also changed the reliability of the XP portion. Completely new to the progress report is total gold earned, gold per hour, and a count of each type of gem and a per hour count on each. The gem count is determined when your character goes to bank due to a full inventory. Before depositing your loot it does a DTM count in your backpack of each gem and then adds it to the progress report. Technically I can make it so every time a gem is received it checks which one it is and adds it to the progress, but I feel that would be too complex and inefficient in the end. The gold values are easily tracked using output in the chatbox to check how many gold coins were added to your inventory. If someone else is in the Rogue's Den chatting up a storm then it will be inaccurate, but for not its the best I can manage.

Random Waits -
As requested by Trollcrank, all calls to the wait procedure have been randomized. The wait margins are generally small to keep things moving along smoothly.

Extra - Changed the colors on the entrance yet again and the offset used to find the entrance. Hopefully it's 100% accurate now. Keep me updated with any problems.

As always, if you run into any problems or have suggestions tell me about them. I'll do what I can when I can to fix/adjust things.

Renzanity
03-28-2015, 04:43 PM
I'll be running this script overnight. I'll post the progress report as soon as I'll be able to. :D

Thanks for your efforts even though you got so much stuff to do irl. :norris:

EDIT: It's still having trouble finding the trapdoor. It would hover on the blue bottles on the windows, but when the cursor hovers over to the blue bottle at the left side of the shelf(left hand side of your character's view) it would move the mouse where the the trapdoor's not located, and then it'd use the loadstone to warp. After about 2-5 tries it does the trick and clicks on the trapdoor successfully. This might be a small factor of accounts being banned when using the script because this action is bot-like.

I perhaps suggest that you try using the red vial instead of the other bottles on the shelf to find the trapdoor, so it won't hover on multiple objects to find the trapdoor. :)
http://i.imgur.com/M0xbU3g.png

Overall though, this script's as awesome as Chuck:norris:.

EDIT 2: I've changed the color to find the trapdoor(used the red vial) and the playerpos myself and added a wait time after clicking the den exit(it tends to lag for a bit and ends up failing to load the SPS to walk to the bank), now it works perfectly! :D

EDIT 3: Another thing that I noticed about the trapdoor procedure. By using mouse(); it might be clicking the same pixel to access the trapdoor. I wonder if a mouseBox(); function could possibly be used as a replacement.
Another suggestion would be to use Camel's "Finding Objects Using Relative Objects and Filtering" (https://villavu.com/forum/showthread.php?t=110546).

Ancrath
03-30-2015, 09:52 PM
Update! v1.6 Gem Cutter

Took all of renzanity's suggestions to heart and have now, once again, changed how the script handles the trapdoor entrance. Biggest feature change is the addition of the script being able to cut the gems for you before banking thanks to code also supplied by renzanity. Thanks for all the support man!

I didn't do rigorous testing but individually tested all new features and didn't see any problems. If you run into any problems be sure to leave feedback and I'll get on it.

The setup of the gem feature is included in the OP, reference that for proper use.

Renzanity
03-31-2015, 02:48 AM
Proggy:
-- XP | XP Per Hour : 41668 | 16179.9759788977
-- Safes Cracked | Safes Per Hour : 595.257142857143 | 231.142513984252
-- Gold | Gold Per Hour : 6480 | 2516.23341602848
-- Sapphires | Sapphires Per Hour : 35 | 13.5907669075612
-- Emeralds | Emeralds Per Hour : 29 | 11.2609211519793
-- Rubies | Rubies Per Hour : 20 | 7.76615251860641

Things that I noticed after running the v1.6 script so far:
-The trapdoor procedure's now flawless! I've been running it for a good 2hrs+ now and I haven't touched it even once to enter the trapdoor manually.

New suggestions:
-Changing the failsafe built in for when the fail count reaches it's peak from using the lodestone to just adding wait(randomRange(1000, 2000)); To make the EXP/hr more efficient. And a normal person wouldn't use the lodestone like that, it seems like this is going to be a small ban-factor.
-Changing the path coordinates for when you're heading back from healing at the bank, it sometimes overshoots and you end up outside at the upper right part of the pub.
-How about removing the procedure where you'll need to run to the exit of the den then run to the Taverley bank to heal? And instead just use the lodestone teleport? (Lessens the amount of time to go to heal in the Taverley bank and adds more efficiency for the EXP/hr rate)
-Maybe adding an EXP count for the crafting part as well.(Not really highly required but some might want to know how much crafting EXP they're getting while running the script)

Great work on the trapdoor, that's exactly the remedy I did when I ran your script, haha. Thank you for your hardwork as always, man. :norris:
Keep up the good work!

P.S.
Lvl'ing my Thieving along with Crafting. Hahaha. :norris:

EDIT: New bug
-When the script fails to click the banker, it proceeds back to the safe with the backpack still filled with gems. The good part is that it goes back to looking for the banker after 1 safecracking.


repeat //Changed the begin..
if mayorObjectFinder(false, BankerHue, BankerSat, 8, 8, BankerCol, BankerTol, MOUSE_LEFT, ['ank', 'Emer', 'ald'], ['ank', 'Emer', 'ald']) then
if (bankScreen.isOpen(7000)) or (pinScreen.isOpen(7000)) then
found := true;
wait(randomRange(4000, 5000));
until bankScreen.isOpen(); //..end so that it will repeat this loop until the script successfully clicks the moving banker

toxjq
04-05-2015, 05:22 PM
it keeps tping out saying not found, when the crack is right in front, also when tps it cant find the trap door and keeps tping in a loop