SRL Archive - RS3 Script Requests

Combat Script for Dagon'hai Monks


Ophanim

2014-03-23 02:13:53

Hi there.

As I'm sure many of you are aware, Dagon'hai Monks offer a very high experience gain with little penalty. Unfortunately, I personally found it difficult to create a script extension to bonsaiFighter (created by bonsai). The reason being is because ACA has a hard time detecting the color difference of the NPC's robes and background. Which means one must apparently mess about with the pixels of the NPC, blah blah; I have no idea what it means, nor do I have the capability to do it.

However, I am inquiring – for anyone who is able to – to create their own, or add to bonsai's script which allows people to combat-bot on Dagon'hai Monks in the rift just outside Edgeville. Not only would it make me your personal sex slave, but I'm sure everyone would be benefited by such a script.

I realize I'm not really in the place to be asking for script requests, being that I only have 3 posts (at the time of posting this), but I'm beggin' ye!

Thanks.

E: This is, of course, assuming that bonsai is okay with people doing that to his creation. If he isn't, then I guess it's not too much of an option. Sorry about that bonsai!

E-2: Or hey, I wouldn't mind some tutorials on how to do it myself. I'm always open to learn.

Turpinator

2014-03-23 02:48:11

Post some pics for those of us who are too lazy to go there and check them out. ;) (for attempting to create settings for bonsai's fighter that is)

Ophanim

2014-03-23 11:19:09

Sure thing.

Ophanim

2014-03-23 11:20:12

From: Turpinator
Post some pics for those of us who are too lazy to go there and check them out. ;) (for attempting to create settings for bonsai's fighter that is)




Pics will be posted below in a second.

—


Is this alright?

Made this on low quality settings, just because that's what the Simba set-up tutorial said I had to play in.

E: More pics


Clarity

2014-03-23 13:38:44

Looking at those pictures, the most unique colors seem to be red and gold, although the gold might be confused with the lava. There are a number of functions that can be used to detect colors filtered based on surrounding colors. I'll expand on this post when I get to a computer :)

Ophanim

2014-03-23 13:52:38

From: Turpinator
Post some pics for those of us who are too lazy to go there and check them out. ;) (for attempting to create settings for bonsai's fighter that is)


From: Clarity
Looking at those pictures, the most unique colors seem to be red and gold, although the gold might be confused with the lava. There are a number of functions that can be used to detect colors filtered based on surrounding colors. I'll expand on this post when I get to a computer :)


Yeah, that's a problem I had. I tried using skin, red and gold to identify them… but the mouse kept going haywire all over the place.

Is it possible to do this with high quality graphics? I notice the colors are a bit more compartmentalized as graphics quality increases.

E: Thanks for replying, by the way. I appreciate it.

Clarity

2014-03-23 14:33:44

I'm not familiar with how bonsai's fighter goes about detecting NPCs based on colors (will look at it later) but red seems to work fine for general detection, marked in green.
To tell for sure I would need a picture of the monks in their environment (entire mainscreen shot).


You could use high detail but I believe that could potentially break include functions (?), and make a lot of things more complicated for you, even if it does simplify this one task.

Neva Banned

2014-03-23 14:47:45

Does the warriors bother u as they have similar color schemes if I remember correctly.

Turpinator

2014-03-23 16:40:01

From: Ophanim
Pics will be posted below in a second.

—


While pictures of the monks are great, i was more looking for pictures of the entire area to see if there were any specific 'overlap' in colors between monks and their surroundings.
I believe in bonsai's fighter, the settings allow for min/max length (or amt of clustered colors) of the TPAs, so that would be able to filter out large lava spots as well as small 'random' spots.

Ophanim

2014-03-23 16:44:23

From: Clarity
I'm not familiar with how bonsai's fighter goes about detecting NPCs based on colors (will look at it later) but red seems to work fine for general detection, marked in green.
To tell for sure I would need a picture of the monks in their environment (entire mainscreen shot).


From: Turpinator
While pictures of the monks are great, i was more looking for pictures of the entire area to see if there were any specific 'overlap' in colors between monks and their surroundings.
I believe in bonsai's fighter, the settings allow for min/max length (or amt of clustered colors) of the TPAs, so that would be able to filter out large lava spots as well as small 'random' spots.


Sorry about that. I'll try to get some immediately. Is it okay if I use low-graphics but full screen? I'll just take a picture of both (low-graphics small screen/big screen)

—

Okay, here are three screenshots. Unfortunately, they're a bit sloppy. I can retake them if they're not good enough. It was kind of difficult to get a clean snapshot, what with all the NPCs attacking me.


Looks like red might not work either.

bonsai

2014-03-23 17:01:15

This is a quick stab, there may be room for improvement.

I took your pic and used ACA on the reddish color. Then I made an entry for SIMBADIR/includes/bonsai/libnpcUser.xml and played with it. I used the test program from post 2 in the bonsaifighter thread to try it out.

Once you get to this point you just play with dist/minPixels/maxPixels until it start boxing things as best you can. You want as few boxes as possible (one per npc would be nice) but you don't want the boxing to start bleeding from one object to another. You also don't want boxes including dead space where it would be unproductive to move the mouse.

In other words, it's better to have smaller boxes that are definitely the NPC than big ones that cover more than the NPC.

I also looked at the yellow and tried dual-color. That lava will be a problem.

BTW, your pics are not from the overhead view. The script will automatically do that for you, so if you want to run with an angle like you captured, you'll need to comment out mainscreen.setangle(MS_ANGLE_HIGH); in doPlayerLogin().

Sample output:

Sample xml entry (xp rates are not correct, check uptext):

<npclist>
<npc>
<name>Monktest</name>
<xp>24.9</xp>
<constXp>8.2</constXp>
<color1>1515588</color1>
<tolerance1>7</tolerance1>
<hue1>0.37</hue1>
<sat1>3.21</sat1>
<color2>-1</color2>
<tolerance2>0</tolerance2>
<hue2>0.0</hue2>
<sat2>0.0</sat2>
<dist>10</dist>
<inclDist>10</inclDist>
<minPixels>5</minPixels>
<maxPixels>200</maxPixels>
<maxFightSeconds>60</maxFightSeconds>
<uptext>onk</uptext>
</npc>
</npclist>

Ophanim

2014-03-23 17:03:36

From: bonsai
This is a quick stab, there may be room for improvement.

I took your pic and used ACA on the reddish color. Then I made an entry for SIMBADIR/includes/bonsai/libnpcUser.xml and played with it. I used the test program from post 2 in the bonsaifighter thread to try it out.

Once you get to this point you just play with dist/minPixels/maxPixels until it start boxing things as best you can. You want as few boxes as possible (one per npc would be nice) but you don't want the boxing to start bleeding from one object to another. You also don't want boxes including dead space where it would be unproductive to move the mouse.

In other words, it's better to have smaller boxes that are definitely the NPC than big ones that cover more than the NPC.

I also looked at the yellow and tried dual-color. That lava will be a problem.

BTW, your pics are not from the overhead view. The script will automatically do that for you, so if you want to run with an angle like you captured, you'll need to comment out mainscreen.setangle(MS_ANGLE_HIGH); in doPlayerLogin().

Sample output:

Sample xml entry (xp rates are not correct, check uptext):

<npclist>
<npc>
<name>Monktest</name>
<xp>24.9</xp>
<constXp>8.2</constXp>
<color1>1515588</color1>
<tolerance1>7</tolerance1>
<hue1>0.37</hue1>
<sat1>3.21</sat1>
<color2>-1</color2>
<tolerance2>0</tolerance2>
<hue2>0.0</hue2>
<sat2>0.0</sat2>
<dist>10</dist>
<inclDist>10</inclDist>
<minPixels>5</minPixels>
<maxPixels>200</maxPixels>
<maxFightSeconds>60</maxFightSeconds>
<uptext>onk</uptext>
</npc>
</npclist>


Alright, thanks for the help. I'll try to test it out and retake some overhead pictures.

***** autoDetect checking for Dagon'hai Monk
TObjFind.choose: found 11 possible objects
TObjFind.choose: mouse moved to object 0
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 1
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 2
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 3
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 4
TObjFind.choose: examining mouseText=Take Chaos rune
TObjFind.choose: mouse moved to object 5
TObjFind.choose: examining mouseText=Take Chaos rune
TObjFind.choose: mouse moved to object 6
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 7
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 8
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 9
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 10
TObjFind.choose: examining mouseText=
****** Auto detected NPC:
****** Could not set up NPC [autodetect]. Verify name is in XML file.
***** Loop ended, terminating
****** bonsaiFighter: Script shutting down
////////////////////////////////////////////////////////////////////////////////////////////////////
////////// ( )\ ) ) ) //////////
////////// ( )\ ) ( (()/( ( ( ( ( /( ( /( ( ( //////////
////////// )((_) ( ( ( ( /( )\ /(_)) )\ )\))( )\()) )\()) ))\ )( //////////
////////// ((_)_ )\ )\ ) )\ )(_))((_) (_))_|((_)((_))\ ((_)\ (_))/ /((_)(()\ //////////
////////// | _ ) ((_) _(_/( ((_)((_)_ (_) | |_ (_) (()(_)| |(_)| |_ (_)) ((_) //////////
////////// | _ \/ _ \| ' \))(_-</ _` | | | | __| | |/ _` | | ' \ | _|/ -_) | '_| //////////
////////// |___/\___/|_||_| /__/\__,_| |_| |_| |_|\__, | |_||_| \__|\___| |_| //////////
////////// |___/ //////////
////////// //////////
////////// Script runtime: //////////
////////// 43 sec(Total) 43 sec(Active) 0 sec(Break) //////////
////////// //////////
////////////////////////////////////////////////////////////////////////////////////////////////////
Successfully executed.

That's what occurs. I tried playing with the pixels, but it still seems to go haywire.

Another issue might be because I need to right click then select the attack option, due to their higher level.

Ophanim

2014-03-23 17:28:01

Sorry you guys. I seriously appreciate all of the help, it means a lot. I've got to go for a bit, but I'll be back in a few hours.

bonsai

2014-03-24 08:49:51

From: Ophanim

***** autoDetect checking for Dagon'hai Monk
TObjFind.choose: found 11 possible objects
TObjFind.choose: mouse moved to object 0
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 1
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 2
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 3
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 4
TObjFind.choose: examining mouseText=Take Chaos rune
TObjFind.choose: mouse moved to object 5
TObjFind.choose: examining mouseText=Take Chaos rune
TObjFind.choose: mouse moved to object 6
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 7
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 8
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 9
TObjFind.choose: examining mouseText=
TObjFind.choose: mouse moved to object 10
TObjFind.choose: examining mouseText=
****** Auto detected NPC:
****** Could not set up NPC [autodetect]. Verify name is in XML file.


Another issue might be because I need to right click then select the attack option, due to their higher level.


It looks like it found them but you are getting no mouse over text. There's a mouse over option in the RS graphic settings, perhaps you have this disabled? Do you have 'always show target information' enabled (it needs to be)?

When doing them manually, are you seeing any mouse text when you hover on them? I think even with the combat difference issue you would see something like 'examine npc' instead of 'attack npc'.

I recommend you change the npc name in bonsaiFighter.xml (or at the top of the script) from autodetect to your NPC name. That way it won't cycle through trying things that are not there. autodetect works but it can be pretty messy running the mouse all over the screen looking for things.

Re: screen shots… I would gather them from a simba login instead of a browser (with different settings). The simba screen is smaller than what you posted. Gathering your test data from any other setup leaves you with the chance that it's not displaying the same as it will be during usage.

KeepBotting

2014-03-24 22:18:01

OP can add me on Skype if he needs one-on-one help.