Krzysztof
2015-06-13 06:52:12
Greetings
I am trying to produce a simple Ivy chopping script. Since it has a weird model and I wasn't able to get ogLib to click it properly I turned to SRL-6. And now I don't know how to determine when the script should click another ivy after the first had been chopped.
PixelShift I don't want, as I've seen it's pretty unreliable.
Can't use ItemShift, due to obvious lack of items in ivy chopping.
Therefore I had concluded that best would be to make the script get the XP from XP counter, and do the math, and if it hadn't changed then click an ivy. A XPShift, if you will.
I browsed a bit of SRL, and a function of xp getting from IvyChopperUltra in RS3 public script, however I have no idea how to make such a function or how to use an existing one in SRL-6.
Alternatively, I could use the wonderful method from oglib that simply looks for my choppingModel and if it's not present it carries on as the script knows exactly when I'm not chopping. However, as afaik Clarity hadn't finished SRL compatibility yet, I would have to manually include some SRL-6 scripts into oglib setup, and in that I failed.
I tried to include lib/utilities/color, math, types and some others, but the same error present i.e. not knowing what maxint is.
If anybody could help me get any of these two methods to work I'd appreciate it. I do not understand much, so I look for simplest ways possible, and that shortcutting I hope you would forgive me.
This is the current base of the script, obviously far from finished. It's to tell what I'm using and what I would have to potentially include into ogLib setup to make it work.
[spoiler=click me]
edit:
I found Ashaman's post on chatbox.getxp. As opposed to the piece of the function I copypasted from Ivy Chopper Ultra this one didn't give compile errors. I'll test it later, and hopefully it will work.
I am trying to produce a simple Ivy chopping script. Since it has a weird model and I wasn't able to get ogLib to click it properly I turned to SRL-6. And now I don't know how to determine when the script should click another ivy after the first had been chopped.
PixelShift I don't want, as I've seen it's pretty unreliable.
Can't use ItemShift, due to obvious lack of items in ivy chopping.
Therefore I had concluded that best would be to make the script get the XP from XP counter, and do the math, and if it hadn't changed then click an ivy. A XPShift, if you will.
I browsed a bit of SRL, and a function of xp getting from IvyChopperUltra in RS3 public script, however I have no idea how to make such a function or how to use an existing one in SRL-6.
Alternatively, I could use the wonderful method from oglib that simply looks for my choppingModel and if it's not present it carries on as the script knows exactly when I'm not chopping. However, as afaik Clarity hadn't finished SRL compatibility yet, I would have to manually include some SRL-6 scripts into oglib setup, and in that I failed.
I tried to include lib/utilities/color, math, types and some others, but the same error present i.e. not knowing what maxint is.
If anybody could help me get any of these two methods to work I'd appreciate it. I do not understand much, so I look for simplest ways possible, and that shortcutting I hope you would forgive me.
This is the current base of the script, obviously far from finished. It's to tell what I'm using and what I would have to potentially include into ogLib setup to make it work.
[spoiler=click me]
program AutoIvy;
{$DEFINE SMART}
{$i srl-6/srl.simba}
procedure chopIvy();
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
findColorsSpiralTolerance(x, y, TPA, 2509624, mainScreen.getBounds(), 6, colorSetting(2, 0.05, 0.23));
if length(TPA) < 1 then
exit;
ATPA := TPA.toATPA(30, 30);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
//smartImage.debugATPA(ATPA);
//smartImage.debugTPA(TPA, true);
for i := 0 to high(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['hop Ivy'], 500) then
begin
getMousePos(x, y);
holdMouse(x, y, MOUSE_LEFT);
wait(gaussRangeInt(46,78));
releaseMouse(x, y, MOUaSE_LEFT);
wait(gaussRangeInt(2184,2721));
break;
end;
end;
end;
begin
clearDebug();
smartEnableDrawing := true;
setupSRL();
chopIvy;
// repeat
// chopIvy;
// until false;
end.[/spoiler]edit:
I found Ashaman's post on chatbox.getxp. As opposed to the piece of the function I copypasted from Ivy Chopper Ultra this one didn't give compile errors. I'll test it later, and hopefully it will work.