Wow, really nice, very good guide thanks
Wow, really nice, very good guide thanks
Simba Code:program uHider;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
var
XP, startingXP, loadsPH, XPH, antibanCount, actAfkCount: integer;
const
DEBUGSCRIPT = false; //Enable if you are having issues running script
procedure declarePlayers;
begin
setLength(players, 1);
with players[0] do
begin
loginName := ''; //Set username here
password := ''; //Set password here
bankPin := ''; //Set PIN here
world := 32; //Set world here
isActive := true;
isMember := true;
end
currentPlayer := 0;
end;
procedure printStatus(Jamc : String; PrintType : Integer);
begin
if DEBUGSCRIPT then
begin
if PrintType = 0 then
print(Jamc, TDebug.SUB);
if PrintType = 1 then
print(Jamc, TDebug.HEADER);
if PrintType = 2 then
print(Jamc, TDebug.SUB);
if PrintType = 3 then
print(Jamc, TDebug.FOOTER);
if PrintType = 4 then
print(Jamc, TDebug.ERROR);
if PrintType = 5 then
writeLn(Jamc);
end;
if not DEBUGSCRIPT then
begin
if PrintType = 0 then
writeLn(Jamc);
end;
end;
procedure logIn;
begin
printStatus('logIn: Starting...', 1);
if not isLoggedIn then
begin
players[currentPlayer].login();
exitTreasure();
minimap.clickCompass();
mainscreen.setZoom(false);
end;
printStatus('logIn: Finished!', 3);
end;
procedure Banking();
begin
if bankScreen.open(BANK_CHEST_LUMBRIDGE) then
bankScreen.clickButton(BANK_BUTTON_PRESET_1) // This deposits, withdraws, and closes the bank
else
writeLn('Couldn''t find the bank for some reason!');
end;
procedure makeHide();
begin
tabBackpack.mouseSlot(1, MOUSE_LEFT);
if toolScreen.isOpen(2000) then
toolScreen.select('Needle');
if productionScreen.isOpen(5000) then
begin
productionScreen.selectBox(3);
productionScreen.clickStart();
if progressScreen.isOpen(5000) then // if progressScreen is open within 5 seconds
begin
writeLn('The progressScreen is open!');
repeat
wait(1000);
until (progressScreen.getButton() <> PROGRESS_BUTTON_CANCEL);
wait(randomRange(1575, 3223));
end;
end;
end;
procedure progressReport;
begin
XP := (chatBox.getXPBar - startingXP);
XPH := round(XP * (3600.0 / (getTimeRunning / 1000.0)));
loadsPH := round((loadsDone * (3600.0 / (getTimeRunning / 1000.0))));
writeln('|===========================================================|');
writeln('| Proggy |');
writeln('|===========================================================|');
writeln(padR('| Running For: ' + timeRunning, 60) + '|');
writeln(padR('| Exp Earned: ' + groupDigits(XP, ','), 40) + padR('Exp/Hour: ' + groupDigits(XPH, ','), 20) + '|');
writeln('|___________________________________________________________|');
writeln('|___________________________________________________________|');
end;
begin
clearDebug;
setupSRL;
repeat
LogIn;
Banking;
makeHide;
progressReport;
until(false);
terminateScript;
end.
Well, my first ever attempt at trying to UNDERSTAND simba, not code. I took snippets from various scripts to see if I could make a green d'hide body maker. It's not amazing and technically I shouldn't really deserve to be credited at all for this, but it is a start
I don't want to be a leecher no more :3
Thanks Mayor <3
This tutorial has helped me immensely. I'm currently working on my first few scripts, thank you Mayor!
In the section of your guide when you talk about SPS walking you have:
Simba Code:SPS.setup('CLAY_MAP' , RUNESCAPE_OTHER);
I have seen in some scripts where they add in numbers to adjust tolerance and variability like this:
or at least something along those lines. Could you explain that or add it to the guide?Simba Code:SPS.setup('CLAY_MAP' , RUNESCAPE_OTHER, 3, 500, 0.5);
I was also wondering about how often you should place a dot when doing the path? Would dots being closer make it more accurate or does that just lag things down?
Thanks!
This is a fantastic tutorial! I should be posting in My First Script pretty soon!![]()
Thank you for the amazing tutorial!
I want to try to make my first scipt but i have no idea, what kind of script i should make.
I'll be looking through some request topics to get some idea's otherwise i just try to make some thing useless like a potato picker
Don't let @Wetish; hear you say that!
& no script is useless, not as long as you gain valuable knowledge and insight from 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
The tutorial's very profound! Well, maybe too profound for a newbie like me, but I still got a lot of ideas from this one! Thanks a lot!
P.S. I've been to the other thread called Simplistic Beginners Guide too. :P
My public scripts:
Varrock Miner | Clay Miner | Wine Drinker & Jug Filler | Lumby Vial Filler | Flax Pick N' Spin | Safe Cracker | Winestall Stealer | Pastry Dough Maker | Clay Softener
@The Mayor;
I am trying to implement my script to unlock all lodestones. Using SPS mapping to get around would it be best (or even possible) for me just to use a picture of the full world map or should I just add in individual minimap captures?
Ex. Could I just take a Snippet of the entire area (keeping it as zoomed in as possible) going to add picture shortly.
Attachment 25244
Edit: After reading through it again I don't think this will work, thought i'd double check though because it would save some time! Thanks.
Last edited by Clutch; 03-10-2015 at 03:19 AM.
@Incurable;
Cannot find his lodestone unlocker. That being said i've encountered quite a few errors but found workarounds. At this point though I can't seem to get multiple SPS maps to load properly. Ex. Can't walk from 1 SPS and then continue on with the next SPS even though they both exist and are both getting called on. Individually they both work fine.
Last edited by Clutch; 03-10-2015 at 04:51 AM.
@The Mayor;
Hrm :/ that being said, could you assist me in calling in multiple SPS.png files?
Simba Code:procedure WTL1();
var
WTL1: TPointArray;
begin;
SPS.setup('WTL1',RUNESCAPE_OTHER); //WTL1 map
WTL1 := [Point(230, 154), Point(221, 197), Point(215, 244), Point(208, 296), Point(200, 344)];
if SPS.walkPath(WTL1) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
procedure WTL2();
var WTL2: TPointArray;
begin;
clearDebug(); // Clear the debug box
if isloggedin() then
begin;
//SPS.setup('WTL2',RUNESCAPE_OTHER); //WTL2 map
WTL2 := [Point(200, 344),Point(221, 252), Point(219, 275), Point(185, 307), Point(165, 341)];
if SPS.walkPath(WTL2) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
end;
Right now that walks from burth lode down to tav lode but I can't have it won't continue on if I have them both being called on, it gives me the error like it hasn't loaded the image. Is there a way to at least free up the sps before I load it?
You can have as many TSPSAreas as you want, e.g.
as long as you declare them as variables first there shouldn't be a problem.Simba Code:SPS1.setup('WTL1',RUNESCAPE_OTHER);
SPS2.setup('WTL2',RUNESCAPE_OTHER);
SPS3.setup('WTL3',RUNESCAPE_OTHER);
I'd recommend naming them something other than SPS though, like:
then just use it like so:Simba Code:Taverly.setup('WTL1',RUNESCAPE_OTHER);
Simba Code:Taverly.walkPath(WTL1);
So it would look something like this:
Simba Code:procedure WTL1();
var
WTL1: TPointArray;
Taverly: TSPSArea;
begin;
Taverly.setup('WTL1',RUNESCAPE_OTHER); //WTL1 map
WTL1 := [Point(230, 154), Point(221, 197), Point(215, 244), Point(208, 296), Point(200, 344)];
if Taverly.walkPath(WTL1) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
procedure WTL2();
var
WTL2: TPointArray;
Falador: TSPSArea;
begin;
clearDebug(); // Clear the debug box
if isloggedin() then
begin;
Falador.setup('WTL2',RUNESCAPE_OTHER); //WTL2 map
WTL2 := [Point(200, 344),Point(221, 252), Point(219, 275), Point(185, 307), Point(165, 341)];
if Falador.walkPath(WTL2) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
end;
@evilcitrus;
I suppose I am confused. When I try to rename them I get unknown declaration "Taverly", you mentioned to declare them as variables though, how do I declare Taverly is = to SPS?
Simba Code:procedure WTL1();
var
WTL1: TPointArray;
WTL2: TPointARRAY;
Taverly:= SPS;
Taverly2:= SPS;
begin;
Taverly.setup('WTL1',RUNESCAPE_OTHER); //WTL1 map
WTL1 := [Point(230, 154), Point(221, 197), Point(215, 244), Point(208, 296), Point(200, 344)];
if Taverly.walkPath(WTL1) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
begin;
Taverly2.setup('WTL2',RUNESCAPE_OTHER); //WTL2 map
WTL2 := [Point(200, 344),Point(221, 252), Point(219, 275), Point(185, 307), Point(165, 341)];
if Taverly2.walkPath(WTL2) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
end;
Last edited by Clutch; 03-10-2015 at 05:53 AM.
If you see the edit's I made that gave me the exact same results as changing them to TSPSArea. It picks them up, but once it gets to the 2nd one, it just blasts through the points but doesn't actually click. I'm not 100% sure but I think this may be due to me not having a wait function?
It's hard to say without seeing it in action, but it could be a waiting issue. I usually add short (300-400ms) waits before and after minimap.waitPlayerMoving().
Also I'd keep WTL1 and WTL2 as separate procedures. It's cleaner and allows you to isolate issues more easily.
Simba Code:procedure Taverly1;
var
WTL1: TPointArray;
Taverly: TSPSArea;
begin;
Taverly.setup('WTL1',RUNESCAPE_OTHER); //WTL1 map
WTL1 := [Point(230, 154), Point(221, 197), Point(215, 244), Point(208, 296), Point(200, 344)];
if Taverly.walkPath(WTL1) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
procedure Taverly2;
var
WTL2: TPointARRAY;
Taverly2: TSPSArea;
begin;
Taverly2.setup('WTL2',RUNESCAPE_OTHER); //WTL2 map
WTL2 := [Point(200, 344),Point(221, 252), Point(219, 275), Point(185, 307), Point(165, 341)];
if Taverly2.walkPath(WTL2) then
minimap.waitPlayerMoving()
else
writeLn ('Failed to walk');
end;
Begin;
clearDebug();
smartEnableDrawing := true;
setupSRL();
if isloggedin() then
begin;
//lodestoneSetup();
Taverly1;
Taverly2;
end
else
begin
createPlayer;
SkipTutorial();
interfaceSetup();
lodestoneSetup();
end;
end.
Sorry was trying to clean up the code so it wasn't so jumbled. This is basically what I have right now. Start anywhere near burthrope lodestone, it'll run south til it gets to about the cow pen and then runs through Taverly2; (at least in the debug) it doesn't actually click to those points though.
Is it writing "Failed to walk" or does it think it walked successfully?
Simba Code:---- Setup area "WTL1" in 16ms
-- .init()
-- .getPlayerPos(): result = {X = 198, Y = 326}, took 141 ms
---- Waiting while the player is moving...
-- .walkPath(): result = True
---- Waiting while the player is moving...
-- .init()
---- Path exists (C:\Simba\Includes\SPS\img\runescape_other\WTL2.png)
---- Setup area "WTL2" in 16ms
-- .init()
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .getPlayerPos(): result = {X = 214, Y = 150}, took 156 ms
-- .walkPath(): result = False
Failed to walk
-- Succesfully freed SMART[2812]
Successfully executed.
Okay so your first path point in WTL2 is [200, 344], but SPS is saying your position is [214, 150]. The Y position is way off, probably because your WTL2.png file is too small. Try expanding your map by ~20%.
Oh holy crap I am such an idiot. Realized what you were talking about but then when I changed it it still didn't work. Went back and compared my sps file to where I end and I AM WAY OFF! Fixing right now! Thanks a ton haha!
So, question I double checked it was in the correct location but my first input is still way off in relation to my player position. Ex. player position is X=270, Y=74 but from the SPS I created AT THE EXACT location I'm standing on it chooses point 31,183...
Proof:
Attachment 25249
@evilcitrus;
Please don't tell me I'm gonna have to manually input each coordinate...
Last edited by Clutch; 03-10-2015 at 07:08 AM.
I'm not very familiar with SPS and haven't used it much so I'm probably not the best person to be helping with this. I've always solved my SPS problems by making my map bigger. I'd say expand your map so that your points aren't so close to the edges. I gotta get some sleep so hopefully you can figure it out or someone else can help.
There are currently 1 users browsing this thread. (0 members and 1 guests)