From: evilcitrus
It would take about 15 minutes to write a functioning script if you know how to do it. It's three procedures, ~20 lines each. Then you just have to tweak it while it runs, which might take another 30 minutes.
Personally, I wouldn't use a 'base' script unless I was stuck on something, and even then I would just prefer a nudge in the right direction. It would take me longer to sort through someone else's logic than to simply write my own version.
Also, you're trying to compare SRL to a functional script. SRL is a set of tools, much like the three functions that I posted. On their own they're useless; you have to know how to use them.
And that's still close to an hour spent redoing something someone else has done. I don't see a point in spending that time when someone else has already done it and I can read and comprehend their code in a few minutes (assuming I even need to; if the code already works flawlessly, then I don't even have to touch it, let alone look at how it works in depth), assuming it's formatted well and follows accepted standards.
If you want to be super technical about it, anything can be described as a tool. This code (taken from someone's protean plank maker, whose name escapes me at this moment):
procedure CompactBanker();
begin //Note to self: Direction cords need to be added to top for an easier fix
case players[currentPlayer].strings[1] of
'North': begin MouseOval(299,111,20,20,Mouse_Move); if IsMouseOverText(['Bank','hest','nker'], 777) then begin fastclick(mouse_left); end; end;
'East': begin mouseOval(356,180,15,15,Mouse_Move); if IsMouseOverText(['Bank','hest','nker'], 777) then begin fastclick(mouse_left); end; end;
'South': begin mouseOval(281,283,30,30,Mouse_Move); if IsMouseOverText(['Bank','hest','nker'], 777) then begin fastclick(mouse_left); end; end;
'West': begin mouseOval(185,180,25,25,Mouse_Move); if IsMouseOverText(['Bank','hest','nker'], 777) then begin fastclick(mouse_left); end; end;
'ShantyPass': begin if not bankScreen.open(BANK_CHEST_SHANTAY) then begin mouseOval(378,197,30,30,Mouse_Move); if IsMouseOverText(['Shantay c', 'y chest'], 777) then fastclick(mouse_left); end; end;
'Burthrope': begin if not bankScreen.open(BANK_TABLE_BURTHORPE) then begin mouseOval(376,193,30,30,Mouse_Move); if IsMouseOverText(['ank', 'booth'], 777) then fastclick(mouse_left); end; end;
'Combat Academy/Lumbrdige': begin if not bankScreen.open(BANK_CHEST_LUMBRIDGE) then begin mouseOval(376,193,30,30,Mouse_Move); if IsMouseOverText(['ank', 'hest'], 777) then fastclick(mouse_left); end; end;
end;
wait(RandomRange(300, 500));
if pinScreen.isOpen() then
pinScreen.enter(Players[currentPlayer].bankPin);
if (openBank()) then
begin
wait(RandomRange(400, 700));
if Not bankScreen.isOpen() then
begin
WriteLn('Failed to open the bank.');
exit;
end;
end;
if bankScreen.isOpen() then
begin
WriteLn('Successfully opened the bank!');
if bankScreen.clickButton(BankPreset) then
LogsDone := LogsDone + 28;
end;
wait(RandomRange(200,800));
end;
Opens your bank using predefined boxes and some SRL commands. But it would be totally possible to take this, modify a line or two and slap it in another script without having to spend time rewriting all the logic in the other script for banking. What differentiates between this procedure and a "functional script"? Hell, Bonsai's autofighter already fits both very easily - it can run on it's own or be included in another script without any modification. In the end all code can easily be packaged as an include, it's just about what level you're working at it with - you don't normally work directly with code inside of an include (unless you're developing it), you just call the commands, whereas you do with a "functional script", creating the logic and such yourself.
From: yourule97
Woah woah there man, I completely understand what you are saying, but I hope I can take a step back and explain myself and clarify my thinking when I wrote that post.
- I misunderstood what you meant by "base" of the program because the "base" to me was the core functionality of the program as it was what I had struggled with in the past, which was how to detect NPC's and fight them. As I said in my original post, evilcitrus was core in granting me the code so that I could complete the later steps.
- Those later steps were also the majority of the time I spent the code, trying to see what alterations worked best (messing around with mousespeed, making the mouse appear instantly, etc) and I'm not exactly sure how to put this but, I was trying to solve a challenging problem on my own time to see if I could do it with my own limited knowledge. I did this because I noticed that evilcitrus did not post his solution but provided me with tools to do so, and I took that as an initiative and try to make my own as well as to challenge myself.
- Therefore, I felt that posting what I mistakenly thought you wanted, was like posting an incomplete proof to a, I dunno, complicated problem and passing it off as correct like a fool.
It's too bad that all of this thinking was wrong because after reading your post, I gather that you just want the basic "get on boat" and waiting procedures which is absolutely fine. I'll also apologize in advance if my words were formulated in a way that could have been taken condescendingly, but I hope you can find that it wasn't mean to be like that in any way. I also did not mean to sound like you should "waste your time" writing those procedures because, again, that vast majority of the estimated coding time of "one hour" was spent on editing and refining the mouse method rather than implementing the simple procedures.
I'm still relatively new to SRL/Villavu and my time with Computer Science has also been pretty short, so I hope you can also understand that when someone who I have never seen on the forum comes out of nowhere in the middle of a thread and starts asking for my crappy code, that I might also be a bit confused and/or standoffish (maybe too harsh a word?).
Anyways, if you still want the base of my code, PM and I'd be happy to send it over.
Oh I understand you weren't attempting to be condescending (I'm sorry if it came across that way), that's just how that type of attitude makes me feel, even if the person in question quite obviously doesn't mean it that way. I just see it all over; I've even seen the very occasional script posted saying basically "This script is broken on purpose, you can go figure out how to fix it if you want to use it. The learning is good for you!"
Anyway, it's probably just a large difference of opinion between the way I think things should work and the way the rest of the community does. Again, I'm sorry if anything I said came across as insulting; I was definitely being snarky, but that wasn't my intention.