SRL Archive - OSR Help

Faster notInFight. Searching for monsters off main screen.


Zota

2012-03-30 20:15:36

Title says it mostly.. This is more of a discussion really..

Which methods are best for making a much quicker not InFight detector?

Why hasn't it already been made into an SRL function? it seems fundamental to a good solid autofighter.

With just color and mathematics though, I can see it being quite complicated.. You'd need to know where the target monster is, where it should be after attacking and moving to it, where the hp bar of it should be and where it isnt (Not mistaking other players monsters for its own)

I should have paid attention in maths!



This is more of a question:
How would you go about searching for monsters not on mainscreen? There's one monster spot that has quite a wide spawn area. How would you get the bot to search elsewhere without wandering off too far?

The spawn area is probably 2x or maybe even 3x the size of the minimap
There are only about 4 of the monsters.

My idea would be to define a box with SPS points, then make it (if it cant find a monster on screen) click in the direction of a yellow dot on the minimap. Making sure it is clicking within the boundaries of said predefined box.

Problems I can see:
There are other monsters around other than the desired ones. so I can see it going to them over and over again. Not very efficient..

Clicking to a yellow dot and arriving - but the monster has already moved on. (You'd need it to keep clicking(track) the dot till it reached it within a distance so it has time to detect and click it on mainscreen.

No idea how to do that though without hurting my brain :norris:
Too hard for me to code I think :garfield:

Cheers,
Luke

BobboHobbo

2012-03-30 20:23:01

The SRL InFight function is slow? from memory doesnt it just look for the Health bar? If it does, its not really possible to make it faster as simba finds colours on the screen in miliseconds.

And for finding monsters off screen, that should be pretty easy to click the yellow on on the MM. Just make a DTM then search for it in the MMCX1 + 5, MMCY1+ 5,MMCX2 - 5,MMY2 - 5 (I think thats the constant for centre of MM) to make a box around your player on the minimap. Have your thing set on run. When Flag has disapeared, recheck for the DTM if theres no monsters in the boundary click again. If in boundary Mainscreen call the monster check func. If return false repeat.

Then use a relocating function. ta da !

Zota

2012-03-30 20:32:29

From: BobboHobbo
The SRL InFight function is slow? from memory doesnt it just look for the Health bar? If it does, its not really possible to make it faster as simba finds colours on the screen in miliseconds.

And for finding monsters off screen, that should be pretty easy to click the yellow on on the MM. Just make a DTM then search for it in the MMCX1 + 5, MMCY1+ 5,MMCX2 - 5,MMY2 - 5 (I think thats the constant for centre of MM) to make a box around your player on the minimap. Have your thing set on run. When Flag has disapeared, recheck for the DTM if theres no monsters in the boundary click again. If in boundary Mainscreen call the monster check func. If return false repeat.

Then use a relocating function. ta da !


1. I meant creating a new function. InFight2. That uses pixelshift or something to have near instant monster switching. The current InFight looks for players HPbar. which disappears long after the monster is dead. (othersinfight is broken). Even so hpbar methods are still quite slow compared to checking player/monster animation somehow.

2. but like I said. the area the monsters spawn in is about 3 times the size of the minimap. (3 minimaps worth of surface area). So you couldn't create a box on the minimap. It'd need to be done with SPS I presume. I could do that quite easily. But I wouldn't know how to make it flow very well. (Click yellow dot till monster is on screen and clicked while checking that we're not going out of bounds)

Cheers
Luke

mormonman

2012-03-30 20:50:05

Look at my script "Roached"

Zota

2012-03-31 10:29:05

Cheers Mormonman. I looked at your script. That main loop is HUGE.

Luke

mormonman

2012-03-31 22:37:52

From: Zota
Cheers Mormonman. I looked at your script. That main loop is HUGE.

Luke


That's how I do. You're Welcome.