SRL Archive - OSR Help

Basic Scripting help :P


Rezozo

2012-10-31 01:58:21

Here I will probably post all my basic questions I can't find the answer to myself :P

First one!

How do you let your script know your tree has been cut? I mean I know MSI had something for this, like MSI_IsChopping, but is there a way other than this?

I checked out the animating one, can anyone explain how to actually use this? Where does the 'Box' come from, do we define it?

I suck…

P1ng

2012-10-31 02:08:46

I don't really like to do animation for wcing because with the larger trees often you will be hidden behind the tree.

Perhaps try a TPA length check. Like if there is still a certain amount of leaves colour on your screen then the tree is still there. Then you can do an inv/exp check to make sure you are still cutting it…

Le Jingle

2012-10-31 02:10:00

I'd either check the relative area where you found the coords to start chopping at or count the colors based off of player position and angle and camera height (or both). The first suggestion would probably be easiest as you could do mouse antiban while you have a true IsChopping pixelshift, then return to the relative area your mouse started/clicked at and check the uptext.

There's many many ways to create your own alternative methods of doing what you asked, as there are also many combinations of ways of checking.

Hope this gives some idea,
Cheers,
Lj!

Rezozo

2012-10-31 02:10:17

I guess, but what about the other leaves? Is there a way to limit its check?
I don't even know what a TPointArray is :)
@LJ, I like the one where you wait/anti ban and come back. It does make sense!

Are there any other ways though? How does the Animation function work?

riwu

2012-10-31 02:20:44

Flight has a tutorial on AveragePixelShift (http://villavu.com/forum/showthread.php?t=74090), i personally prefer just PixelShift though.

You can limit the search region.
If the tree leaves behind some kind of stump you can check for that too.

Ashaman88

2012-10-31 07:22:37

Check out my arctic pine script for an example of one way!

Rezozo

2012-10-31 08:19:14

I love you guys, seriously! I do!
Haven't scripted in a while, and to me, this is all advanced! Used to use just FindObj for everything! (Don't hate :))

Second question! How would one click items in the chat box? Like If I have to cook, or Bonfire something etc?

Le Jingle

2012-10-31 10:17:54

From: Rezozo
I love you guys, seriously! I do!
Haven't scripted in a while, and to me, this is all advanced! Used to use just FindObj for everything! (Don't hate :))

Second question! How would one click items in the chat box? Like If I have to cook, or Bonfire something etc?


There's always a static box, ex. Mousebox(xs,ys,xe,ye,mouse_left); but you can always add more! I suppose I may want to add that I made a similar snippet to the snippet section related to this.

Cheers,
Lj

Ashaman88

2012-10-31 10:58:29

From: Rezozo
I love you guys, seriously! I do!
Haven't scripted in a while, and to me, this is all advanced! Used to use just FindObj for everything! (Don't hate :))

Second question! How would one click items in the chat box? Like If I have to cook, or Bonfire something etc?


Check out my bonfire and rogues den cooker for examples of that :)

Rezozo

2012-10-31 15:12:12

Lol, refer too all scripts, I see :) Ill check it out!

……….You have soooo manny scripttssss BTW!

P1ng

2012-10-31 20:29:47

You can use FindText or FindDTM with the MCx and MCy co-ordinates. Or alternatively use a static box. I like to use a function to tell me when the menu has appeared (like GetColor[green background]) before I begin the search for the text/DTM

Swifte

2012-10-31 20:43:18

Good luck with your script. Did you check out the scripting guides provided? Didn't work for me but they might for you!
Scripting tutorials- http://villavu.com/forum/forumdisplay.php?f=191

Rezozo

2012-10-31 20:56:47

Lol, swifte thanks :) Love how ppl are refering me to the TuT's, brings back memories :)

I did, in fact go through a number of them. Its just my slow mind that has the problem. I am slow in understanding many of the concepts, as Im used to the more text based pascal, not the mix of color and screen positions(those im OK with, used Gotoxy's etc:) )

Your suggestion was good P1NG, but I think even that would be slightly redundant right? Since I already know when the box/color will appear, I think the static box would be better, anyway to make it choose a random point within that? I feel like my current one doesn't do that:
MouseBox(279, 430, 320, 450, mouse_left);{Changed the co-ordinates to make it actually fit click the thingy, otherwise it never clicked :P}

For now, my next question is Anti-Ban. What looks the most human like? I know the basics, like BoredHuman, RandomAngle and others. But what makes most sense? Should I keep a randomized number, which sets on a case, that controls like 10 different things, then call on that at random times? Is that too much?

riwu

2012-10-31 21:11:05

It does do that, just that there is a higher tendency to choose those near the center due to the gauss mouse algorithm that dictates a normally distributed clicking region.

Rezozo

2012-10-31 21:21:25

Yea, but I clearly define an area, the box, and it always clicks a couple pixels out of the box. So im forced to make the area smaller.

Also, in both boxes, set areas, they keep clicking the same pixel respectively! IDK why…

___

2012-10-31 21:41:39

I always did a bunch of failsafes like checking to see if there is a stump close to your character or if the time has exceeded the walktonexttree time limit. I have a LOT of failsafes so my script is real stable. I'll release a dampened version when I hit 99.

Rezozo

2012-10-31 22:18:11

Lol, funny thing is, I already have 99 WC in all accounts :P
Thats the reason Im making one! This is a perfect way to start scripting again!

Right now it works relatively well, 2h so far, I just need Anti ban, think you guys could answer the previous Q?


For now, my next question is Anti-Ban. What looks the most human like? I know the basics, like BoredHuman, RandomAngle and others. But what makes most sense? Should I keep a randomized number, which sets on a case, that controls like 10 different things, then call on that at random times? Is that too much?

riwu

2012-10-31 22:43:35

You need to minus 50 off the y-coordinates that you retrieve from btm left of simba/color picker. You can check the antiban.simba include for some ideas, up to your personal judgement on the amount of antiban that is appropriate. Usually i'd calculate it to be on average about a few times per hour but it all depends on the nature of the script.

P1ng

2012-10-31 22:46:59

Depends if it's a skill you're likely to AFK or if you actually need to sit there and concentrate. I also find alot of the different anti-bans are more appropriate for some skills than others. Like if I were to be picking flax I probably wouldn't examine my inventory because I know the only thing in there is flax, and so on.

Rezozo

2012-10-31 22:47:08

That makes sense! Danke P1ng and Riwu!
Now that I (kinda) got that settled, I need to perfect its smoothness and make a Proggy!

Since this is WoodCutting, it would normally make sense to do more AntiBan, but its regular logs. So probably don't need to keep too heavy of an Anti-Ban right?

radiclerobby

2012-11-02 03:40:59

I didn't read any of the comments so if this is already solved im sorry, but i would do it like this.

function tree:boolean;
var
tpa: TPointArrayl;
ATPA: Array of TPointArray;
x, y:integer;

begin
tpa:= findcolorsTolerance << fill out info
atpa := splitTPA(tpa, 4);
for i := 0 to high(atpa) do
begin
if( length(atpa[i]) >= (pixel amount you think will be))then
begin
checkuptext with functions to check its tree, then record cords in a global variable then check that to see if it goes away randomly.
end;
end;
end;


note stanards might be off and a couple functions undone, don't want to spoonfeed but that's basicly what i would do and would work if you can butcher that and use it go for it would be better if you worked with colortolerancespeed it would be alot more accurate. any other questions feel free to message me.

riwu

2012-11-02 04:19:14

From: radiclerobby
I didn't read any of the comments so if this is already solved im sorry, but i would do it like this.

function tree:boolean;
var
tpa: TPointArrayl;
ATPA: Array of TPointArray;
x, y:integer;

begin
tpa:= findcolorsTolerance << fill out info
atpa := splitTPA(tpa, 4);
for i := 0 to high(atpa) do
begin
if( length(atpa[i]) >= (pixel amount you think will be))then
begin
checkuptext with functions to check its tree, then record cords in a global variable then check that to see if it goes away randomly.
end;
end;
end;


note stanards might be off and a couple functions undone, don't want to spoonfeed but that's basicly what i would do and would work if you can butcher that and use it go for it would be better if you worked with colortolerancespeed it would be alot more accurate. any other questions feel free to message me.

The result of findcolors is a boolean, tpa variable should be in the param. Also try use wrappers, and you need middle/mediantpa as well. Avoid using global variable when possible, in this case you could possibly pass it as var param or just execute clicks within the routine ;)

Rezozo

2012-11-02 10:30:39

Hmm, as of now, I just use AveragePixelShift, checking if it is over 400 in the player area. That seems to work properly :P

Any suggestions for a good anti-ban when woodcutting?