Exception in Script: Runtime error: "Access violation" at line 206, column 17 in file "C:\Simba\Includes\SRL-6\lib\interfaces\lodestone.simba"
get this when trying to teleport via loadstone in a procedure, i have updated srl
Just get rid of the TRS, it's only used within the include.
Simba Code:begin
if isMapGlitched() then
begin
lodestoneScreen.teleportTo(LOCATION_EDGEVILLE);
wait(randomRange(10000, 15000));
lodestoneScreen.teleportTo(LOCATION_LUNAR_ISLE);
end else
writeLn('The map looks normal');
end;
Looks like a lot of effort has been put into this tutorial, I'll try using it to help me start with scripting and then post back about how it goes.
Hey, first off thanks for this! I've been hammering all this info into my head and have made quite a bit of progress. I need help with a couple bugs in the script.
After you use your vexillum to teleport to the clanCamp it doesnt select the "yes" option that comes up in the chat. "TELEPORT TO CLAN CAMP?" "1.yes" "2.No" How would i tell it to say yes? (I made a DTM for "yes" haha, i know its the wrong way to do it, and i failed to even implement it)
Simba Code:procedure teleToClanCamp();
var
x, y, vexillumDTM, yes: integer;
p: TPoint;
teleTimer: TTimeMarker;
begin
if not isLoggedIn() then
exit;
gameTabs.openTab(TAB_EQUIPMENT);
vexillumDTM := DTMFromString('mbQAAAHicY2VgYAhnZmBIAOIYIA4CYj8gngHEU4B4IRAvgLLT2rcCVTOhYEkGTMCIBYMBAAfjBqA=');
[B][SIZE=2]if findDTM(vexillumDTM, x, y, tabBackPack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['Clan', 'vex']) then
begin
fastClick(MOUSE_RIGHT);
if chooseOption.select(['Tele'])then
begin
writeLn('We clicked the teleport option');
teleTimer.start();
repeat
wait(randomRange(2000, 3000));
until (not isLoggedIn()) or (minimap.findSymbol(p, MM_SYMBOL_STORE, minimap.getBounds()) or (teleTimer.getTime() > 20000));[/SIZE]
end;
end;
end else
writeLn('Failed to find the vex DTM');
end;
Also it fails to break out of the loop here, I think the fishing symbol changed or something. until (not isLoggedIn()) or (minimap.findSymbol(p, MM_SYMBOL_STORE, minimap.getBounds()) or (teleTimer.getTime() > 20000));
I hope this was clear <3
Last edited by rapid_spitfire; 05-08-2014 at 08:35 PM.
Ahh they must have added that yes/no option in a recent update. You can just use:
Simba Code:if conversationBox.selectOption(1) then
writeLn('We selected the first option in the conversation box');
And yea, the mini-map symbols changed a while back, and I don't think the bitmaps have been updated in SRL yet, so it won't recognise the symbols.
Thanks, that method worked for selecting "yes or no". Just for knowledge sake, how would i use the mouse to click on one of the options?
I'm new but would you use mcx1, mcy1, mcx2, mcy2?
There are a number of ways. You could move the mouse to a point (x, y) and then click:
Simba Code:begin
mouse(point(50, 50));
fastClick(MOUSE_LEFT);
end;
Or you could just use a MouseBox (moves the mouse to a random place inside a box, and click if you want to). Good for buttons etc.
Simba Code:procedure boxExample();
var
myBox: TBox;
begin
myBox := intToBox(10, 20, 100, 200);
mouseBox(myBox, MOUSE_LEFT);
end;
Explanation:
Simba Code:procedure boxExample();
var
myBox: TBox; // declaring "myBox" variable as a TBox
begin
// assigning the myBox variable the following coordinates
// x1, y1, x2, y2
//(x1 & y1 top left corner of box, x2, y2 bottom right corner coordinates)
myBox := intToBox(10, 20, 100, 200);
// moving the mouse inside the box and left clicking
// you could have MOUSE_RIGHT or MOUSE_MOVE also
mouseBox(myBox, MOUSE_LEFT);
end;
Thanks dude! You're the best. This is what i came up with
Simba Code:procedure teleToClanCamp();
var
vexillumDTM, x, y: integer;
myBox: TBox;
begin
if not isLoggedIn() then
exit;
gameTabs.openTab(TAB_EQUIPMENT);
vexillumDTM := DTMFromString('mbQAAAHicY2VgYAhnZmBIAOIYIA4CYj8gngHEU4B4IRAvgLLT2rcCVTOhYEkGTMCIBYMBAAfjBqA=');
if findDTM(vexillumDTM, x, y, tabBackPack.getBounds()) then
begin
mouse(x, y, 3, 3, MOUSE_MOVE);
if isMouseOverText(['Clan', 'vex']) then
begin
fastClick(MOUSE_RIGHT);
if chooseOption.select(['Tele'])then
wait(randomRange(200,2400));
myBox := intToBox(258, 494, 328, 510);
mouseBox(myBox, MOUSE_LEFT);
end else
writeLn('Failed to find the vex DTM');
end;
end;
Another thing, Do you think you could explain this line of code for me a bit, i'm confused with tabBackPack.getBounds() mostly.
if findDTM(vexillumDTM, x, y, tabBackPack.getBounds());
Last edited by rapid_spitfire; 05-09-2014 at 08:25 PM.
Hey I've noticed while its mining it clicks on the same spot on the rock until the inv is full (mouse just stays there and clicks again when the rock is off cooldown), is it possible to make the mouse be a bit more random when clicking on the atpa? I have it so it stays at the same rock mining clay. I'm not trying to be a nussance
Below are the parameters of that function (if you press ctrl + space in simba the parameters of that function will pop up in a window:
Simba Code:function findDTM(dtm: integer; var x, y: integer; searchBox: TBox): boolean;
You can see:
The first parameter is the dtm. In this case it is our vexillumDTM. You can see that this has to be an integer (DTMs are always declared as integers).
The second parameter is the output variables x and y, also integers. The function stores the coordinatess of the location where it finds the DTM in these 2 variables (which you can then use later, i.e. move the mouse to x, y).
The third parameter is the search box, which is declared as a TBox. This is the area where you want to search for the DTM. You can make your own TBox to search in (like you did above with that button). The getBounds is a function which automatically returns a TBox around the outside of a particular interface. tabBackPack.getBounds() returns the box around the backpack interface (see picture in tutorial). backScreen.getBounds would return a TBox of the bank screen interface.
Simba Code:myBox := intToBox(258, 494, 328, 510);
if findDTM(vexillumDTM, x, y, myBox);
Or you could combine it to one line:
Simba Code:if findDTM(vexillumDTM, x, y, intToBox(258, 494, 328, 510));
It just clicks the one closest to the player. It will click the 2nd rock if there is no ore on the first rock (unless the first rock spawns too quickly). I haven't looked at this script in 5 months, I'm sure there are a few bugs (and it wasn't meant to be a flawless script, just to act as a tutorial).
Thanks for the quick response. The issue is that it clicks the same spot in the ATPA each time, is there a way to tell the mouse to click in a random spot within the ATPA? This code below is as close as i got (very buggy)
Simba Code:begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['Clay', 'lay'], 500) then
begin
GetMousePos(x,y);
mouse(x, y, 10, 10, MOUSE_MOVE);
fastClick(MOUSE_LEFT);
smartImage.clear;
break;
end;
end;
Ahh now I understand what you mean. Well you can see I tell it to cilick in the middle of the TPA. Picture those boxes around each rock (like in the tutorial picture), it will move the mouse to the middle of those boxes.
Simba Code:mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
The middleTPA just returns the middle TPoint in a TPA, (in this case the middle TPoint in ATPA[i]).
Instead of clicking the middle, you could click anywhere inside the TPA of the rock. You could replace the middleTPA with something like:
Simba Code:var
rockBounds: TBox;
begin
// colour finding TPA stuff etc..
rockBounds := getTPABounds(ATPA[i]); // Store the TPA bounds in a TBox variable
mouseBox(rockBounds, MOUSE_MOVE); // Move mouse anywhere in that box
// other stuff
end;
Mayor, could you help me please?
I was setting up the default code. I got it working fine, was able to sign in to my account. However, for some reason it has stopped working.
I was adding an anti ban to the code, i added it and tried to play the script. It worked but wouldn't log me in like it would before. So i deleted it, and recopied the default code and pasted it. Now it's not working at all, even without the anti ban. I need some help. I'll post a picture. Untitled.jpg
Genius! Thanks for the fast reply. Turns out i had my graphics on Directx instead of openGL
Thanks for the great overview of RS3/SRL-6 Scripting. This has served as a great refresher for myself.
Appreciate the hard work - expect to see a script from me soon.
Thanks @The Mayor , I just made my first script and it works well after some tweeks that was done after first couple of runs, running good now and I referred to other similar scripts to check my mistake and correct. Working really good and I thank you for all that, I can just make more and get experienced with this in the future
IT executes but doesn't actually move, can't tell what I missedCode:program walkToChest; {$DEFINE SMART} {$I SRL-6/SRL.simba} {$I SPS/lib/SPS-RS3.Simba} {$i srl-6/lib/misc/srlplayerform.simba} procedure walkToChest(); var walkToChest: TPointArray; begin if not isLoggedIn() then exit; walkToChest := [Point(203, 60), Point(198, 101), Point(176, 133), Point(176, 161), Point(174, 182), Point(173, 196)]; if SPS.walkPath(walkToChest) then minimap.waitPlayerMoving() else writeLn('Unable to locate chest'); end; begin clearDebug(); smartPlugins := ['OpenGL32.dll','d3d9.dll']; smartEnableDrawing := true; disableSRLDebug := false; setupSRL(); SPS.setup('Chest', RUNESCAPE_OTHER); progressReport(); until false; end.
There are currently 1 users browsing this thread. (0 members and 1 guests)