SRL Archive - OSR Help

Scripting my own Iron Miner 07


Twinki

2013-02-24 02:47:26

First, yes I know theres a powerminer already released, but I want to script my own, for practice.

I've been watching YoHo's vids, but i've ran into the FindObjCustom part, and i'm not sure if I should use Danny's 07 Include P07_FindObj or FindObjCustom. I looked at P07_FindObj but it doesn't make any sense to me… My question is, do I use P07_FindObj or FindObjCustom for mining Iron Ore in 07.

If P07_FindObj then please explain what the parameters should be, and why I should use it. And if you could provide an example, I learn allot from examples :P

Sjoe

2013-02-24 02:51:53

P07_FindObj then, u got the include I guess?

Parameters:
try typing the function on the function list (left side of simba) and then double click it.
or by typing it when scripting and then CTRL + LEFTCLICK.
That shows the parameters u need :)

The difference of the two functions are the uptexts. Since the uptext (font) in 07 is different than now.

Twinki

2013-02-24 02:53:31

From: Sjoekeloe
P07_FindObj then, u got the include I guess?

Parameters:
try typing the function on the function list (left side of simba) and then double click it.
or by typing it when scripting and then CTRL + LEFTCLICK.
That shows the parameters u need :)

The difference of the two functions are the uptexts. Since the uptext (font) in 07 is different than now.
So one does not work on the other.


I thought it'd be something like that… My script would mess up when it tried to right click a rock. Does P07_FindObj move the mouse to the object?
Also should I use ACA for the color? (Probably an obvious question..)

Sjoe

2013-02-24 02:55:37

From: Twinki
I thought it'd be something like that… My script would mess up when it tried to right click a rock. Does P07_FindObj move the mouse to the object?


It should do exactly the same as the FindObj on RS2.
I don't know if the include is buggy or not.

Twinki

2013-02-24 03:04:03

From: Sjoekeloe
It should do exactly the same as the FindObj on RS2.
I don't know if the include is buggy or not.


Should I use ACA with P07_FindObj?

and should I put "Rocks" in with the uptext?

I also seem to be getting Cannot find Object..

Sjoe

2013-02-24 03:50:27

From: Twinki
Should I use ACA with P07_FindObj?

and should I put "Rocks" in with the uptext?

I also seem to be getting Cannot find Object..


yeah ACA is the best tool for colorpicking tool !! Of course use it.
Watch Yohojo's video on how to maximize the potential of ACA.

Maybe uptext buggy (I don't know if the include is properly made)
Try using visible words and 3 letters ex: 'Roc', 'ock'

Twinki

2013-02-24 04:04:27

From: Sjoekeloe
yeah ACA is the best tool for colorpicking tool !! Of course use it.
Watch Yohojo's video on how to maximize the potential of ACA.

Maybe uptext buggy (I don't know if the include is properly made)
Try using visible words and 3 letters ex: 'Roc', 'ock'


Well P07_FindObj doesn't move the mouse, it only looks for the object.
This is a noob question but how do I make it move the mouse to the object and store the info into variables:duh:

Sjoe

2013-02-24 04:17:31


procedure example;
var // local variables
x, y:integer;

begin
if P07_FindObj(x,y, dont know the other parameters) then // now the stuff we found is stored in x, y
begin
Writeln('Hooray found it') // just a debug line to see if we found the object
MMouse(x,y, rx, ry) // moves mouse to the x, y coords. rx and ry and the random off-coords.
Clickmouse2(mouse_left) // mouse_right for right of course
end else Writeln(' Did not find it') // something went wrong with our color or maybe uptext

Twinki

2013-02-24 04:20:13

From: Sjoekeloe

procedure example;
var // local variables
x, y:integer;

begin
if P07_FindObj(x,y, dont know the other parameters) then // now the stuff we found is stored in x, y
begin
Writeln('Hooray found it') // just a debug line to see if we found the object
MMouse(x,y, rx, ry) // moves mouse to the x, y coords. rx and ry and the random off-coords.
Clickmouse2(mouse_left) // mouse_right for right of course
end else Writeln(' Did not find it') // something went wrong with our color or maybe uptext


Tried that but I get an error when compiling

Invalid number of parameters at line 139
Compiling failed.

If P07_FindObj(x, y, RockColor, 10, 15, ['Mi', 'Min', 'Mine'], 3) then

Sjoe

2013-02-24 04:32:28

From: Twinki
Tried that but I get an error when compiling

Invalid number of parameters at line 139
Compiling failed.

If P07_FindObj(x, y, RockColor, 10, 15, ['Mi', 'Min', 'Mine'], 3) then


Ok let me take a look in that include.

EDIT:
function P07_FindObj(color, tol, count : integer; uptext : TStringArray; action : integer): Boolean;

The function clicks normally :)

If it doesn't work use findcolortolerance and combined with P07_IsUpTextMultiCustom(Text: TStringArray): Boolean;

U got the include from http://villavu.com/forum/showthread.php?t=96863 right?
to be sure.

And just check the include out, what u can use etc.. ;)

Twinki

2013-02-24 04:49:30

From: Sjoekeloe
Ok let me take a look in that include.

EDIT:
function P07_FindObj(color, tol, count : integer; uptext : TStringArray; action : integer): Boolean;

The function clicks normally :)

If it doesn't work use findcolortolerance and combined with P07_IsUpTextMultiCustom(Text: TStringArray): Boolean;

U got the include from http://villavu.com/forum/showthread.php?t=96863 right?
to be sure.

And just check the include out, what u can use etc.. ;)


Mine doesn't click or move the mouse, it justs finds the object….


Riiiiiggghhht…..
Lets see if I can figure out where to put those.. :duh:

and mine doesn't click or move the mouse, it justs finds the object

and yes.

DannyRS

2013-02-24 05:04:28

From: Twinki
Riiiiiggghhht…..
Lets see if I can figure out where to put those.. :duh:

and yes.


I would look into making your own object finder ^^ using something written by someone else for that is a bad idea, because objects are always different, and need to be sorted correctly based on what they are, size and etc, read some tutorials ;)

Twinki

2013-02-24 05:29:22

From: DannyRS
I would look into making your own object finder ^^ using something written by someone else for that is a bad idea, because objects are always different, and need to be sorted correctly based on what they are, size and etc, read some tutorials ;)


Well I think I got it to where it would move the mouse over and click correctly ETC… The only problem i'm having now is that when i start it, it'll hover over the objects but then it just stops, doesn't click or anything. It basically doesn't do anything after the 'then'
Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= InvCount +1;
x:=MSCX;
y:=MSCY;
If FindObjCustom(x, y, ['Min', 'Mine'], [RockColor], 5) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: Mouse(x, y, 0, 1, True);
1:Begin
Mouse(x, y, 0, 1, False);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)


End;
End

It doesn't write 'Found Iron Rock'

DannyRS

2013-02-24 05:30:41

I'm guessing this is for 07scape? That function is for main RS and wont work there

Twinki

2013-02-24 05:33:09

From: DannyRS
I'm guessing this is for 07scape? That function is for main RS and wont work there


I had it working earlier.. it'd click the rock and everything.The FindObj works, but then it all messed up and it wouldn't click the Mine option when right clicked.. Will P07_ChooseOptionMulti(['Mine']); work for the option?

and yes it is.

DannyRS

2013-02-24 05:38:07

From: Twinki
I had it working earlier.. it'd click the rock and everything.The FindObj works, but then it all messed up and it wouldn't click the Mine option when right clicked.. Will P07_ChooseOptionMulti(['Mine']); work for the option?

and yes it is.


That should work for the right click yes, its because the Uptext is completely different in normal RS compared to 07

Twinki

2013-02-24 05:51:38

From: DannyRS
That should work for the right click yes, its because the Uptext is completely different in normal RS compared to 07

The script still stops right after it hovers over the objects :c
It doesn't write "Found Iron Rock", like it doesn't do then.

DannyRS

2013-02-24 06:18:28

From: Twinki
The script still stops right after it hovers over the objects :c
It doesn't write "Found Iron Rock", like it doesn't do then.


Like I said before, findobj, wont work in 07, you'll have to learn how to do it yourself ;),

ClickMouse2(mouse_right);

Will make the script right click

Twinki

2013-02-24 13:47:48

From: DannyRS
Like I said before, findobj, wont work in 07, you'll have to learn how to do it yourself ;),

ClickMouse2(mouse_right);

Will make the script right click


I see that you updated your includes and added FindObjCustom(Thank you BTW :)), I changed it to that and now the script just starts and stops.. doesn't do anything. But when I change the client just too Simba it starts…

shebee

2013-02-24 14:02:51

From: Twinki
I see that you updated your includes and added FindObjCustom(Thank you BTW :)), I changed it to that and now the script just starts and stops.. doesn't do anything. But when I change the client just too Simba it starts…


http://docs.villavu.com/srl-5/srlref.html
http://docs.villavu.com/simba/referencescript.html#scriptref

These 2 links have been very, very helpful for me when learning.
You should get an idea for most things, the documentation is pretty bad but it helps.

Also always take a look at the includes themselves.

Twinki

2013-02-24 14:12:19

From: shebee
http://docs.villavu.com/srl-5/srlref.html
http://docs.villavu.com/simba/referencescript.html#scriptref

These 2 links have been very, very helpful for me when learning.
You should get an idea for most things, the documentation is pretty bad but it helps.

Also always take a look at the includes themselves.


Thanks for the advice :)


EDIT: Its doing the same thing as before… It doesn't say it can't find the color, it doesn't do the 'then'. If that makes sense. It just stops after it finds the object.
Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
x:=MSCX;
y:=MSCY;
If P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock'], [RockColor], 5) Then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: Mouse(x, y, 0, 1, True);
1: Begin
Mouse(x, y, 0, 1, False);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;

Sjoe

2013-02-24 15:33:46

From: Twinki
Thanks for the advice :)


EDIT: Its doing the same thing as before… It doesn't say it can't find the color, it doesn't do the 'then'. If that makes sense. It just stops after it finds the object.
Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
x:=MSCX;
y:=MSCY;
If P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock'], [RockColor], 5) Then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: Mouse(x, y, 0, 1, True);
1: Begin
Mouse(x, y, 0, 1, False);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;


See if the uptexts works.
Press play, hover mouse above the rock check debug.


begin // mainloop
Wait(3000)
Writeln(P07_GetUpText) // I think this is the right name?
end.

Check if your debug actually gets the uptext .

Twinki

2013-02-24 15:40:55

From: Sjoekeloe
See if the uptexts works.
Press play, hover mouse above the rock check debug.


begin // mainloop
Wait(3000)
Writeln(P07_GetUpText) // I think this is the right name?
end.

Check if your debug actually gets the uptext .


It does get the UpText perfectly.

Sjoe

2013-02-24 15:49:41

From: Twinki
It does get the UpText perfectly.


Maybe your rockcolor then ? Up the tolerance a bit with +2 at a time.
Or get new colors.

and remove x := MSCX , y := MSCY .
That's fault coding.

DannyRS

2013-02-24 15:50:17

From: Twinki
It does get the UpText perfectly.


I double checked everything and it works fine for me, try a larger object, it may be a flaw with the speed of the include on smaller objects, I will attempt to rememdy on next update,

use ClickMouse2(mouse_left); not that older way

Twinki

2013-02-24 16:13:37

From: DannyRS
I double checked everything and it works fine for me, try a larger object, it may be a flaw with the speed of the include on smaller objects, I will attempt to rememdy on next update,

use ClickMouse2(mouse_left); not that older way


Well now it moves the mouse to the top left of the screen, but then stops. Hopefully I setup ClickMouse2 right…

Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
if P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock', 'Mine Rocks'], [1449522, 2108746], 100) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: ClickMouse2(False);
1: Begin
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks', 'Mine Rocks']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;

Sjoe

2013-02-24 16:23:15

From: Twinki
Well now it moves the mouse to the top left of the screen, but then stops. Hopefully I setup ClickMouse2 right…

Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
if P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock', 'Mine Rocks'], [1449522, 2108746], 100) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: ClickMouse2(False);
1: Begin
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks', 'Mine Rocks']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;


I said up the tolerance by +2 not 100 lol. Use ACA again. Did u see yohojo's video on how to use ACA?

and it's MMouse (x,y, rx, ry) followed by clickmouse2(false)


I seriously advise u to read/see these tutorials before posting here again.

First vid: http://villavu.com/forum/showthread.php?t=67691
Second vid: http://villavu.com/forum/showthread.php?t=69179

Usage of ACA tutorial : http://villavu.com/forum/showthread.php?t=71074

Knowing basic of simba: http://villavu.com/forum/showthread.php?t=58935 (Highly recommended)

This will put you on the right track to become a great scripter :)

Twinki

2013-02-24 16:44:47

From: Sjoekeloe
I said up the tolerance by +2 not 100 lol. Use ACA again. Did u see yohojo's video on how to use ACA?

and it's MMouse (x,y, rx, ry) followed by clickmouse2(false)


I seriously advise u to read/see these tutorials before posting here again.

First vid: http://villavu.com/forum/showthread.php?t=67691
Second vid: http://villavu.com/forum/showthread.php?t=69179

Usage of ACA tutorial : http://villavu.com/forum/showthread.php?t=71074

Knowing basic of simba: http://villavu.com/forum/showthread.php?t=58935 (Highly recommended)

This will put you on the right track to become a great scripter :)


I kinda got mad on the tolerance and just put some high number to see if it'd do anything. Hopefully I got the MMouse correct. Now it doesn't do anything at all, but still finds the object.
I made a whole new colour with ACA, and I learn best from examples. The Documentation doesn't have any examples of MMouse. I get confused on where to put it ETC.. and examples usually teach me where to put it, and what to put in for the parameters.

But i'll re-read Coh3n's tutorial :)

Heres the full script:

program IronMinerV2;

{$I SRL/SRL.Simba}
{$I P07Include.Simba}
{$i sps/sps.simba}



Const
NumbOfPlayers= 1; //How many players are you using
StartPlayer= 0; //Player to start auoting with! (0 means first char)
Version= '1.00'; //Version


{*******************************************************************************
procedure DeclarePlayers;
By: SRL
Description: SRL's Player Setup
*******************************************************************************}
procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;
end;

end;
{*******************************************************************************
Procedure Antiban;
By: YoHoJo/SRL
Description: Multiple antiban procedures from SRL
*******************************************************************************}
Procedure Antiban;
Begin
Case Random(192) Of
0: P07_HoverSkill('Mining',RandomRange(2500,3500));
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: P07_HoverSkill('random',RandomRange(2500,3500));
End;
End;
function RockColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.99);

FindColorsSpiralTolerance(MSCX, MSCY, arP, 1384248, MSX1, MSY1, MSX2, MSY2, 9);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 0.59) and (X <= 5.12) and (Y >= 0.51) and (Y <= 4.37) and (Z >= 0.28) and (Z <= 2.42) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
if P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock', 'Mine Rocks'], [RockColor], 10) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: Begin
MMouse(x, y, 0, 0);
ClickMouse2(False);
end;
1: Begin
MMouse(x, y, 0, 0);
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks', 'Mine Rocks']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;




begin
SetupSRL;
MineIron;
end.

Twinki

2013-02-24 22:05:32

From: Sjoekeloe
I said up the tolerance by +2 not 100 lol. Use ACA again. Did u see yohojo's video on how to use ACA?

and it's MMouse (x,y, rx, ry) followed by clickmouse2(false)


I seriously advise u to read/see these tutorials before posting here again.

First vid: http://villavu.com/forum/showthread.php?t=67691
Second vid: http://villavu.com/forum/showthread.php?t=69179

Usage of ACA tutorial : http://villavu.com/forum/showthread.php?t=71074

Knowing basic of simba: http://villavu.com/forum/showthread.php?t=58935 (Highly recommended)

This will put you on the right track to become a great scripter :)


Still having problems :(

Sjoe

2013-02-25 02:07:37

From: Twinki
Still having problems :(


Post em?

Twinki

2013-02-25 04:04:09

From: Sjoekeloe
Post em?

I'm still having the same problem as before< the mouse doesn't move but it finds the object.

Sjoe

2013-02-25 04:11:42

From: Twinki
I'm still having the same problem as before< the mouse doesn't move but it finds the object.


U used MMouse I hope?

if FindObj then
begin
MMouse
Clickmouse2
end;

ClickMouse2 doesn't move the mouse ;)

Twinki

2013-02-25 04:15:56

From: Sjoekeloe
U used MMouse I hope?

if FindObj then
begin
MMouse
Clickmouse2
end;

ClickMouse2 doesn't move the mouse ;)
I did:
Function MineIron:Boolean;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
if P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock', 'Mine Rocks'], [RockColor], 10) then
Begin
WriteLn('Found Iron Rock');

Case Random (2) Of
0: Begin
MMouse(x, y, 0, 0);
ClickMouse2(False);
end;
1: Begin
MMouse(x, y, 0, 0);
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks', 'Mine Rocks']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;

Maybe its my case…? But it still doesn't Write "Found Iron Rock"

Sjoe

2013-02-25 04:28:45

Try the normal
P07_FindObj(color, tol, count : integer; uptext : TStringArray; action : integer): Boolean;
Instead of custom.

or
if findcolortolerance() then
begin
if P07_IsUptext() (or smthing :p ) then
begin
MMouse etc…
end;
end;

The Mayor

2013-02-25 04:31:39

You are a great helper Sjoekeloe :)

Twinki

2013-02-25 04:31:46

From: Sjoekeloe
Try the normal
P07_FindObj(color, tol, count : integer; uptext : TStringArray; action : integer): Boolean;
Instead of custom.

or
if findcolortolerance() then
begin
if P07_IsUptext() (or smthing :p ) then
begin
MMouse etc…
end;
end;


I've tried changing the function to a procedure, changed the FindObjCustom to just normal, removed the case, commented out the MMouse and everything just to see if it would write Found Iron Rock, still nothing. Its like the then is making it stop…

Procedure MineIron;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
//PlusOneOre:= P07_InvCount +1;
//if P07_FindObjCustom(x, y, ['Mine', 'Min'], [RockColor], 10) then
If P07_FindObj(x, y, 'ine', RockColor, 10) then
//Begin
WriteLn('Found Iron Rock');
// MMouse(x, y, 0, 0);
//ClickMouse2(False);
//End;


End;

From: The Mayor
You are a great helper Sjoekeloe :)


Indeed he is :)

Sjoe

2013-02-25 04:38:42

From: Twinki
I've tried changing the function to a procedure, changed the FindObjCustom to just normal, removed the case, commented out the MMouse and everything just to see if it would write Found Iron Rock, still nothing. Its like the then is making it stop…

Procedure MineIron;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
//PlusOneOre:= P07_InvCount +1;
//if P07_FindObjCustom(x, y, ['Mine', 'Min'], [RockColor], 10) then
If P07_FindObj(x, y, 'ine', RockColor, 10) then
//Begin
WriteLn('Found Iron Rock');
// MMouse(x, y, 0, 0);
//ClickMouse2(False);
//End;


End;



Indeed he is :)


Ok I find it really weird that the FindObj fails? It's working for people atm I see

Are u using in SMART or browser?

if using browser:
Not calling u dumb here, but people tend to forget this. Did u activate the client with the green crosshair :p
Cause I don't see why it's not working.

EDIT: just make sure: u download the Upchars.zip and installed it properly?

From: The Mayor
You are a great helper Sjoekeloe :)


I hope you're not sarcastic lol

Twinki

2013-02-25 04:43:58

From: Sjoekeloe
Ok I find it really weird that the FindObj fails? It's working for people atm I see

Are u using in SMART or browser?

if using browser:
Not calling u dumb here, but people tend to forget this. Did u activate the client with the green crosshair :p
Cause I don't see why it's not working.



I hope you're not sarcastic lol


Yes I did activate the client :P and using a browser, but the weird thing is, is that if i activate the client to Simba, the mouse will move for like 2 seconds… I'm not sure if FindObj is failing, since I have the ACA function in there, it'd say 'Failed to find the color, no result.', but it doesn't. It does when I activate the client to simba though.

EDIT: It doesn't even write 'Found Iron Rock' if I removed everything else under the FindObj but the WriteLn…

Sjoe

2013-02-25 04:47:41

From: Twinki
Yes I did activate the client :P and using a browser, but the weird thing is, is that if i activate the client to Simba, the mouse will move for like 2 seconds… I'm not sure if FindObj is failing, since I have the ACA function in there, it'd say 'Failed to find the color, no result.', but it doesn't. It does when I activate the client to simba though.

EDIT: It doesn't even write 'Found Iron Rock' if I removed everything else under the FindObj but the WriteLn…


Was just reading Danny's thread (for the include)

I see that u need to call
SetupP07Include; (do it after SetupSRL)

Sorry, didn't know this since I don't play 07 :p

Hope it works now

EDIT:
just make sure u followed every step. http://villavu.com/forum/showthread.php?t=96863
People forgets stuff :p (well I always do)

Twinki

2013-02-25 05:05:10

From: Sjoekeloe
Was just reading Danny's thread (for the include)

I see that u need to call
SetupP07Include; (do it after SetupSRL)

Sorry, didn't know this since I don't play 07 :p

Hope it works now

EDIT:
just make sure u followed every step. http://villavu.com/forum/showthread.php?t=96863
People forgets stuff :p (well I always do)


Okay, NOW it does move the mouse to each object that looks like the rock (Goes over the dead tree's that look like the rock too), but still doesn't write 'Found Iron Rock' nor does it click. I get this error too:
The following DTMs were not freed: [2, 3]

Sjoe

2013-02-25 05:18:14

From: Twinki
Okay, NOW it does move the mouse to each object that looks like the rock (Goes over the dead tree's that look like the rock too), but still doesn't write 'Found Iron Rock' nor does it click. I get this error too:
The following DTMs were not freed: [2, 3]


Well that's a problem with your color that the tree also has.
Does it hover at the rock at one point?
Meaning does it find the rockcolor and check for the uptext?


That's not an error, it's something in the SRL include, a mystery :)
just ignore that

EDIT: u downloaded and placed the fonts at the right directory right?

Twinki

2013-02-25 05:33:19

From: Sjoekeloe
Well that's a problem with your color that the tree also has.
Does it hover at the rock at one point?
Meaning does it find the rockcolor and check for the uptext?


That's not an error, it's something in the SRL include, a mystery :)
just ignore that

EDIT: u downloaded and placed the fonts at the right directory right?


Now it hovers over the rocks, and only the rocks :) but it still doesn't write 'Found Iron rock' nor does it click. :c

Sjoe

2013-02-25 05:34:43

From: Twinki
Now it hovers over the rocks, and only the rocks :) but it still doesn't write 'Found Iron rock' nor does it click. :c


u downloaded and placed the fonts at the right directory right?
I think u didn't do this?

Twinki

2013-02-25 05:38:25

From: Sjoekeloe
u downloaded and placed the fonts at the right directory right?
I think u didn't do this?


\Simba\Fonts\P07UpChars Right? If so then yes.

Sjoe

2013-02-25 05:45:58

From: Twinki
\Simba\Fonts\P07UpChars Right? If so then yes.


Yeah ok, I'm clueless now lol.
Everything should be working. I don't see what else could be wrong.
Play around with your uptext strings?

Is your brightness on highest?

Twinki

2013-02-25 05:59:00

From: Sjoekeloe
Yeah ok, I'm clueless now lol.
Everything should be working. I don't see what else could be wrong.
Play around with your uptext strings?


Thats what i'm thinking it is, the code once again :p:
rocedure MineIron;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
//if P07_FindObjCustom(x, y, ['Mine','Rocks'], [RockColor], 1) then
If P07_FindObj(x, y, 'ine', RockColor, 1) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: Begin
MMouse(x, y, 0, 0);
ClickMouse2(False);
end;
1: Begin
MMouse(x, y, 0, 0);
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['ine']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;

Now i'm not getting that DTM error though, but it's still not doing anything after then…
and yes, brightness is on highest.

Sjoe

2013-02-25 06:02:18

From: Twinki
Thats what i'm thinking it is, the code once again :p:
rocedure MineIron;
Var
x, y, PlusOneOre, OreCounter: Integer;
Begin
PlusOneOre:= P07_InvCount +1;
//if P07_FindObjCustom(x, y, ['Mine','Rocks'], [RockColor], 1) then
If P07_FindObj(x, y, 'ine', RockColor, 1) then
Begin
WriteLn('Found Iron Rock');
GetMousePos(x, y);

Case Random (2) Of
0: Begin
MMouse(x, y, 0, 0);
ClickMouse2(False);
end;
1: Begin
MMouse(x, y, 0, 0);
ClickMouse2(True);
Wait(RandomRange(400, 1000));
P07_ChooseOptionMulti(['ine']);
End;
End;

Repeat
MarkTime(OreCounter);
Antiban;
Wait(1000);
If P07_InvCount=PlusOneOre Then
WriteLn('Collected one Ore');
Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
End;

End;

Now i'm not getting that DTM error though, but it's still not doing anything after then…


Did u use the tolerance from ACA?
ClickMouse2(True) = left click btw, and false is right click.
GetmousePos(x,y) is not really needed here. U can remove that.
Other than that, coding looks good to me.
I don't see what else can be wrong.

Brightness at highest?

Twinki

2013-02-25 06:13:43

From: Sjoekeloe
Did u use the tolerance from ACA?
ClickMouse2(True) = left click btw, and false is right click.
GetmousePos(x,y) is not really needed here. U can remove that.
Other than that, coding looks good to me.
I don't see what else can be wrong.

Brightness at highest?


EDIT: GOT IT! IT WAS 'SetupSRL;' in the main loop :)!!!!!!!! It now right clicks and everything

THANK YOU DANNY AND Sjoekeloe!!!!!! :)

xtrapsp

2013-02-25 06:53:33

Twinki, can I make a suggestion?

If you can dig out the old paintsmart and run it in smart then you can have it paint what it finds :) In the future that might make it easier to debug ^^

Sjoe

2013-02-25 08:23:44

From: Twinki
EDIT: GOT IT! IT WAS 'SetupSRL;' in the main loop :)!!!!!!!! It now right clicks and everything

THANK YOU DANNY AND Sjoekeloe!!!!!! :)


Alright, glad you got it lol. Make some killer scripts ;)