SRL Archive - RuneScape News and General

Minigames Spotlight


yourule97

2015-05-05 19:38:48

Information: http://www.reddit.com/r/runescape/comments/34yy0o/tldw_065_qa_minigames_spotlight/

Heres what I got from that thread (shortening a TL:DW thread :p)

  • "Thalners" can now be earned while playing minigames
  • Minigames rotate in and out of a "spotlight"
  • Items in the spotlight will grant Thalners at around 5x the base pace
  • Thalners can be redeemed for items such as silverhawks, set pieces, etc
  • A few treasure hunter items will be available for a limited time
  • A complete list of items is available in the thread

Here are a few questions to get started: Is it time to start writing minigame bots? What items should be obtained first? Can money be made selling notepaper and feathers?

Personally, I'm a lazy piece of crap so I really want those silverhawk boots. Writing agility scripts are not my thing, and I'd rather get 75 agility (for plagues end and 77 for the course) with no effort in a long period of time than suck it up and do it legit in what would probably be a few hours haha.

Clutch

2015-05-05 20:51:04

From: yourule97
Information: http://www.reddit.com/r/runescape/comments/34yy0o/tldw_065_qa_minigames_spotlight/

Heres what I got from that thread (shortening a TL:DW thread :p)

  • "Thalners" can now be earned while playing minigames
  • Minigames rotate in and out of a "spotlight"
  • Items in the spotlight will grant Thalners at around 5x the base pace
  • Thalners can be redeemed for items such as silverhawks, set pieces, etc
  • A few treasure hunter items will be available for a limited time
  • A complete list of items is available in the thread

Here are a few questions to get started: Is it time to start writing minigame bots? What items should be obtained first? Can money be made selling notepaper and feathers?

Personally, I'm a lazy piece of crap so I really want those silverhawk boots. Writing agility scripts are not my thing, and I'd rather get 75 agility (for plagues end and 77 for the course) with no effort in a long period of time than suck it up and do it legit in what would probably be a few hours haha.


I was thinking of making a minigame script - haven't delved into it quite yet. Although for agility I personally did barbarian fishing. Think I got 77 agility getting to 98 fishing.

Vocalss

2015-05-06 06:36:19

Yeah, barbarian fishing is a nice way to get some agility levels, i got from 20-66 and im only 91 fishing at the moment.

Citrus

2015-05-06 12:20:05

I'll be at PC 24/7 for the double point weekend and during the spotlight. I really want those boots too.

Clarity

2015-05-18 09:14:53

The update hit today, it's actually amazing for botting various achievements. Silver hawk feathers are also part of the stock, albeit untradeable. 120 agility while getting trim reqs here I come!

yourule97

2015-05-18 09:56:54

Oh god, even though I made this thread, I still forgot about making a pest control script. Facepalming so hard right now. I need those boots ugh. Time to try and make a color pest control bot.

mocrosoft

2015-05-18 10:18:41

From: Clarity
The update hit today, it's actually amazing for botting various achievements. Silver hawk feathers are also part of the stock, albeit untradeable. 120 agility while getting trim reqs here I come!


Claritiy indeed! :D

Citrus

2015-05-18 14:50:33

From: yourule97
Oh god, even though I made this thread, I still forgot about making a pest control script. Facepalming so hard right now. I need those boots ugh. Time to try and make a color pest control bot.


You can make a 100% functional PC script using SRL-6 and almost zero color finding. Mine is 250 lines :p

Follow the other players (with minimap.getDots()) to whichever portal you want to start at, then use MM2MS() to attack the pests. The only color finding I use is looking for the green text that let's you know you have enough damage. I use minimap.findSymbol() to determine whether I'm in the minigame or not.


function TPoint.MM2MS(): TPoint;
var
a, b, c, d, e, f, g, h: extended;
x: TExtendedArray;
begin
x := [
3.41898284234469, // a = fixed scale factor in X direction with scale Y unchanged.
-0.842020268789697, // b = scale factor in X direction proportional to Y distance from origin.
-2101.27407475151, // c = origin translation in X direction.
-0.0150738403260808, // d = scale factor in Y direction proportional to X distance from origin.
2.58817766359727, // e = fixed scale factor in Y direction with scale X unchanged.
-162.127294292026, // f = origin translation in Y direction.
-0.000237848858259821, // g = proportional scale factors X and Y in function of X.
-0.00286437539759803 // h = proportional scale factors X and Y in function of Y.
];

a := x[0]; b := x[1]; c := x[2]; d := x[3];
e := x[4]; f := x[5]; g := x[6]; h := x[7];
result.x := round((a*self.x + b*self.y +c)/(g*self.x + h*self.y +1));
result.y := round((d*self.x + e*self.y +f)/(g*self.x + h*self.y +1));
end;

yourule97

2015-05-18 17:31:55

From: evilcitrus
You can make a 100% functional PC script using SRL-6 and almost zero color finding. Mine is 250 lines :p

Follow the other players (with minimap.getDots()) to whichever portal you want to start at, then use MM2MS() to attack the pests. The only color finding I use is looking for the green text that let's you know you have enough damage. I use minimap.findSymbol() to determine whether I'm in the minigame or not.


function TPoint.MM2MS(): TPoint;
var
a, b, c, d, e, f, g, h: extended;
x: TExtendedArray;
begin
x := [
3.41898284234469, // a = fixed scale factor in X direction with scale Y unchanged.
-0.842020268789697, // b = scale factor in X direction proportional to Y distance from origin.
-2101.27407475151, // c = origin translation in X direction.
-0.0150738403260808, // d = scale factor in Y direction proportional to X distance from origin.
2.58817766359727, // e = fixed scale factor in Y direction with scale X unchanged.
-162.127294292026, // f = origin translation in Y direction.
-0.000237848858259821, // g = proportional scale factors X and Y in function of X.
-0.00286437539759803 // h = proportional scale factors X and Y in function of Y.
];

a := x[0]; b := x[1]; c := x[2]; d := x[3];
e := x[4]; f := x[5]; g := x[6]; h := x[7];
result.x := round((a*self.x + b*self.y +c)/(g*self.x + h*self.y +1));
result.y := round((d*self.x + e*self.y +f)/(g*self.x + h*self.y +1));
end;


Fascinating code! So far I've written much of the simple methods like getting on the boat and waiting, but I'm having trouble understanding what your code does. Are those numbers a range of color values? Sorry if I'm not understanding, this is the first time I've seen something like this. Anyways, I'm going to throw something together that'll assume your method returns a point with a mob in it and see what happens.

Citrus

2015-05-18 17:45:48

From: yourule97
Fascinating code! So far I've written much of the simple methods like getting on the boat and waiting, but I'm having trouble understanding what your code does. Are those numbers a range of color values? Sorry if I'm not understanding, this is the first time I've seen something like this. Anyways, I'm going to throw something together that'll assume your method returns a point with a mob in it and see what happens.


It's a more accurate version of minimap.pointToMainscreen(). It takes a tpoint from the minimap and maps it to a tpoint on the mainscreen. So you'd use minimap.getDots() to get a tpa, then do something like
p := tpa[0].MM2MS();
to get a point on the mainscreen where the NPC is.

You'll probably need to use fastMouse() (modified fastClick). I don't think mouse() would be fast enough.

procedure fastMouse(p: TPoint; button: integer);
var
x, y: integer;
begin
if (button = MOUSE_MOVE) then
begin
moveMouse(p.x, p.y);
exit();
end;
holdMouse(p.x, p.y, button);
wait(gaussRangeInt(60, 150));
getMousePos(x, y);
releaseMouse(x, y, button);
end;

Clarity

2015-05-18 18:01:41

From: evilcitrus
It's a more accurate version of minimap.pointToMainscreen(). It takes a tpoint from the minimap and maps it to a tpoint on the mainscreen. So you'd use minimap.getDots() to get a tpa, then do something like
p := tpa[0].MM2MS();
to get a point on the mainscreen where the NPC is.

You'll probably need to use fastMouse() (modified fastClick). I don't think mouse() would be fast enough.

procedure fastMouse(p: TPoint; button: integer);
var
x, y: integer;
begin
if (button = MOUSE_MOVE) then
begin
moveMouse(p.x, p.y);
exit();
end;
holdMouse(p.x, p.y, button);
wait(gaussRangeInt(60, 150));
getMousePos(x, y);
releaseMouse(x, y, button);
end;

If you're dissatisfied with mouse speed why not just edit the mouse speed variable before and after certain methods?

yourule97

2015-05-18 18:12:34

Ahh, it's short for Minimap to MainScreen. Thanks! I'll fiddle more around with it.

Citrus

2015-05-18 18:13:06

From: Clarity
If you're dissatisfied with mouse speed why not just edit the mouse speed variable before and after certain methods?


Why move the mouse at all when you can make it appear anywhere instantly? Besides, I don't like the way that mouse() moves, especially at higher speeds.

yourule97

2015-05-18 19:11:49

Thanks for the help! I have a rudimentary one working now.

adc

2015-05-19 03:30:57

From: yourule97
Thanks for the help! I have a rudimentary one working now.


Would you be willing to post your base? I'm interested in working on it, but I don't feel like building my own base :P.

yourule97

2015-05-19 09:42:48

I mean, I'd be happy to help you make your own, but seeing how evilcitrus literally just helped me work on this script by giving like 70% of the logic and helping me understand the code, I feel it would be against the learning nature of this forum to just give out what I just spent over an hour working on.

Also, I'm still not entirely happy with the code. It's rudimentary, doesn't recognize when it's already in battle, and only runs for about an hour or so before messing up. It's a work in progress.

Citrus

2015-05-19 11:47:11

From: yourule97
doesn't recognize when it's already in battle


Here is the function I use for that. I'm pretty sure I got it from the Mayor's gelatinous abomination script.

function checkLock(waitTime: integer = 500): boolean;
var
x, y: integer;
t: longWord;
begin
if not isLoggedIn() then exit();
result := false;
t := (getTimeRunning() + waitTime);
repeat
if findDTM(lockDTM, x, y, mainscreen.getBounds) then
result := true
else
wait(randomRange(40, 70));
until (getTimeRunning() >= t) or (result);
end;

and the dtm:
lockDTM := DTMFromString('mwQAAAHic42RgYPjKBMGfgPgjlAbxfwLxbyD+DsTbgerWAfFGBgh7NxIG8TcB8ZWpqgwHFgcybOowZ7g1U5Nhfxc/HAtLyjPYuPszsALVEcKMRGA4AAD8TBrM');

You obviously need target information locked for this to work, or if you want it unlocked you'll have to make your own DTM of the open lock.

You can add something like

if checkLock(1000) then exit();
to the beginning of all your procedures

yourule97

2015-05-19 11:55:47

Thanks for the help again! Yeah, I was actually reading through Bonsai's combat script when I reread that part about searching for the gold lock. I think it wasn't working before because I forgot to actually lock the lock. Silly me

adc

2015-05-19 16:24:25

From: yourule97
I mean, I'd be happy to help you make your own, but seeing how evilcitrus literally just helped me work on this script by giving like 70% of the logic and helping me understand the code, I feel it would be against the learning nature of this forum to just give out what I just spent over an hour working on.

Also, I'm still not entirely happy with the code. It's rudimentary, doesn't recognize when it's already in battle, and only runs for about an hour or so before messing up. It's a work in progress.


Well, we should all stop using the SRL include then, because obviously we should be learning to code the entire thing ourselves. That's the nature of this forum, after all.

I don't understand this attitude; what's wrong with posting a base for other people to work off of? It would be pretty trivial for me to recreate most of the code you have (especially with most of the logic already laid out in the thread, as you said), it would just take me another hour of time to get it working, which would (in my opinion) be wasted; I wouldn't really learn anything, considering the vast majority of the stuff I'd be doing is using pre-created methods to do things for me (if I can see a minimap symbol, go into the boat. Wait until they're gone. Follow white dots on minimap to portal. Use mm2ms on yellow dots to click mobs). There's no difficulty and nothing to learn if you already know the language, it's just busywork.

If you don't want to post the code because you aren't happy with it or whatever (although I expected it to not be complete; you said that, and I was looking for a base to begin perfecting), that's your prerogative and I can't fault you for that, but this attitude of "it's for your own good, you need to learn how to do it!" just feels condescending and annoying.

Citrus

2015-05-19 16:51:14

From: adc
Well, we should all stop using the SRL include then, because obviously we should be learning to code the entire thing ourselves. That's the nature of this forum, after all.

I don't understand this attitude; what's wrong with posting a base for other people to work off of? It would be pretty trivial for me to recreate most of the code you have (especially with most of the logic already laid out in the thread, as you said), it would just take me another hour of time to get it working, which would (in my opinion) be wasted; I wouldn't really learn anything, considering the vast majority of the stuff I'd be doing is using pre-created methods to do things for me (if I can see a minimap symbol, go into the boat. Wait until they're gone. Follow white dots on minimap to portal. Use mm2ms on yellow dots to click mobs). There's no difficulty and nothing to learn if you already know the language, it's just busywork.

If you don't want to post the code because you aren't happy with it or whatever (although I expected it to not be complete; you said that, and I was looking for a base to begin perfecting), that's your prerogative and I can't fault you for that, but this attitude of "it's for your own good, you need to learn how to do it!" just feels condescending and annoying.


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.

yourule97

2015-05-19 16:56:25

From: adc
Well, we should all stop using the SRL include then, because obviously we should be learning to code the entire thing ourselves. That's the nature of this forum, after all.

I don't understand this attitude; what's wrong with posting a base for other people to work off of? It would be pretty trivial for me to recreate most of the code you have (especially with most of the logic already laid out in the thread, as you said), it would just take me another hour of time to get it working, which would (in my opinion) be wasted; I wouldn't really learn anything, considering the vast majority of the stuff I'd be doing is using pre-created methods to do things for me (if I can see a minimap symbol, go into the boat. Wait until they're gone. Follow white dots on minimap to portal. Use mm2ms on yellow dots to click mobs). There's no difficulty and nothing to learn if you already know the language, it's just busywork.

If you don't want to post the code because you aren't happy with it or whatever (although I expected it to not be complete; you said that, and I was looking for a base to begin perfecting), that's your prerogative and I can't fault you for that, but this attitude of "it's for your own good, you need to learn how to do it!" just feels condescending and annoying.



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.

adc

2015-05-19 18:58:24

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.