PDA

View Full Version : Earth Crafter [Color+Ref]



Tlachtli
02-06-2011, 07:32 PM
My second attempt at script writing. I needed a good Earth Rune crafting script, so I decided to make it myself. Let me know what you think.

Features:

Crafts runes at the Earth Altar outside of East Varrock
Reliable, runs for multiple hours at a time
Color + Reflection
Antiban and Antirandom (user's choice of Reflection or Color antirandoms)
Rests at Musician
Multiple paths to and from altar


Setup:

Have an Earth tiara or Earth talisman staff equipped
Rune Essence should be visible on your bank screen
Start inside the Varrock East Bank.


To-Do:

Earth RC Glove support (as in, when the current ones break it will retrieve another pair from the bank)
Talisman in inventory support (maybe--I mean, who uses talismans anymore anyways?)
Multiplayer (currently only set up to do one player)
Heavier use of Color (currently relies on Reflection for a lot)
Willing to take suggestions


Best Progress Report:
------------------------------------
-- Earth Runecrafter --- by dd409 --
------------------------------------
Player:
Running for 2 Hours, 17 Minutes and 49 Seconds
Essence to craft: 3080
Essence crafted: 1820
Runes crafted: 4340
Randoms encountered: 0
------------------------------------


Changelog:


2/6/11 - Released
2/7/11 - Added forced auto-logout when it can't find a color
2/13/11 - Increased reliability of finding altars, portals, and essence (thanks Yakri); progress report reflects my forum name change

doublex8
02-07-2011, 12:27 AM
thanks, I got 12k essence I can use for this, I'll get back to you with a proggy

Tlachtli
02-08-2011, 03:06 AM
thanks, I got 12k essence I can use for this, I'll get back to you with a proggy

Great! I've been running it off and on since yesterday, seems like it has about a 1.5 hr life span before missing a color somewhere and logging out. As long as you check on it from time to time, should work fine.

I plan to fix any color finding problems this weekend (currently looking at 2 exams this week), so if you guys find any let me know; also, I've added in forced logouts before terminating the script whenever it can't find something. that way it won't just sit there until it auto-logs.

wietzuh
02-08-2011, 08:07 PM
The script really works like a charm! Unbelievable! The rest function at the musician is excellent.

After tree hours, the script didn't recognise the altar anymore. I suppose it is the color recognision problem. After closing SMART and restarting it, it worked again. Beside that, no problems here.

An RC glove option would indeed be great. An other suggetion: I would like to see a 'crafted essence per hour' output in the logs. That's useful for calculating how much time it takes to reach my target. And a 'gained experience' output in the log would also be useful.

Thank you very much for your great script!
Wietzuh

Harry
02-08-2011, 08:26 PM
If you really want to rely on color for your script but have reflection, you should use reflection as a backup if/when the color fails. Can't download to look at code right now, but good luck with it! :D

Tlachtli
02-08-2011, 09:41 PM
The script really works like a charm! Unbelievable! The rest function at the musician is excellent.

After tree hours, the script didn't recognise the altar anymore. I suppose it is the color recognision problem. After closing SMART and restarting it, it worked again. Beside that, no problems here.

An RC glove option would indeed be great. An other suggetion: I would like to see a 'crafted essence per hour' output in the logs. That's useful for calculating how much time it takes to reach my target. And a 'gained experience' output in the log would also be useful.

Thank you very much for your great script!
Wietzuh

Glad you like it! Three hours is longer than I've gotten it to run, nice. The progress report it something I just put in last-minute (read: copied from my unfisnished DHWC script) after I realized it didn't have one. Once I add multiplayer I'll tidy up the report a bit and add in stuff like xp/profit per hour and exp/leveling and such.


If you really want to rely on color for your script but have reflection, you should use reflection as a backup if/when the color fails. Can't download to look at code right now, but good luck with it! :D

I may need to tinker with the tolerances a bit for the colors, they could just be too strict. Jagex had to be all crafty and make everything inside the Earth altar similarly colored. Reflection walking works fine inside the altar, but TileToMS derps out on me :huh: meaning that a Reflection backup while inside the altar will be hard.

(When I tried to use Reflection's tile finding tool inside the altar I got an out of bounds error, so I'd assume the problems are related. Walking works fine with tile coords found with RSBot though).

When I Color-ize the outside parts though, I will definitely keep the Reflection in as a backup, thanks for the suggestion.

Bad Boy JH
02-09-2011, 03:52 AM
The retrival of another pair of gloves is pointless, last i checked (which was a while ago, it may have changed) you can only have one pair of any runecrafting gloves.

Tlachtli
02-09-2011, 04:29 AM
The retrival of another pair of gloves is pointless, last i checked (which was a while ago, it may have changed) you can only have one pair of any runecrafting gloves.

Really? I was under the impression that the RC gloves worked like the rings of forging/recoil, ect. in that the charge data isn't specific to the gloves themselves; whatever pair the player was wearing when the 1000th rune was crafted would crumble, then the count is reset to 0. If that's the case, I don't see why you wouldn't be allowed to have multiple pairs.

I'll have to look into this.

grats
02-09-2011, 06:45 AM
------------------------------------
-- Earth Runecrafter --- by dd409 --
------------------------------------
Player: *
Running for 6 Minutes and 38 Seconds
Essence to craft: 1000
Essence crafted: 56
Runes crafted: 133
Randoms encountered: 0
------------------------------------

nice so far!

will be going all the way to 1k if it doesn't mess up =]


add stats!

when it's walking make it click the next position faster so it's more human like.. a good example of the human like walking would be "KARAMJA Reborn " by 3Garrett3

he does a great job walking very human like.








failed at the alter, standing right next to it:
'Could not find inner altar.'
was right next to it lol, possibly add more checking for it



Running for 22 Minutes and 58 Seconds
Essence to craft: 1000
Essence crafted: 196
Runes crafted: 454

muffinheadstatus
02-09-2011, 08:36 PM
No More essence to be found. Guess we got them all.
Successfully executed.
The following DTMs were not freed: [2]

i got that, even though i had the bank slot only with essence in it and nothing else.

Tlachtli
02-09-2011, 10:27 PM
No More essence to be found. Guess we got them all.
Successfully executed.
The following DTMs were not freed: [2]

i got that, even though i had the bank slot only with essence in it and nothing else.

If it times out opening the bank or something, it assumes that there are no essence and will terminate. I'll fix this and add better essence detection this weekend.

muffinheadstatus
02-10-2011, 02:08 AM
thank you very much, i thought i was doing something wrong,haha.

Yakri
02-10-2011, 02:49 AM
Hey, pretty cool script overall.

You said that you thought you might need lower(higher number, right?) color tolerance for it continue working over a long period of time?

Have you considered using a variable for the amount of color tolerance, and have it increase the tolerance by +1 for every attempt to detect loop?

like this.
//This function uses the inner altar to craft runes, then leaves.
//Returns the number of runes crafted.
procedure CraftRunes;
var
x, y, Tries, Tolerance: Integer;

begin
If (not(LoggedIn)) then
Exit;
PerformChecks(false);
WalkToTile(Tile(2657+Random(2), 4839), 0, 0);
wait(800+random(100));
Tries := 0;
Tolerance := 4;
repeat
Tries := Tries + 1;
Tolerance := Tolerance + 1;
if (Tries >= 25) then
begin
writeln('Could not find inner altar.');
writeln('Terminating script...');
LogOut;
TerminateScript;
end;
until (FindColorTolerance(x, y, 6314846, 200, 50, 375, 150, Tolerance));
Wait(130+random(60));
Mouse(x, y, 4, 4, true);
wait(250+random(200));
repeat
PerformChecks(false);
wait(65);
until (not(CharacterAnimating));
wait(300+random(100));
WalkToTile(Tile(2656, 4829), 0, 0);
wait(300+random(200));
Tries := 0;
Tolerance := 4;
repeat
Tries := Tries + 1;
if (Tries >= 25) then
begin
writeln('Could not find portal.');
writeln('Terminating script...');
LogOut;
TerminateScript;
end;
until (FindColorTolerance(x, y, 3698064, 225, 190, 275, 220, Tolerance));
Mouse(x, y, 2, 2, true);
wait(450+random(200));
end;

Also, increasing the wait times quite a bit solved most of the banking problems for me. It makes the script a few seconds slower each trip, but it works. :P


Edit: Right now the script consistently click collect instead of quick withdraw when opening the bank. I think it's a problem with SRL or Reflection though, whatever that R_openbankbooth command is under.

Tlachtli
02-10-2011, 03:48 AM
Have you considered using a variable for the amount of color tolerance, and have it increase the tolerance by +1 for every attempt to detect loop?

like this.
//This function uses the inner altar to craft runes, then leaves.
//Returns the number of runes crafted.
procedure CraftRunes;
var
x, y, Tries, Tolerance: Integer;

begin
If (not(LoggedIn)) then
Exit;
PerformChecks(false);
WalkToTile(Tile(2657+Random(2), 4839), 0, 0);
wait(800+random(100));
Tries := 0;
Tolerance := 4;
repeat
Tries := Tries + 1;
Tolerance := Tolerance + 1;
if (Tries >= 25) then
begin
writeln('Could not find inner altar.');
writeln('Terminating script...');
LogOut;
TerminateScript;
end;
until (FindColorTolerance(x, y, 6314846, 200, 50, 375, 150, Tolerance));
Wait(130+random(60));
Mouse(x, y, 4, 4, true);
wait(250+random(200));
repeat
PerformChecks(false);
wait(65);
until (not(CharacterAnimating));
wait(300+random(100));
WalkToTile(Tile(2656, 4829), 0, 0);
wait(300+random(200));
Tries := 0;
Tolerance := 4;
repeat
Tries := Tries + 1;
if (Tries >= 25) then
begin
writeln('Could not find portal.');
writeln('Terminating script...');
LogOut;
TerminateScript;
end;
until (FindColorTolerance(x, y, 3698064, 225, 190, 275, 220, Tolerance));
Mouse(x, y, 2, 2, true);
wait(450+random(200));
end;

Also, increasing the wait times quite a bit solved most of the banking problems for me. It makes the script a few seconds slower each trip, but it works. :P

Tolerance variable, excellent idea. Why didn't I think of that? Also, I had figured that adding in extra wait time would fix a lot of the problems, so I'll do that as well.

I just had two exams this week and a lab report to to write up until today, so you'll have to forgive me for not making all of these changes right away. I should be good to resume work on this tomorrow, and I'll try to have another update out shortly.

Yakri
02-10-2011, 05:33 AM
Haha, I know how you feel. I've got loads of college work myself right now. ^_^

Yakri
02-11-2011, 04:46 AM
-- Earth Runecrafter --- by dd409 --
------------------------------------
Player: perf
Running for 2 Hours, 49 Minutes and 29 Seconds
Essence to craft: 11000
Essence crafted: 2100
Runes crafted: 5122
Randoms encountered: 0
------------------------------------


It probably woulda kept going a lot longer too, but MSI auto updated and interrupted it. :x

I attached the version of the script that I'm using. It's got longer wait times (mostly random, they could probably be optimized a lot), and it's got the variable tolerance.

Just in case you're interested. :P

Great script btw.

Tlachtli
02-13-2011, 12:17 AM
Since this is my personal blog and all...

Yesterday my laptop's internal hard drive decided it wanted to become physically damaged and render everything on it unrecoverable. I have a new HDD and my system works ok now, but I lost a lot of stuff that was on that drive (thankfully everything college-related was saved onto an external). It might be another day or two before I pick this up, since I need to get everything reloaded onto my computer, plus write a paper by Tuesday for one of my classes.

But anyways, I did take a look at some of the changes you made Yakri, and I'm thinking I'll keep them in for the next update with your permission. You'll be credited appropriately, of course.

Tlachtli
02-13-2011, 06:30 PM
New update is up. Changed the timings a little bit, added Yakri's variable tolerances. Should be much more reliable now.

Yakri
02-13-2011, 11:55 PM
Hey, I just tested the script, and I found a problem with the tolerances I wrote, it actually caused the tolerance to increase too quickly and the script would often either miss-click on some rocks, or on the ground near the portal. I re-wrote it to only increase after 8 tries, so that it only uses higher tolerance if it really can't find anything within tolerance 5. Too bad you have to use an integer for tolerance, it'd much easier to scale up if you could increase it by 0.1 or something.


What do you think about adding a method to the script that checks to see if the player still has rune essence in his inventory before starting the part that leaves the alter? One of the things I found happened when the script mis-clicked, was that you'd walk back to the bank with a full load of rune ess. I think having a check, to make sure that the rune ess has been converted, along with re-doing the part of the script that converts the runes could help a lot with reliability.

Having the script try to exit the portal multiple times, in the sense of having it restart the section that walks the player to the portal and tries to exit it more than once, would probably go a long way towards having a flawless script too. Probably only make it run that part 2-3 times, but there are times where it fails to find the portal while it's right next to it, or lagged and didn't walk to quite the perfect spot, etc.

Oh, and what I mean by this, is currently you have, Tries, right? But Tries only retries to find the color, and if it finds any color within tolerance, it clicks it and moves on. If the wrong thing gets clicked, the script breaks, so having that entire section of the method (maybe separate craftrunes into more than one method?) repeat would help with that. 'Course, in some cases, like with crafting the runes, you'll need to have a check to see if the script worked or not before trying to repeat.


PS. I hope I don't seem to be butting in on your script creation or anything, I'm just leveling a character's runecrafting atm, and earth runes aren't dirt cheap right now. :P

The attached script should work fine for now.

Tlachtli
02-14-2011, 12:16 AM
I was actually thinking about how fast the tolerance increases, but didn't really have time to mess with the script much today. I'm still not too familiar with Pascal, does it have a modular division function? If so, it would be pretty easy to have it raise the tolerance by 1 every 4th or 5th try.

I do plan to break up craftrunes into multiple procedures, probably for the next update; the current setup was for something I ended up not really implementing because I found an easier way to do it. Generally adding more failsafes and reworking the Tries system is on the to-do as well.

And I'm actually glad you're "butting in" on the script creation. It's only my second script (and only the first one that's actually been usable :P ), so I need all the help I can get for it.

Yakri
02-14-2011, 03:23 AM
Unfortunately modifying your script was the first time I'd ever done any programming in Pascal, I've only got real previous experience with Java.

Sounds like this script will be looking pretty impressive after a few updates! ^_^

I'm happy you don't mind, I like helping out. :P