Scripts
Semtex Fishing Guild
Using this for BXP and it's working flawlessly. thanks!
I'm glad it's working great for yall too and not just me, I will finish the main script this weekend and update here. Then I will start on the item database. I have been procrastinating on that because I have to reload the rs page like 10 times or more for each item to get the correct color tolerances. This Bank Item Finding Include I built will one day have most common items from every skill set. You could use my include to very simply withdraw ores, bars, charms, logs, food, hides, fish, and the list goes on and on and on.
if you look at this piece of code in the beta script I posted on the front page, you will see me calling the very easy to use function that will find any bank item.
I just have it commented out because I don't have the item database going yet. But the include is finished. Take a look if you like,below, but this might change a bit depending on any problems that may arise from building the item database.Simba Code:{ if(FindBankItemMulti(x, y, Item[I].ItemName))then
begin
FoundXY := Point(x, y); //Stores found item x, y to a Tpoint
RowSlot := MSTPointToBankPoint(FoundXY); //Converts mouse point to a bank point(row, column)
Ind := BankPointToBankIndex(RowSlot); //Converts point to index
BankXY := BankIndexToMSPoint(Ind); // Converts index to mouse point
Item[I].LocationX := BankXY.x + 14;// Stores middle point of bank slot for item
Item[I].LocationY := BankXY.y + 15;
writeln(Item[I].ItemName + ' found and stored at row ' + IntToStr(RowSlot.y + 1) + ', Slot ' + IntToStr(RowSlot.x + 1));
end else
begin
Writeln('Shutting down script');
TerminateScript;
end; }
Simba Code:{
FindBankItems
The FindBankItems include contains functions to find many bank Items.
* by Bud_wis_er_420
Function List:
~ * function AutoTheColorEx(StringType: string; ax, ay, bx, by: Integer): Integer;
~ * function AutoTheColor(var x, y:integer; ItemName: string): Boolean;
~ * function ConvertTextToStrArray(ItemName: string): TStringArray;
~ * function CheckItemUpext(text: string): Boolean;
~ * function WaitForUpText(Text: string; Time: Integer): Boolean;
~ * function FindBankItemDtmEx(var x, y:integer; ItemName: string; ax, ay, bx, by: integer): Boolean;
~ * function FindBankItemDtm(var x, y:integer; ItemName: string): Boolean;
~ * function FindBankItemDtmSlot(var x, y: integer; ItemName: string): Boolean;
~ * function FindBankItemAutoColorSlot(var x, y: integer; ItemName: string): Boolean;
~ * function FindBankItemMulti(var x, y:integer; ItemName: string): Boolean;
Item List:
~~Herbs~~
Clean guam, Grimy guam, Clean marrentill, Grimy marrentill, Clean tarromin,
Grimy tarromin, Clean harralander, Grimy harralander, Clean ranarr, Grimy ranarr,
Clean toadflax, Grimy toadflax, Clean spirit weed, Grimy spirit weed, Clean irit,
Grimy irit, Clean wergali, Grimy wergali, Clean avantoe, Grimy avantoe,
Clean kwuarm, Grimy kwuarm, Clean snapdragon, Grimy snapdragon, Clean cadantine,
Grimy cadantine, Clean lantadyme, Grimy lantadyme, Clean dwarf weed,
Grimy dwarf weed, Clean torstol, Grimy torstol, Clean fellstalk, Grimy fellstalk
~~Potions: Finished and Unfinished~~
~~Ores and Bars~~
~~Logs~~
~~Bows: Finished and Unfinished~~
~~Leather~~
~~Fish: Cooked and Uncooked~~
~~Equipment~~
~~Weapons and Armour~~
~~Other~~
}
{$i ItemData.Simba}
(*
AutoTheColorEx
~~~~~~~~~~
.. code-block:: pascal
function AutoTheColorEx(StringType: string; ax, ay, bx, by: Integer): Integer;
* Uses Edited ACA funtion to autocolor many different
colors within ItemData Include
* Returns Auto Color within a specified box
.. note::
Author: Nielsie95 and Sumilion edited by Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function AutoTheColorEx(StringType: string; ax, ay, bx, by: Integer): Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL, Acolor, Atol: Integer;
Hue, Sat: Extended;
begin
GetAutoColorData(StringType, Acolor, Atol, Hue, Sat);
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
FindColorsSpiralTolerance(ax, ay, arP, Acolor, ax, ay, bx, by, Atol);
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
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
(*
AutoTheColor
~~~~~~~~~~
.. code-block:: pascal
function AutoTheColor(StringType: string): Integer;
* Uses AutoTheColorEx
* Returns Auto Color within whole screen
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function AutoTheColor(StringType: string): Integer;
begin
Result := AutoTheColorEx(StringType, MSX1, MSY1, MSX2, MSY2);
end;
(*
ConvertTextToStrArray
~~~~~~~~~~
.. code-block:: pascal
function ConvertTextToStrArray(ItemName: string): TStringArray;
Returns a string array of individual characters of a String.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function ConvertTextToStrArray(ItemName: string): TStringArray;
var
I: Integer;
Txtleng: LongInt;
Text_array: TStringArray;
begin
Txtleng := Length(ItemName);
SetArrayLength(Text_array, Txtleng + 1);
for I := 0 to Txtleng do
Text_array[I] := Copy(ItemName, I, 1);
Result := Text_array;
end;
(*
CheckItemUpext
~~~~~~~~~~
.. code-block:: pascal
function CheckItemUpext(text: string): Boolean;
Gets RS item text and compares each character with var text.
Returns true if results are at least an 80% match.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function CheckItemUpext(text: string): Boolean;
var
I, found: integer;
leng: Extended;
CompareText: string;
TxtArray, CompareTxtArray: TStringArray;
begin
Result := False;
CompareText := GetTextAt(82, 10, 0, 5, 10, 3182559, 47, 75, UpChars);
Text := Replace(Text, '''', '.');
SetArrayLength(CompareTxtArray, High(TxtArray))
TxtArray := ConvertTextToStrArray(Text);
CompareTxtArray := ConvertTextToStrArray(CompareText);
//Writeln('Text got from rs: ' + CompareText);
//Writeln('Text we are looking for: ' + Text);
found := 0;
for I := 1 to High(TxtArray) do
begin
//Writeln('Char "' + TxtArray[i] +
// '"compaired with char "' + CompareTxtArray[i] +'"');
if(TxtArray[i] = CompareTxtArray[i])then
begin
Inc(found);
end;
end;
leng := High(TxtArray);
if(found > leng - (0.20 * leng))then
begin
Result := True;
end else
begin
Writeln('The uptext "' + Text + '", was not found');
Writeln('Text got from rs: ' + CompareText);
Writeln('Found ' + IntToStr(found) + ' chars out of ' + FloatToStr(leng));
end;
end;
(*
WaitForUpText
~~~~~~~~~~
.. code-block:: pascal
function WaitForUpText(Text: string; Time: Integer): Boolean;
Waits for orange text to appear. Then uses CheckItemUpext to compare text
Returns true if found, else it tries once more incase of lag.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function WaitForUpText(Text: string; Time: Integer): Boolean;
var
ax,ay: integer;
begin
Result := False;
if(WaitFindColor(ax, ay, 3182559, 82, 10, 100, 16, 47, Time))then
begin
if(CheckItemUpext(Text))then
begin
Result := True;
Exit;
end else
begin
//Checking again in 2 to 3 sec, temp lag protection
Sleep(2000 + random(1000));
if(CheckItemUpext(Text))then
begin
Result := True;
Exit;
end;
end;
end;
end;
(*
FindBankItemDtmEx
~~~~~~~~~~
.. code-block:: pascal
function FindBankItemDtmEx(var x, y:integer; ItemName: string; ax, ay, bx, by: integer): Boolean;
Finds premade DTM within a specified box. Returns true if found.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function FindBankItemDtmEx(var x, y:integer; ItemName: string; ax, ay, bx, by: integer): Boolean;
var
DTM: Integer;
begin
Result := False;
DTM := GetItemDTM(ItemName);
if(FindDTM(DTM, x, y, ax, ay, bx, by))then
begin
MMouse(x - 2, y - 2, 4, 4);
sleep(200+random(100));
if(WaitForUpText(ItemName, 4000))then Result := True;
end else Writeln('Did not find the ' + ItemName + ' with FindBankItemDTM');
FreeDTM(DTM);
end;
(*
FindBankItemDtm
~~~~~~~~~~
.. code-block:: pascal
function FindBankItemDtm(var x, y:integer; ItemName: string): Boolean;
Finds premade DTM within the bank screen(Not Tab Area). Returns true if found.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function FindBankItemDtm(var x, y:integer; ItemName: string): Boolean;
begin
Result := FindBankItemDtmEx(x, y, ItemName, 25, 83, 480, 491);
end;
(*
FindBankItemDtmSlot
~~~~~~~~~~
.. code-block:: pascal
function FindBankItemDtmSlot(var x, y: integer; ItemName: string): Boolean;
Finds premade DTM within the bank screen(Not Tab Area),
checking one bank slot at a time. Returns true if found.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function FindBankItemDtmSlot(var x, y: integer; ItemName: string): Boolean;
var
rightcount, downcount, Slotx, Sloty: integer;
begin
Result := False;
Slotx := 31;
Sloty := 85;
rightcount := 0;
downcount := 0;
repeat
repeat
//SMART_DrawBoxEx(True, IntToBox(Slotx, Sloty, Slotx + 44, Sloty + 44), clRed);
if(FindBankItemDtmEx(x, y, ItemName, Slotx, Sloty, Slotx + 44, Sloty + 44))then
begin
Result := True;
Exit;
end;
Slotx := Slotx + 44;
Inc(rightcount);
Sleep(5 + random(2));
until(rightcount >= 10)
rightcount := 0;
Sloty := Sloty + 44;
Slotx := 31;
Inc(downcount);
Sleep(10);
until(downcount >= 4)
Writeln(ItemName + ' was not found with FindBankItemDtmSlot');
//SMART_ClearCanvas;
end;
(*
FindBankItemAutoColorSlot
~~~~~~~~~~
.. code-block:: pascal
function FindBankItemAutoColorSlot(var x, y: integer; ItemName: string): Boolean;
Finds Auto Color of an Item within the bank screen(Not Tab Area),
checking one bank slot at a time. Returns true if found.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function FindBankItemAutoColorSlot(var x, y: integer; ItemName: string): Boolean;
var
rightcount, downcount, Slotx, Sloty, AColor: integer;
begin
Result := False;
Slotx := 31;
Sloty := 85;
rightcount := 0;
downcount := 0;
repeat
repeat
//SMART_DrawBoxEx(True, IntToBox(Slotx, Sloty, Slotx + 44, Sloty + 44), clRed);
AColor := AutoTheColorEX(ItemName, Slotx, Sloty, Slotx + 44, Sloty + 44)
if(AColor > 0)then
begin
if(FindColorTolerance(x, y, AColor, Slotx, Sloty, Slotx + 44, Sloty + 44, 5))then
begin
MMouse(Slotx + 16, Sloty + 16, 12, 12);
Sleep(200+random(100));
if(WaitForUpText(ItemName, 4000))then
begin
Result := True;
Exit;
end;
end;
end;
Slotx := Slotx + 44;
Inc(rightcount);
Sleep(10);
until(rightcount >= 10)
rightcount := 0;
Sloty := Sloty + 44;
Slotx := 31;
Inc(downcount);
Sleep(10);
until(downcount >= 4)
Writeln(ItemName + ' was not found with FindBankItemAutoColorSlot');
//SMART_ClearCanvas;
end;
(*
FindBankItemMulti
~~~~~~~~~~
.. code-block:: pascal
function FindBankItemMulti(var x, y:integer; ItemName: string): Boolean;
Uses 3 different functions as a fail safe to find a bank item.
Returns true if Found.
.. note::
Author: Bud_wis_er_420
Last Modified: Mar. 7th, 2012 by Bud_wis_er_420
Example:
.. code-block:: pascal
*)
function FindBankItemMulti(var x, y:integer; ItemName: string): Boolean;
begin
if(FindBankItemDTM(x, y, ItemName))then
begin
Result := True;
end else
begin
if(FindBankItemDtmSlot(x, y, ItemName))then
begin
Result := True;
end else
begin
if(FindBankItemAutoColorSlot(x, y, ItemName))then
begin
Result := True;
end else
begin
Writeln(ItemName + ' was not found using all 3 methods');
end;
end;
end;
end;
Last edited by bud_wis_er_420; 03-17-2012 at 02:13 AM.
How do i add this so i can run it or whatever?
hmm, this script is incompatible with the scroll of cleansing. What that does it that it saves herbs, so often after an inventory is finished, there will be secondaries left behind (herbs if making unfs, the 2ndary if making pots). I hvaen't looked through your code, but it looks like it waits for the bottm half of the inventory to be empty before banking. could you please add the scroll of cleansing fix?
It's not that it is incompatible with the scroll of cleansing, I forgot to redo the antiban. Anyways it should be fixed now, recopy and paste the script on the first page.
Btw I took out the crashsmart because there is a better way now using SMARTManager
Just a request.. If you could make it so that it will stop if it withdraws one of the supplies < 14 instead of having to specify how many to make before you start the bot. Mainly because I run multiple accounts at once and would prefer not having to find and set that number everytime I set a bot up, especially if the bot isn't flawless. However, if you make that simple change I'd be glad to test run the script for you on my accounts and post the bugs here.
Hey it works but it is rather slow, after making potions it takes a while to find the bank.
Apart from that... this is a great script
Actually i found out the problem. Since i have scroll of cleansing, there will be left over materials. Whenever there is left over materials the bot would attempt to mix the secondary ingredient with the already combined potion (unf) until it eventually clicks the bank.
Copied the latest code but im still experiencing this problem^
Last edited by dragon926; 03-31-2012 at 04:07 PM.
hey when i am using the script in world 44 login, the script sometimes walks out of soul wars and doesnt walk back to the sw
Whats shakin' your bacon?
I'm still relatively new to this site, I cant seem how to figure out how to copy paste into simba, a noob error i know. Can someone help me with this? I would like to get this script running seeing as how i have the scroll of cleansing, and according to the above posts it does do unfinished potions. Any help would be nice. Like i said im still new and trying to figure this out.
If when you try to COPY and PASTE the code and it pastes the code all in ONE line...
All you do is QUOTE the first post... scroll to the beginning part of the script, COPY, open simba paste. This time when you paste it will paste normally and not all in one line.
Good luck
EDIT:
I get
[Hint] C:\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3): Variable 'BOX' never used at line 1352
[Hint] (249:2): Variable 'IND' never used at line 248
[Hint] (250:2): Variable 'FOUNDXY' never used at line 249
[Hint] (250:2): Variable 'BANKXY' never used at line 249
[Hint] (250:2): Variable 'ROWSLOT' never used at line 249
[Error] (1:1): period ('.') expected at line 0
Compiling failed.
Last edited by Neznam; 04-09-2012 at 11:15 PM.
what bank will this script work best at?
Got 99 herblore with this script a couple of weeks ago, many thanks for this
Great script, ive leveled more than 30 times with this script, but I would like to suggest a part in your script that deals with the extra spins that you get when the script is running
Whats shakin' your bacon?
Very nice script, works perfect and atleast now i have a use for all my clean herbs
havent found anything that is profitable from making (unf) potions..... clean herbs are worth more then (unf) pots lol.
Are you using a Scroll of Clensing from dungeoneering? That's the only way literally to make any profit from unf potions.
As for the script;
Is this seriously BETA? If it's better, then this guy deserves a huge pat on the back. One of the best herb scripts I've used since the bot nuke. Scratch that. THE best herb bot I've used.
Clean herbs are not worth more than (unf) potions. At least not all.
Take a look at the second list which shows Clean Herbs to Unfinished Potions...
http://runescape.wikia.com/wiki/Calc...nished_potions
Some have a potential profit anywhere from around 100-500gp per potion.
Great script, made 10K prayer pots yesterday night. But stuck on a spinning ticket today, can you fix that?
Out of all the Herbalore scripts in this section, this herb script is the best one ive used. Ive tried them all, and this one has been flawless so far.
^ clicking on the ticket is the only problem
but can be fixed it by adding
"FindNormalRandoms;" to the main loop, and thoughout a few other spots in the script too
everything seems to be working great, thank you sir
when scroll of cleansing saves herbs it takes about 10x longer to bank then when it doesn't. any solution for that?
There are currently 1 users browsing this thread. (0 members and 1 guests)