SRL Archive - OSR Help

IsMoving?


ogustuce

2012-03-19 19:18:29

how can i make the script wait while the account character is moving? i mean not walking, i mean moving like swinging a pick or chopping. Whats the code for this? if theres one


thanks

ogustuce

2012-03-19 19:19:56

i think that the 'IsMoving' code is only for wait while walk?

masterBB

2012-03-19 19:21:02

You could try pixelshift. But that is the hardest part of many bots.

shstiger2009

2012-03-19 19:23:04

From: masterBB
You could try pixelshift. But that is the hardest part of many bots.


Yep.

To me and probably many others, this is the hardest part of combat scripts. Hard to have the script "wait" or pause while your character is chopping, fighting, etc.

Kyle Undefined

2012-03-19 19:23:57

SRL has the Animating() method which should suffice here, or how masterBB said, pixelshift.

I believe Flight has an awesome tut on it.

ogustuce

2012-03-19 19:24:27

is there a tutorial for pixelshift? if yes, can u link me plz? thanks

masterBB

2012-03-19 19:25:30

http://villavu.com/forum/showthread.php?t=74090

Nebula

2012-03-19 19:25:47

http://villavu.com/forum/showthread.php?t=74090

-.-

Er1k

2012-03-20 03:46:58

From: shstiger2009
Yep.

To me and probably many others, this is the hardest part of combat scripts. Hard to have the script "wait" or pause while your character is chopping, fighting, etc.



I think for diff equip and clothing the pixelshift for a character can differ quite a bit. It is sometimes annoying to set up

Kyle Undefined

2012-03-20 07:53:44

Shields add extra pixelshift and is very annoying to work around.

masterBB

2012-03-20 07:57:48

Better not train for 120 dungeonering. Animating capes are very hard to get around.

Jagex_Fagex

2012-03-20 08:13:37

I use pixelshift >650 in my script for the mining, i have never had an issue with it, and i have been mining in multiple outfits. Check out Flight's tut, that's where i got it from.

masterBB

2012-03-20 08:18:07

From: Jagex_Fagex
I use pixelshift >650 in my script for the mining, i have never had an issue with it, and i have been mining in multiple outfits. Check out Flight's tut, that's where i got it from.


650 doesn't says a lot if you don't add the time over which it happened.

Jagex_Fagex

2012-03-20 08:39:01

From: masterBB
650 doesn't says a lot if you don't add the time over which it happened.


This is my function to see if i am mining or not:


Function Mining: Boolean;
var
PBox: TBox;
begin
if(not LoggedIn)then
Exit;
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 650);
if(Result = False)then
begin
Debug('We are not mining');
end else
Debug('We are Mining');
end;

Er1k

2012-03-20 10:15:28

From: Kyle Undefined
Shields add extra pixelshift and is very annoying to work around.


Yeah and if you wield something like a whip you will feel the pain soon enough lol

Nemesis3X

2012-03-20 11:01:43

From: Er1k
Yeah and if you wield something like a whip you will feel the pain soon enough lol


Ya, that what I discover when I was making my Ectofuntus Script. I had to add 2 different value depending on if people were wearing armor or not since the animation was way higher with gear on.

Main

2012-03-20 11:04:59


While Flag do
Println( "We are moving");

LookForBank;

Flag should take care of it:)

m34tcode

2012-03-20 11:05:49

PixelShift itself is a weak function IMO.

Been thinking about rewriting it to watch for the background pixels, and how many do not change within a given amount of time

that way instead of comparing two images and returning the number of pixels that changed, i will slowly rule out the pixels that change, until left only with pixels that do not change.

As far as I know, it would be much more accurate and reliable

Wyn

2012-03-20 11:59:53

From: masterBB
Better not train for 120 dungeonering. Animating capes are very hard to get around.


It works fine with my 120 cape…

Er1k

2012-03-21 04:33:57

From: Nemesis3X
Ya, that what I discover when I was making my Ectofuntus Script. I had to add 2 different value depending on if people were wearing armor or not since the animation was way higher with gear on.


Why do you need that for ectofuntus?

Anyway I think you can do a sampling of the pixshift in the idle state and use that as a benchmark to see whether you are really moving. If the distribution is nice the success rate can be somewhat high, but the sampling will take time

WT-Fakawi

2012-03-21 14:01:19

repeat FindNormalRandoms until not ismoving;
something like that?