So I made an extremely simple script that clicks different food in my inventory, but I was wondering if there is a way to get the script to click the food at, or lower, than a certain hp level. This is for soulsplit. Thanks!
So I made an extremely simple script that clicks different food in my inventory, but I was wondering if there is a way to get the script to click the food at, or lower, than a certain hp level. This is for soulsplit. Thanks!
yes there is way. no problem!
Formerly known as Undorak7
You'd use a DTM, and click it. For detecting HP, SRL-5's GetMMLevels might still work: https://github.com/SRL/SRL-5/blob/ma...ab.simba#L2052
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
For DTM's, I'd recommend YoHoJo's tutorial here: https://villavu.com/forum/showthread.php?t=68018
For the GetMMLevels function, you can probably just copy it over, read the documentation to ensure you know what's needed to use it
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
@jstemper;
I use this for basic text functions when I script for RSPSs:
Simba Code:function getSimpleText(Colors:TIntegerArray;x1, y1, x2, y2:integer;font:string):String;
var
textTPA:TPointArray;
textATPA, textATPAS:T2DPointArray;
i:integer;
textStr:string;
begin
setLength(textATPAS, length(colors));
for i := 0 to high(colors) do
findColors(textATPAS[i], Colors[i], x1, y1, x2, y2);
textTPA := mergeATPA(textATPAS);
textATPA := SplitTPAEx(textTPA, 1, 10);
filtertpasbetween(textatpa, 0, 1);
SortATPAFromFirstPointX(textATPA, Point(0, 0));
result := getTextATPA(textATPA, 3, font);
end;
Example
Simba Code:getSimpleText([colors], x1, y1, x2, y2, 'upchars07');
You'd call it likeSimba Code:getSimpleText({colors of the HP text}, {bounds where you'd find the text}, {which charset to use});
Pretty sure the minimap orbs use StatChars but don't quote me on that
That function would output a string so you could do something like..
Simba Code:function getHp():integer;
begin
result := strToInt(getSimpleText({blah}));
end;
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
There are several character sets built into Simba, all of which correspond to character sets used in Runescape. You can see them all in C:/Simba/Fonts/.
They're what Simba (or Tesseract, if you're using it) uses for its OCR (Optical Character Recognition).
I'm pretty sure the minimap orbs use the charset called StatChars, but I'm not positive.
Last edited by KeepBotting; 03-29-2015 at 05:34 PM.
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
There is an extremely simple way to do this and how I do it on rsps's. When you start losing hp the color behind the red color that fills the hp area (circle with the heart in it), the color behind that is a dark brown or something like that. So if you want to eat at 50% hp all you need is a function that looks for that dark color at half hp or where ever you want then it eats. If this doesn't make sense I can show a picture.
this code will click a 1-dose brew if it sees it in inv, even though it should only begin if it sees that dark color under the hp minimap right? Can someone tell me if I did this wrong. Also, this is mostly based off of RJ's guide pls i'm new, but I actually want to learn this program wellSimba Code:Program DTM;
{$i srl/srl.simba}
var
sarabrew1dose:Integer;
Procedure sip_brews;
var
X,Y:Integer;
begin
if findcolortolerance(x, y, 1649201, 689, 75, 713, 97, 5) then
begin
if FindDTM(sarabrew1dose, x, y, 554, 230, 732, 482) then
begin
mmouse(x, y, 1, 1);
wait(randomrange(100, 200));
clickmouse2(mouse_Left);
wait(randomrange(150, 250));
end;
end;
end;
Begin
repeat
MouseSpeed := 100;
SetUpSRL;
sarabrew1dose := DTMFromString('mWAAAAHicY2FgYHBmYmBwAmIrILYHYmVGBgZpRggtBcTHj3kyZGfnguna2joGdMCIhkEAAJL5B/U=')
sip_brews;
FreeDtm(sarabrew1dose);
until(false)
end.
There are currently 1 users browsing this thread. (0 members and 1 guests)