SRL Archive - OSR Help

Need Help WIth Bot actually CLICKING


Xeronate

2013-03-02 03:03:45

Hi guys,

Current Questions: How to get the script to wait until a new ore appears in the inventory before clicking another rock and best method of walking.

I have tried using findobjcustom and am now using tpas and both have accurately found the object, but for some reason it won't click in either one! Can someone please explain to me what I'm doing wrong? Thanks SO much!


program new;
{$i SRL/SRL.simba}
{$i P07Include.simba} //Thanks Danny!

procedure Antiban;
begin
case random(200) of
1: P07_HoverSkill('fishing', RandomRange(1000, 2000));
2: P07_HoverSkill('random', RandomRange(500, 2000));
3: P07_MakeCompassDegree(RandomRange(97, 107));
4: P07_MakeCompassDegree(RandomRange(229, 286));
5: MMouse(random(400), random(300), 0, 0);
end;
end;

procedure MineRock;
var
RockTPA: TPointArray;
MyPoint: TPoint;
x, y, i, tmpCTS: integer;
begin
tmpCTS := GetToleranceSpeed; //Thanks for the tut Footy!

SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.03, 0.35);
FindColorsSpiralTolerance(P07_MSCX, P07_MSCY, RockTPA, 2437715, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 6); //Dusk's TPA tutorial
// if Length(RockTPA) = 0 then FindColorsSpiralTolerance(P07_MSCX, P07_MSCY, RockTPA, 2437715, P07_MSX1, P07_MSY1, P07_MSX2, P07_MSY2, 6); In case I need to add another color
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
for i :=0 to High(RockTPa) do
begin
MyPoint := RockTPA[i] //not exactly sure what this one does
MMouse(MyPoint.x, MyPoint.y, 5, 5);
if (P07_IsUpTextMultiCustom(['ine', 'roc'])) then
begin
ClickMouse2(1)
Wait(1000 + random(2000)); //how do I get it to just wait until the rock is mined?
Exit;
end;
Wait(500 + random(1000));
end;
end;




begin
SetupSRL;
SetupP07Include;
MineRock;
end.

Sjoe

2013-03-02 03:06:31

Don't setupsrl;

Xeronate

2013-03-02 03:10:08

From: Sjoekeloe
Don't setupsrl;


That actually worked. Can you please explain to me why I shouldn't setupSRL? I thought I had to do that every script? Don't I have t do that to use any of the SRL includes? Also, someone on irc told me to use "SRL_EnableNavBar;" and that worked too. Any description? Thanks!

DannyRS

2013-03-02 03:11:03

It's the ocr filter messing up my Include GetUpText (I think?), only happens for some users I think, I'm sorry but I'm not smart enough to change filter settings! Theres a fix coming from someone much smarter soon!

Edit - the NavBar thing is because of the Menu bar at the top of the official game, it offsets the screen co-ordinates by 50 pixels down, the oldschool game does not have this bar built into the game client, so it's no longer needed, but SetupSRL; still has it, will be fixed soon

Sjoe

2013-03-02 03:11:20

From: Xeronate
That actually worked. Can you please explain to me why I shouldn't setupSRL? I thought I had to do that every script? Don't I have t do that to use any of the SRL includes? Also, someone on irc told me to use "SRL_EnableNavBar;" and that worked too. Any description? Thanks!


I have no idea sorry lol

edit2: what danny said

DannyRS

2013-03-02 03:17:47

From: Sjoekeloe
I have no idea sorry lol

edit: setupsrl; contains functions to load smart and so on. Don't know exactly what.


I was under the impression Navbar was only called if using {Define Smart} (atleast when I had a look through SetupSRL), maybe I should try calling it in my Include regardless? I have no idea why mine doesn't cause any of this

Sjoe

2013-03-02 03:19:58

From: DannyRS
I was under the impression Navbar was only called if using {Define Smart} (atleast when I had a look through SetupSRL), maybe I should try calling it in my Include regardless? I have no idea why mine doesn't cause any of this


Seems this gets called SRL_ResetNavBar;
Is this the troublemaker?

Xeronate

2013-03-02 03:20:29

Thanks for the help so far! Now onto improvements. For banking do you guys suggest DTMs, radialwalk, or other?

DannyRS

2013-03-02 03:21:23

From: Sjoekeloe
Seems this gets called SRL_ResetNavBar;
Is this the troublemaker?


Yes thats a problem! Maybe it's not the OCR Filter after all!!

Edit - Banking I'd look into TPA, because the colors change so badly on the MM in 07, radialwalk is set to official rs atm I think?

Sjoe

2013-03-02 03:22:50

From: Xeronate
Thanks for the help so far! Now onto improvements. For banking do you guys suggest DTMs, radialwalk, or other?


if u mean walking: DDTM's, tpawalking, colorclicking, coordclicking. There is also an unofficial SPS: check Unofficial Development.

Xeronate

2013-03-02 03:23:42

Yeah I mean walking. So no radial walking? Darn that's what I started learning.

Sjoe

2013-03-02 03:25:17

From: Xeronate
Yeah I mean walking. So no radial walking? Darn that's what I started learning.


U gotta modify it I think. Since it uses MMx1 etc…
Shouldn't be hard though

Xeronate

2013-03-02 03:26:11

Well if I use P07_MMX1 it should be ok right? (that is in the include)

DannyRS

2013-03-02 03:28:54

From: Xeronate
Well if I use P07_MMX1 it should be ok right? (that is in the include)


Should be, Idk how it works fully though, worth a shot maybe

Xeronate

2013-03-02 03:30:17

From: DannyRS
Should be, Idk how it works fully though, worth a shot maybe


Well I'm using them in the colorfinder I posted and it seems to be searching pretty well. Off to making this banking function! Even though that means I have to pick a specific spot to mine.

Sjoe

2013-03-02 03:30:27

From: Xeronate
Well if I use P07_MMX1 it should be ok right? (that is in the include)


yosh

Xeronate

2013-03-02 03:43:46

Ok, now how about getting the script to wait just until a rock has been mined? Do people usually do that with pixelshift or pbox?

Sjoe

2013-03-02 03:49:47

U could use pixelshift detection so u know your char Is Mining. That's up to you.

 
ClickMouse(1)
InvNow := P07_Invcount + 1;
TimeFromMark(JustInCase)
repeat
Wait(500)
Antiban; // Make one of your own, dont wanna get banned :p
until((P07Invcount = InvNow) or (TimeFromMark(JustInCase) > (10000));
The Time Marking is a failsafe so it doesn't get in an infinite loop.

I don't know if P07_InvCount exists lol. I don't play 07

Xeronate

2013-03-02 03:54:28

From: Sjoekeloe
U could use pixelshift detection so u know your char Is Mining. That's up to you.

 
ClickMouse(1)
InvNow := P07_Invcount + 1;
TimeFromMark(JustInCase)
repeat
Wait(500)
Antiban; // Make one of your own, dont wanna get banned :p
until((P07Invcount = InvNow) or (TimeFromMark(JustInCase) > (10000));
The Time Marking is a failsafe so it doesn't get in an infinite loop.

I don't know if P07_InvCount exists lol. I don't play 07


It does, but I think the accuracy of all the inventory functions are a bit questionable haha

and



procedure Antiban;
begin
case random(200) of
1: P07_HoverSkill('fishing', RandomRange(1000, 2000));
2: P07_HoverSkill('random', RandomRange(500, 2000));
3: P07_MakeCompassDegree(RandomRange(97, 107));
4: P07_MakeCompassDegree(RandomRange(229, 286));
5: MMouse(random(400), random(300), 0, 0);
end;
end;

zomg at DDTMS: http://villavu.com/forum/showthread.php?t=10008

DannyRS

2013-03-02 03:58:04

The accuracy of my inv functions should be fine ;) (didn't spend as much time as I should have, but working none the less) maybe the navbar was messing that up too?

Xeronate

2013-03-02 04:00:34

Could very well be. I'm not trying to slander your include by any means. It is very useful! It will probably take me a while to figure out how to walk though so won't be testing your inventory methods for a while.

DannyRS

2013-03-02 04:02:48

From: Xeronate
Could very well be. I'm not trying to slander your include by any means. It is very useful! It will probably take me a while to figure out how to walk though so won't be testing your inventory methods for a while.


Haha don't worry, people bashing things helps the creators improve them (it actually is a great help) ;) I'm glad I've been able to somewhat give us a quick rough Jump start into 07 scripting :)

Let me know how your results turn out with walking, I'm interested to find a good solid method myself

Sjoe

2013-03-02 04:05:23

From: DannyRS
Haha don't worry, people bashing things helps the creators improve them ;) I'm glad I've been able to somewhat give us a quick rough Jump start into 07 scripting :)

Let me know how your results turn out with walking, I'm interested to find a good solid method myself


xtrapsp says DDTM works very well