SRL Archive - MSI Archives

Tutorial for mining script


Hamish

2010-07-16 05:31:29

Hey I was wondering if anyone that has a spare 5 minutes could do a tutorial for the mining script. It would be great appreciated, I am having a few problems getting it to run without error and i'm not sure what i'm doing wrong. It doesn't seem to be able to find my pickaxe, do I have to set the "current script" option to something else? when it can't find my tool

: ****: Entering Func: MSI_SetupPlayer: Failed to find required tool

Iv'e noticed I get a lot of failed to load item errors just after the script has compiled, it manages to log in but maybe these errors are related?



Thanks in advance.

Sir R. M8gic1an

2010-07-16 09:23:49

post your RunMe.scar, so we can see if you are doing anything wrong ;)

~RM

NCDS

2010-07-16 12:26:37

What Pickaxe were you using?

I noticed it failed to identify an Adamant pick yesterday, I was going to mess with the Colors/tol when I test later.

Hamish

2010-07-16 17:02:17

Yeah I was using an adamant pickaxe, I guess that will be the problem

Coh3n

2010-07-16 17:28:06

From: Hamish
Hey I was wondering if anyone that has a spare 5 minutes could do a tutorial for the mining script. It would be great appreciated, I am having a few problems getting it to run without error and i'm not sure what i'm doing wrong. It doesn't seem to be able to find my pickaxe, do I have to set the "current script" option to something else? when it can't find my tool

: ****: Entering Func: MSI_SetupPlayer: Failed to find required tool

Iv'e noticed I get a lot of failed to load item errors just after the script has compiled, it manages to log in but maybe these errors are related?



Thanks in advance.

The loading items error is because those items don't exist yet. ;)

When I was testing the mining script, it was finding my iron pickaxes, so the DTM points itself are fine. What pickaxe are you trying to use? Maybe the colour is outdated.

Hamish

2010-07-16 20:18:08

Adamant pickaxe NCDS was getting this problem too.

Coh3n

2010-07-16 21:16:22

From: Hamish
Adamant pickaxe NCDS was getting this problem too.

Most likely the colour is outdated. Open up ItemInfo.scar and go to the procedure MSI_GetDTMColor. Replace the colour for an addy pick with one you pick yourself. See if that works.

Hamish

2010-07-16 21:18:30

Ok i'll try that and report back.

To save starting another thread could you point me in the right direction for adding my own locations for the scripts? I noticed the reflection patch making recorder but how would I implement the results that I recorded into the script?

Thanks.

Coh3n

2010-07-16 21:26:16

From: Hamish
Ok i'll try that and report back.

To save starting another thread could you point me in the right direction for adding my own locations for the scripts? I noticed the reflection patch making recorder but how would I implement the results that I recorded into the script?

Thanks.

If you're talking about adding a new script, then you have to make a TScript record (see Scripts.scar for examples). I'm glad you asked this question actually. I will add a section on how to make a TScript record in this guide (hopefully later tonight).

Just out of curiosity, what script do you want to add?

Hamish

2010-07-16 21:31:21

Ok changed adamant pickaxe colour to "10204059" in iteminfo and it finds the pickaxe now and starts to mine although it seems to right click a lot and then not do anything after it right clicks and leaves the menu up. When it does left click it doesn't seem to wait all of the time for the rock to be empty and will click another rock, sometimes multiple times when the mining is already in progress.

I noticed that the 2 yew trees on the south of falador east bank had nobody at them and thought they would be a good candidate for another location. If they are empty then the player could probably empty a tree on his own but would then have to run over to the other tree, which is very close. I'm not sure if the script has a walking function to go to nearby tree's but I imagine it wouldn't be too complicated to add. Although I may be entirely wrong here.

Anything else you want tested give me a shout. =)

Coh3n

2010-07-16 21:36:06

From: Hamish
Ok changed adamant pickaxe colour to "10204059" in iteminfo and it finds the pickaxe now and starts to mine although it seems to right click a lot and then not do anything after it right clicks and leaves the menu up. When it does left click it doesn't seem to wait all of the time for the rock to be empty and will click another rock, sometimes multiple times when the mining is already in progress.

I noticed that the 2 yew trees on the south of falador east bank had nobody at them and thought they would be a good candidate for another location. If they are empty then the player could probably empty a tree on his own but would then have to run over to the other tree, which is very close. I'm not sure if the script has a walking function to go to nearby tree's but I imagine it wouldn't be too complicated to add. Although I may be entirely wrong here.

Anything else you want tested give me a shout. =)

Yeah, the WaitWhileMining function is a little buggy right now. Also, it shouldn't right click that much anymore. Do you have the latest revision? And the reason it doesn't choose an option is because for some reason ChooseOption in SRL doesn't recognize 'ine', which is weird. Anyway, the WaitWhileMining is being worked on and we should have a much better version within the next few days.

About the woodcutting… The "walking" in a the script you're referring too will all the added in the relocator once it gets implemented. :)

Sir R. M8gic1an

2010-07-17 00:13:48

humm, a dtm color going outdated was the problem?

I suggest blacklist + color finder. Which reminds me to properly look through Nielsie's code.

~RM

Coh3n

2010-07-17 00:35:41

From: Rasta Magician
humm, a dtm color going outdated was the problem?

I suggest blacklist + color finder. Which reminds me to properly look through Nielsie's code.

~RM

How would that change the problem though? Using a colour checker means it would have still gone out of date…

Sir R. M8gic1an

2010-07-17 08:47:55

From: Coh3n
How would that change the problem though? Using a colour checker means it would have still gone out of date…


Tolerance + CTS. Since it's a small area, within a blacklist, tolerance can be much higher. For an addy pick it can be any variation of green.

-RM

Coh3n

2010-07-17 09:00:53

From: Rasta Magician
Tolerance + CTS. Since it's a small area, within a blacklist, tolerance can be much higher. For an addy pick it can be any variation of green.

-RM

The DTM_TOLERANCE constant is the tolerance on the DTM colour is it not? There's a tolerance of 0 on all the black outline points.

Sir R. M8gic1an

2010-07-17 09:34:15

From: Coh3n
The DTM_TOLERANCE constant is the tolerance on the DTM colour is it not? There's a tolerance of 0 on all the black outline points.


I personally always had trouble with DTMs. They seemed to go out of date very quickly, especially the main point. That's why since RM AK Smelter I started using just the DTM for the outline (or a blacklist) and then color for the inside.

In theory, I'd agree with you. From personal experience I'd disagree.

Also, the one (small) advantage is that by doing this you can use CTS 2 ;)

-RM

Coh3n

2010-07-17 10:10:34

From: Rasta Magician
I personally always had trouble with DTMs. They seemed to go out of date very quickly, especially the main point. That's why since RM AK Smelter I started using just the DTM for the outline (or a blacklist) and then color for the inside.

In theory, I'd agree with you. From personal experience I'd disagree.

Also, the one (small) advantage is that by doing this you can use CTS 2 ;)

-RM

The only reason I was on the fence about blacklists was because of the bank issue, otherwise I probably would have wrote something up by now. I couldn't really make much sense out of nielsie's code, so maybe you can. :o

E: I've updated the addy pickaxe colour, so it should work now. Thanks :)