PDA

View Full Version : [Multi-Skilled] Al Kharid Mining Unstrung Symbol Crafter



DeniedHacker
06-18-2015, 04:30 PM
Al Kharid Mining Unstrung Symbol Crafter

Hello everyone, I just came back from a very long break of runescape. I decided to come back because a friend told me they brought back Old School Runescape. It is my first public script since my return a few weeks ago. I wanted to help new comers who want to learn programming, so I added a lot of comments in my script. This way, you can learn from it and try to reuse some of my personal methods. If you have any question about how to use some of my method or how I get those values I am using, you can send me a PM and I will help you.



Requirements

You must have a crafting level of 16 or higher
You must have a mining level of 20 or higher
You must have a smithing level of 20 or higher
You must have a Holy Mould in your Inventory
You must have a mining pick equipped or in your inventory
You must have AeroLib (https://villavu.com/forum/showthread.php?t=108953)Revision 11
You must download the custom map I made for walking (I will explain)
You must do the quick fix to WorldSwitcher if you want to use multiple Worlds (I will explain)
You must make your own DTM for mining pick to use this script(I will explain)




Cycle of the Script
Start the script next to the 3 Silver ore's in Al Kharid
It will mine Silver Ore until inventory is full and it will switch world(If you specified it)
It will Walk to the Furnace in Al Kharid
It will smelt the ore into bar and the bar into unstrung symbol
It will walk to to the General Store in Al Kharid and it will sell the symbols
It will walk back to the mining site and start over again



Features

Random Detection
Antiban
Perfect for Ultimate Ironman
Fail Safe
My Custom Mining Detection
WorldSwitcher for people with a high mining level
Will Logout if something bad happen :-)




Before running the Script
Custom Map
At the end of this post, you will find two attached files. The first one will be the script while the other one is my custom map. Once you have downloaded both, you will need to transfer the file named "CrafterMap" in your Simba folder under Aerolib\maps\surface. On my computer, the final path to this folder is this -> C:\Simba\Includes\AeroLib\maps\surface
http://imagizer.imageshack.us/v2/xq90/910/XRq9Wo.png (https://imageshack.com/i/paXRq9Wop)

Inventory
Make sure you have a Mining Pick Equipped or in Your Inventory and a Holy Mould.
http://imagizer.imageshack.us/v2/xq90/661/yP844k.png (https://imageshack.com/i/idyP844kp)

Complete Script
Section to complete

//Fails attempt for detecting mining pick. This number should be based on the performance of your computer.
//On my personnal computer, I set this value to 8. At work, I use 18.
failsLimit := 18;

// Player info
P_NICKNAME = '';
P_LAMPSKILL = SKILL_SMITHING;


Mining Pick DTM
If you want to use my script, you will need to make 2 DTM. I will show you how to do these DTM that will be used for detecting if you are mining

If you don't know how to make DTM -> https://villavu.com/forum/showthread.php?t=77691

First, you need to make a DTM when the rock is located North. The Position of the mining pick when you make the DTM should be over your head.
Mining Position
http://imagizer.imageshack.us/v2/xq90/910/PQuPnE.png (https://imageshack.com/i/paPQuPnEp)
DTM
http://imagizer.imageshack.us/v2/xq90/538/ildy5t.png (https://imageshack.com/i/eyildy5tp)
Result of the DTM
http://imagizer.imageshack.us/v2/xq90/538/3ajhiR.png (https://imageshack.com/i/ey3ajhiRp)

Second, you need to make a DTM when the rock is located on the East. The position of the mining pick when you make the DTM should be over your head again
Mining Position
http://imagizer.imageshack.us/v2/xq90/538/39fTyv.png (https://imageshack.com/i/ey39fTyvp)
DTM
http://imagizer.imageshack.us/v2/xq90/912/75dKbM.png (https://imageshack.com/i/pc75dKbMp)
Result of the DTM
http://imagizer.imageshack.us/v2/xq90/538/zw7XlD.png (https://imageshack.com/i/eyzw7XlDp)

When you are done, add your two DTM at this location in the script
They are located on line 545 and 546

//Detect if user is done mining
Procedure CheckIfUserMining();
Var
DTM_MiningPickHori, DTM_MiningPickVerti : Integer;
FailsCounter : Integer = 0;
Begin
DTM_MiningPickHori := //Dtm 1
DTM_MiningPickVerti := //Dtm2

//Detect If user is Mining
While FailsCounter < failsLimit Do
Begin
GeneralAntiban(3000);
Wait(Randomrange(10,20));

//Try to find Mining pick on screen
If (FindDtmOnScreen([DTM_MiningPickHori,DTM_MiningPickVerti],TopLeftScreen,BotRightScreen)) Then
Begin
FailsCounter := 0;
End Else
FailsCounter := FailsCounter + 1;
End;

FreeDTM(DTM_MiningPickHori);
FreeDTM(DTM_MiningPickVerti);
End;



If you want to use Multiple World

Information you must know

It can support up to 3 worlds
You need to be in the world you set at world1 when you start the script
You can use a special function I made for clicking at the position where the worlds should be located
You need to apply my fix to WS_switchWorlds
Highly recommend to use worlds that are visible on the list where you decided to click it.


Step 1 - Fixing WS_switchWorlds
1. Under Functionlist, You need open the include list and you need to find WorldSwitcher. Once you find it, open the list and double-click on WS_switchWorlds;
http://imagizer.imageshack.us/v2/xq90/661/a3YUbh.png (https://imageshack.com/i/ida3YUbhp)
2. Replace function WS_switchWorlds(World: Integer): Boolean; with this

function WS_switchWorlds(World: Integer): Boolean;
var
T : Timer;
ms,x,y : Integer;
rS : Extended;
begin
if not isLoggedIn() then Exit;

WS_toggle();
WS_World := World;
if not WS_findWorld() then
begin
ms := MouseSpeed;
mouseBox(toBox(725,250,733,260), MOUSE_MOVE);
getMousePos(x, y);
holdMouse(x, y, MOUSE_LEFT);

mouseSpeed := 35;
rS := (random(30) / 30) / 10.0;
if rS = 0.0 then
rS := 0.1;

windMouseFunc(X, Y, 725+random(8), 414+random(5), 9.0,3.0,10.0/rS,15.0/rS,10.0*rS, @WS_findWorld);
wait(randomRange(200,400));
getMousePos(X, Y);
releaseMouse(X, Y, MOUSE_LEFT);
wait(randomRange(700,1200));
end;

if not findText(X, Y, toStr(World), 'SmallChars07', WS_WorldBox) then
begin
warn('Failed to find world '+toStr(World)+' in the world list', WT_CORE);
exit;
end;

warn('Found world '+toStr(World)+', switching worlds.', WT_CORE);
T.start();
while (Me.inCombat() and (T.timeElapsed() < 5000)) do
wait(30);

mouseBox(toBox(X,Y,X+15,Y+4), MOUSE_LEFT);
fastClick(MOUSE_LEFT);
T.start();
while (T.timeElapsed() < 4000) do
begin
if findText(X, Y, 'lease', 'SmallChars07', toBox(0,0,230,35)) then
break;
if findText(X, Y, 'Yes', 'CharsNPC07', AREA_CB) then
break;
if isSplashScreen() then
break;
end;

if isSplashScreen() then
begin
mouseBox(toBox(WDx1,WDy1,WDx2,WDy2), MOUSE_LEFT);
while not isLoggedIn() do
wait(60);
end;

if findText(X, Y, 'Yes', 'CharsNPC07', AREA_CB) then
mouseBox(toBox(X,Y,X+10,Y+6), MOUSE_LEFT);
T.start();
while (T.timeElapsed() < 4000) do
if findText(X, Y, 'lease', 'SmallChars07', toBox(0,0,230,35)) then
break;
while findText(X, Y, 'lease', 'SmallChars07', toBox(0,0,230,35)) do
wait(30);

if isSplashScreen() then
begin
mouseBox(toBox(WDx1,WDy1,WDx2,WDy2), MOUSE_LEFT);
while not isLoggedIn() do
wait(60);
Exit(False);
end;
result := true;
end;



Step 2 - Update Script for Switching World

//Variables if we want to switch worlds
HowManyWorlds := 3;
World1 := 20;
World2 := 21;
World3 := 22;


Step 3 - Update Script to put the world list at the required position
Since these worlds don't appear when we open the world switcher, I will use my custom method to set the world list at the right place for switching world at a faster pace

//Set these values if you want to use my custom method instead of Aerolib
useCustomScrolling := True;
//Value between 240 and 410
scrollYPosition := 300;




Things To Do


Update comments on some functions because I made some change
Accurate Progress Report
Paint Progress Report on Smart
Find a Workaround for my Mining Detection so you won't need to make the 2 DTM required to run this script
Improve Walking Fixing, since the script will stop if it didn't made it to the destination(0.5%)

XxAirWalker26xX
06-18-2015, 08:56 PM
Looks great cant wait to try this :D

DeniedHacker
06-19-2015, 01:48 AM
IT'S HERE!!!
- I did many small changes, so the script could get 6 hours more easily.
- I reworked and did some test for detecting if the door was open when we leave the furnace because it had 5%-15% chance to fail at detecting the door with DTM(It was the main cause that was stopping the script from running for a very long time)
-I Added Debug Info so It will be easier for people to tell me where the script stoped

I may have introduced some bugs, but I ran this version for 2h without any problem.

srlMW
06-19-2015, 02:21 AM
Nice release, glad to see you're helping out the next generation of scripter!

DeniedHacker
06-19-2015, 10:02 AM
Nice release, glad to see you're helping out the next generation of scripter!

Thanks you. I started my script before going to sleep. This is a progress Report from this version
***********Progress Report************
* ~By Sheepexert~
*Trip Done: 48 (6 Trip/H)
*Crafting XP earned: 60000 (8007 XP/H)
*Mining XP earned: 48000 (6405 XP/H)
*Smithing XP earned: 16416 (2191 XP/H)
*Total Time: 7 Hours, 29 Minutes and 37 Seconds
*************************************

realm of guarding angels
09-17-2015, 10:32 PM
how does the script looks when dtm is added ? do you need to add x&y?

Hellzonee
01-26-2016, 05:18 AM
Is this script outdated or does it still run? I would like to test it.

Simbaguardian
01-29-2016, 01:26 AM
doesnt work for me lol

r3hab
01-03-2017, 05:32 PM
I think that the script is maybe a litle outdated
Error: Expected variable of type "Int32", got "AnsiString" at line 1014, column 14 at line 1014
Compiling failed.

YungEbola69
06-30-2017, 10:30 PM
is this script still working?

Jumb0
07-01-2017, 12:22 PM
Need try it sounds good :)

Flight
07-02-2017, 03:38 PM
Nicely done mate. Multi-skilled scripts are impressive to me, and it looks like you really put some effort into this. Keep up the good work.