SRL Archive - RS3 Outdated / Broken Scripts

WAR - WildyAgilityRunner


Er1k

2012-05-12 12:00:12

Status: First beta release - Babysitting required


This is the much awaited Wilderness Agility Course Runner that has been requested for months. I have given my try on it - it is by no means robust, but at least it works rather well on my end.

Development post - http://villavu.com/forum/showthread.php?t=81930

Thanks to pulse0 for lending me an account for extensive testing. Without the account, development would have been stalled greatly due to me botting Runespan on my main ;)

Read the following and understand these:
- It is slow, but it works. XP/H is variable as to how badly you fail the obstacles. Expect 20K or below if you fail hard, ~25K if you're doing so-so, ~30K if you're lucky.
- If any of the objects does not find, you are expected to fix them yourself. Get an ACA tutorial if you don't know how to find colors. You are expected to update your own colors. ACA colors are now available for download. You can use them as a starting point to see what I have done.
- Babysit this at all times - 1. It has bugs. 2. You will die and it doesn't deathwalk. From 52-70 is around 25-30 hours of babysitting, deal with it?
- Script is not cleaned up so it is messy. Some planned features are already added but not integrated to the main flow yet.

Longest running progress report I have:
Time running: 1 Hours, 42 Minutes and 9 Seconds
Exp Gained: 48070
Est XP/H: 28231
Features
- Runs off DDTM, no SPS required
- Recovers from falling into the pit to ensure full course XP
- Success detection using XP gain
- Eats food at specified HP
- Progress Report
- Logout to lobby on Death
- Start anywhere in the course
- Additional location finder failsafe

Suggestions
- Deathwalk (someone needs to inspire me how to do it)

Known Bugs
- Slow
- Failure to recognize it's completed the log obstacle
- Failure to recognize some objects (e.g. Swing, Dungeon Ladder)
- Escape from dungeon is slow
- Death detection does not always detect correctly (Will add edgeville detection later)
- Lag will destroy the logic flow

Questions for thought
- Are there randoms in Wildy?

If you run into a bug that has nothing to do with object detection in general (that means, update your colors!), let me know and tell me exactly how you get it. It will be vital to be specific as I am as much as clueless as you may be when it comes to bugs. If you want the script to help you, help the developer.

It will be updated as I see fit and continuously work on it. I don't expect to finish the deathwalk anytime soon unless I figure out SPS custom maps (or someone gives me his work :)) or another way to walk the path. Otherwise, you should really take your character there, and babysit it.

Setup
You need to do a few things to setup the script correctly.

The script uses a custom include DDTM.simba, for which you can download here. Create new folder "custom" in C:\Simba\Includes\, and put DDTM.simba into C:\Simba\Includes\custom\

  //Player Setup
HEAL_AT = 300;
FOOD_DTM = 'mggAAAHicY2NgYChlYmAoA+JKIG4E4moofzkQzwHiBUA8D8pfD8S7rKWBupgwMBcDdsCIA0MAAA5cB/Y='; //put food dtm string here

//DDTM Setup
PIT_BLACK = 66566;
LOG_BROWN = 2049116;
DOOR_RED = 1009;
OUTLINE_WHITE = 16049649;

Player setup is self explanatory. Colors for the DDTM used for positioning are here. In case you're wondering how the DDTM actually looks like, here it is for your good.
Red shows the subpoints of DDTM. Hence the colors required.

Now the object setup - I will show an example here. Most of the variables here are self-explanatory. For those who are paranoid of skulling by left-clicking, set left to false. Not all objects are default to false for slight increase of speed ;)
  //Pipe
with courseObjs[0] do
begin
color:= 6447197;
tol:= 18;
hmod:= 0.25;
smod:= 0.05;
w:= 20; h:= 20; minc:= 100; maxtry:= 3;
uptexts:=['rou'];
options:=['rou'];
left:=true;
end;

Most likely you don't have to do anything but to put a DTM of the food you're using to get it to work. But if you want to tweak, you now know what to do :)

Safety in Wilderness
I must stress that PKers are very common in this area. I have died numerous times while testing the script there. Only bring what you can afford to lose. It might be a smart idea to bring one piece of armor (e.g. dhide body) and whatever you feel like (I suggest 3-iteming).

To avoid skulling due to left-misclicking, you can bring a bow without ammo, or tweak the object settings in the script to use right-click for all objects.

How you can help
- Report bugs and come back with progress reports
- If you have a reliably working deathwalk from deserted keep to the course entrance, PM me and we can work on adding it to the script

RSGP donations are accepted - I could only work on this quickly with a borrowed account from pulse0, who's been very generous to let me on his account for already a week to get this to work. Donation proceeds will go to purchasing membership and development of scripts that will eventually go back to the community :) PM me for more details.

pulse0

2012-05-12 12:03:44

ill give this a try now, will post some feedback.

looks great btw

Er1k

2012-05-12 12:04:54

You might be happy to know that your lended character has gained quite a few agility levels during the process.

Night guys. I'm gonna peace out. Will get back to whatever's wrong tomorrow.

stuartroad

2012-05-12 17:29:50

Excellent, I wanna do this now but I am also doing runespan! :(

ne lg

2012-05-12 18:39:37

Will try this out extensivley when i reach 42 agil :P

Was acctually pretty excited when i saw this thread, i was planning out my 99 agility and noticed a massive hole the scripts from like 40-85 (No ape atoll for my skiller)

Thanks a bunch for doing this, it's very much appreciated, Im finishing up with runespan this week then will be agilitying it up.

Last Legend

2012-05-12 19:26:40

Definitely will use this on my new pure, gotta get that crystal bow to look pimpin ;)

S7U

2012-05-12 19:29:58

Nice release Er1k thanks! :D

Ketan

2012-05-13 07:05:04

Ran the script. It seems to work almost correctly. I got sköll boots left and I need to use up 65% charge.

It just exit when it fell down the log balance.

Er1k

2012-05-13 07:16:08

From: Ketan
Ran the script. It seems to work almost correctly. I got sköll boots left and I need to use up 65% charge.

It just exit when it fell down the log balance.


What happened after it fell down the log? It should have recovered.

Ketan

2012-05-13 08:49:36

From: Er1k
What happened after it fell down the log? It should have recovered.


It didn't recover and the skeleton kept on hitting me.

Er1k

2012-05-13 08:59:15

Will look into it. Last time I checked it worked :(

What did the log say? Does it detect being in dungeon? Does it say about failing the obstacle as well?

E: Confirmed to be still working on my end. Failed log balance twice and escaped successfully.
E2: Silent update to fix a compiling error.

Time running: 1 Hours, 13 Minutes and 13 Seconds
Exp Gained: 30855
Est XP/H: 25284

Ketan

2012-05-14 07:52:16

After crossing the rope swing it takes a long delay in recognizing xp gain. Fix it, and XP per hour will increase by like 5k XP.

Also, if it fails to do the stepping stones, it just leaves it resulting in no bonus xp in the end.

Er1k

2012-05-14 08:15:44

From: Ketan
After crossing the rope swing it takes a long delay in recognizing xp gain. Fix it, and XP per hour will increase by like 5k XP.


Change the wait times after the XP gain. It's coded that way to prevent a misclick.

Also, if it fails to do the stepping stones, it just leaves it resulting in no bonus xp in the end.


Again this is never seen in my testing. Did it just skip the stepping stones altogether and head straight towards the log balance?

Ketan

2012-05-14 10:54:24

From: Er1k
Change the wait times after the XP gain. It's coded that way to prevent a misclick.



Again this is never seen in my testing. Did it just skip the stepping stones altogether and head straight towards the log balance?

When you do the stepping stones, you have a slight chance that you'll fall into the lave. If it happens, then it skips it.

Er1k

2012-05-14 11:49:04

From: Ketan
When you do the stepping stones, you have a slight chance that you'll fall into the lave. If it happens, then it skips it.


I might have found a possible cause for this, but I need your logs to be sure. Can you post what the console says before and after it fails the lava steps?

Silent updated to address what the problem may be. Thank you for reporting the bugs :) I'll keep looking at it.

E: Finally got a failure after testing for 45 minutes. Your log should look like this if it fails the lava steps and recovers correctly.

current action is lava
HP low
No food
init xp is 82666325
2
atpa[0]: 6
atpa[1]: 120
objfind success!
failure message detected!
distance is 10
init xp is 82666325
2
atpa[0]: 1
atpa[1]: 19
atpa[2]: 14
atpa[3]: 27
atpa[4]: 74
objfind success!
success message detected!
XP gain detected!
DoObstacle: True
HP low
No food
current action is log
HP low
No food
140
init xp is 82666345
3
distance is 62
dxdy: 15 13

Ketan

2012-05-14 12:07:32

I've fixed fell off log balance issue and lava steps issue already. It's flawless now.

dubestone

2012-05-14 12:47:50

i can't even seem to understand how to et the script running, let alone set it up…I can't find the loc of the script

theadac

2012-05-14 14:03:22

yeah how to get the script running? i created the folder and everythinbg what should i open?

Ketan

2012-05-14 14:21:47

64 agility now. Gonna use this to 70 :)

theadac

2012-05-14 17:55:49

can someone actually take 5 secs and explain to me how to set this up?i did everything created the folder and stuff, when i opên the war beta.sim and run ti says fialed to compile.idk what im doing wrong,
btw im very disappointed i thought simba's community is a good turns out everyone just ignore eachother

Er1k

2012-05-14 20:59:32

From: theadac
can someone actually take 5 secs and explain to me how to set this up?i did everything created the folder and stuff, when i opên the war beta.sim and run ti says fialed to compile.idk what im doing wrong,
btw im very disappointed i thought simba's community is a good turns out everyone just ignore eachother


Post your compiling errors and we may help you.

From: dubestone
i can't even seem to understand how to et the script running, let alone set it up…I can't find the loc of the script


You too. What did you do to set this up?

From: Ketan
I've fixed fell off log balance issue and lava steps issue already. It's flawless now.


Mind telling me the fix as well? So I can hopefully find out the issue? Glad it finally worked for someone.

theadac

2012-05-15 05:24:25

dosent work at ALL teh compiling suceeded and everythong but when i run it in the course,it just clicks in random places. DOSENT WORK -_-

Er1k

2012-05-15 05:34:15

From: theadac
dosent work at ALL teh compiling suceeded and everythong but when i run it in the course,it just clicks in random places. DOSENT WORK -_-


Sorry to hear this mate, but this isn't very helpful. If you can't tell me specifically how it doesn't work, nobody can help you. You might as well try the other wildy agility course.

Ketan

2012-05-15 05:35:47

From: Er1k
Post your compiling errors and we may help you.



You too. What did you do to set this up?



Mind telling me the fix as well? So I can hopefully find out the issue? Glad it finally worked for someone.


For stepping stones you can just check if there is a loss of HP? Since there are no skeletons there, just check if your Hp decreased after you tried that agility part.

Er1k

2012-05-15 06:21:58

That could be done, but it won't be able to differentiate from a PKer attack then.

Slone

2012-05-15 06:34:25

Oooh looks good, ill use this later… try use the last of my hati boots by tomorrow.

Ketan

2012-05-15 09:47:13

From: Slone
Oooh looks good, ill use this later… try use the last of my hati boots by tomorrow.


sköll boots not hati, :P

Ketan

2012-05-15 09:48:42

From: Er1k
That could be done, but it won't be able to differentiate from a PKer attack then.


Check for message then if you get message that fall into the lava something like that, then do it. I use the message+hp thing.

Er1k

2012-05-15 09:52:01

From: Ketan
Check for message then if you get message that fall into the lava something like that, then do it. I use the message+hp thing.


The message is actually already implemented. If you had looked at the code, here's how it's implemented.

function CheckObstacle(success, fail: string): boolean;
var t: integer;
begin
result:= false; //silent update 2
if FindBlackChatMessage(success) or FindBlackChatMessage(fail) then
wait(5000);
MarkTime(t);
repeat
if FindBlackChatMessage(success) then
begin
result:= true;
break;
end;
if FindBlackChatMessage(fail) then
begin
result:= false;
break;
end;
wait(500+random(150));
until TimeFromMark(t) > 10000;
if timefrommark(t) <= 10000 then
if result then
writeln('success message detected!')
else writeln('failure message detected!')
end;


In doobstalce
        'lava' : begin
result:= CheckObstacle('safe', 'fall');
if not result then
begin
wait(1000+random(250));//stall the animation
Exit;
end;
end;

In main loop
      'lava' : begin
if DoObstacle(action) then
action:= 'log'
else
writeln('return to lava');//return to starting lava
end;

I am very interested to know which part actually went wrong because for me, I don't see to get any problems.

Joepetey

2012-05-15 09:52:21

Nice Release!!!

Ketan

2012-05-15 10:06:02

From: Er1k
The message is actually already implemented. If you had looked at the code, here's how it's implemented.

function CheckObstacle(success, fail: string): boolean;
var t: integer;
begin
result:= false; //silent update 2
if FindBlackChatMessage(success) or FindBlackChatMessage(fail) then
wait(5000);
MarkTime(t);
repeat
if FindBlackChatMessage(success) then
begin
result:= true;
break;
end;
if FindBlackChatMessage(fail) then
begin
result:= false;
break;
end;
wait(500+random(150));
until TimeFromMark(t) > 10000;
if timefrommark(t) <= 10000 then
if result then
writeln('success message detected!')
else writeln('failure message detected!')
end;


In doobstalce
        'lava' : begin
result:= CheckObstacle('safe', 'fall');
if not result then
begin
wait(1000+random(250));//stall the animation
Exit;
end;
end;

In main loop
      'lava' : begin
if DoObstacle(action) then
action:= 'log'
else
writeln('return to lava');//return to starting lava
end;

I am very interested to know which part actually went wrong because for me, I don't see to get any problems.


I don't know… Mine works now. Only bug for me now is that when you fall down and get back up off ladder, the time you walk to log balance back, there's a slight chance you'll fail to get at exact position, and it would hover somewhere near rope swing instead of the log. Any idea on fixing this?

S7U

2012-05-17 13:08:43

Script runs well, getting around 25-30k xp/hr although I don't understand how to make a string for the food dtm. If someone could help or explain, it would be much appreciated. I have looked around but can't find a tut or anything, maybe I'm looking for the wrong thing. Thanks

superbuster4

2012-05-17 13:51:37

gota try this im going to see if i can pimp this out and make this baby bank at mage bank.

Er1k

2012-05-17 20:48:06

From: S7U
Script runs well, getting around 25-30k xp/hr although I don't understand how to make a string for the food dtm. If someone could help or explain, it would be much appreciated. I have looked around but can't find a tut or anything, maybe I'm looking for the wrong thing. Thanks


Try the DTM tutorial part of this tutorial - http://villavu.com/forum/showthread.php?t=75826

Or tell me what food you're using and I might get you a DTM if I have time.

S7U

2012-05-18 07:17:08

From: Er1k
Try the DTM tutorial part of this tutorial - http://villavu.com/forum/showthread.php?t=75826

Or tell me what food you're using and I might get you a DTM if I have time.


I tried that, read the whole thing last night couldn't quite get it to work. Will try again now though, im using lobsters thanks for your reply Er1k good script!

Er1k

2012-05-18 08:25:51

From: S7U
I tried that, read the whole thing last night couldn't quite get it to work. Will try again now though, im using lobsters thanks for your reply Er1k good script!


DTMFromString('mrAAAAHic42BgYFjFxMCwAYh3QGkQXgfEa4F4GRBrA7E0ECsAsQoQ6wKxCRCbA7EpEK8OEQeawoQTczHgB4wEMAwAAHkyCCk=');

S7U

2012-05-18 08:36:19

Thanks!

rebeltjeh

2012-05-18 14:33:55

pretty nice but cba to babysit lol, just go no items & full lobs, nothing to lose :)
best script there is for wilderness imoh Thanks!

Gucci

2012-05-18 15:02:55

Very nice script Er1k, most of the time after the rope swing it'll click the right stepping stone to cross the lava but other times it'll walk over to it and hover over the far one for awhile. Still great works awesome except after about an hour I get pked :(

Er1k

2012-05-18 21:05:30

From: Gucci
Very nice script Er1k, most of the time after the rope swing it'll click the right stepping stone to cross the lava but other times it'll walk over to it and hover over the far one for awhile. Still great works awesome except after about an hour I get pked :(


Try fixing the ACA colors. I was a bit lazy on testing that, so you might want to do something about it ;) AFAIK the colors I chose aren't very good for the lava steps, you might just want to redo it.

As for the PKers, why don't we get together some day and kill whoever has a skull in the wildy course later? You probably don't know how much frustration I had in the week when I was there scripting this course, when Pkers were pretty much rampant and I get PKed every 20 minutes :)

K0wned

2012-05-20 10:37:22

This script is fantastic. It's not perfect, but the xp is really good, and its the only agility script that has worked for me. Thanks a lot for the release.

Deus

2012-05-20 12:57:52

Very nice script, ran for a hour or so babysitting today.

Anyone got an updated value for the colour of the lava stepping stones? I've tried playing around with them but haven't found a great value yet.

Gucci

2012-05-20 13:17:11

From: Er1k
Try fixing the ACA colors. I was a bit lazy on testing that, so you might want to do something about it ;) AFAIK the colors I chose aren't very good for the lava steps, you might just want to redo it.

As for the PKers, why don't we get together some day and kill whoever has a skull in the wildy course later? You probably don't know how much frustration I had in the week when I was there scripting this course, when Pkers were pretty much rampant and I get PKed every 20 minutes :)


Yeah I'm too lazy to fix the ACA, still works well enough for use.

Lol whenever I play the wildy course legit always kill the pkers, definitely entertaining especially when you barrage them and they can't move so you finish them off ;)

rudeboy99999

2012-05-22 08:11:48

mine strangely does all up to the lava stepping stones then just keeps doing the lava stones in a continuous loop over and over again.. doesnt fail as i'm 94 agility but wanting to use up all the agility brawlers i have

Er1k

2012-05-22 10:08:59

From: rudeboy99999
mine strangely does all up to the lava stepping stones then just keeps doing the lava stones in a continuous loop over and over again.. doesnt fail as i'm 94 agility but wanting to use up all the agility brawlers i have


Can you post console debug for that point?

Xzzl

2012-05-23 20:52:01

From: Er1k
DTMFromString('mrAAAAHic42BgYFjFxMCwAYh3QGkQXgfEa4F4GRBrA7E0ECsAsQoQ6wKxCRCbA7EpEK8OEQeawoQTczHgB4wEMAwAAHkyCCk=');


I have the same problem :/ if you have spare time can you get me the DTM for monkfish or the food your currently using.

Deus

2012-05-24 01:00:53

From: Xzzl
I have the same problem :/ if you have spare time can you get me the DTM for monkfish or the food your currently using.


Just made this one for monkfish, tested it with an inventory and seems to work fine.

FOOD_DTM = 'mggAAAHicY2NgYLBhYmBwBWJPILYHYmsgtgTiV0C5pwwQ+hEQPwTiF0Cc7+PFYGdmAGQxMQR62jOE+ToxLKyrYeAHimDDjDgwBAAA/cUMWA==';

zxzero

2012-05-26 01:16:50

Awesome script. Works perfectly on my end even after falling. The only thing is that I find it a bit sluggish when looking to see if it has completed each object, this makes it so that the skeletons attack you at the end for a little while, and it cuts back on the exp a bit. Other than that is it flawless, Thanks so much for all the work you put into this. <3

EDIT: Sometimes it does the lava 2 times even though it was successful the first time. Also I don't think it logs out when it is out of food cause I died but kept 3 items that were on me. :P

Er1k

2012-05-26 20:52:23

From: zxzero
Awesome script. Works perfectly on my end even after falling. The only thing is that I find it a bit sluggish when looking to see if it has completed each object, this makes it so that the skeletons attack you at the end for a little while, and it cuts back on the exp a bit. Other than that is it flawless, Thanks so much for all the work you put into this. <3

EDIT: Sometimes it does the lava 2 times even though it was successful the first time. Also I don't think it logs out when it is out of food cause I died but kept 3 items that were on me. :P


Thanks for the bug reports. Log out is only on death but afaik it doesn't work really well. I'll review on an update when I collect enough users reports.

The speed is kept slightly down because I wanted the script just to work. I would want something that works consistently with a slightly slower XP/H for the reliability ;)

RubenPriest

2012-05-27 03:52:41

Awesome script. Works fine! Thank you very much, I've waited so long for this. I really hate agility to train myself :P

tissiposki

2012-05-27 05:26:48

I started using the script today morning, it's great! Just like the previous poster I hate training agility, this helps a lot. Great work :)

K0wned

2012-05-28 17:51:19

Thanks, got me 70.

Inheaven

2012-05-29 12:42:01

Hmm, is doing the lava over and over again? please help? :$

Vispel

2012-05-29 18:30:02

thanks..

Chry

2012-05-29 21:10:13

Nice script.

Er1k

2012-05-29 21:11:22

From: Inheaven
Hmm, is doing the lava over and over again? please help? :$


Post with console debug. I need to know what's wrong if you want me to fix it ;)

zxzero

2012-05-30 00:06:24

From: Er1k
Post with console debug. I need to know what's wrong if you want me to fix it ;)


How do you do the debug, mine sometimes runs the lava over a couple times also. :P Also how can I speed up the wait times after it is done the obstacle? 8-15 seconds is just way to long to wait after it is completed the obstacle. :P

Inheaven

2012-05-30 04:13:10

From: Er1k
Post with console debug. I need to know what's wrong if you want me to fix it ;)


If you can explain me what you need and where i can find it i can help you. Cuz i'm a starter you know, keep it nice and simple for me gehe:)

You mean this? :

return to lava
current action is lava
init xp is 36137207
2
atpa[0]: 101
atpa[1]: 18
atpa[2]: 32
atpa[3]: 35
atpa[4]: 40
atpa[5]: 36
atpa[6]: 59
atpa[7]: 36
atpa[8]: 39
atpa[9]: 2
atpa[10]: 12
distance is 16
dxdy: 18 -48
init xp is 36137207
2
atpa[0]: 77
objfind success!
DoObstacle: False
return to lava
current action is lava
init xp is 36137227
2
atpa[0]: 53
atpa[1]: 6
atpa[2]: 9
atpa[3]: 11
atpa[4]: 25
atpa[5]: 26
atpa[6]: 10
atpa[7]: 10
atpa[8]: 20
atpa[9]: 27
atpa[10]: 80
objfind success!


It keeps saying this over and over again. :$

Er1k

2012-05-30 04:32:28

Great, that is quite useful. I'll look into it when I have some time. Seems to me the success/failure message didn't detect.

init xp is 36137207

init xp is 36137227

Inheaven

2012-05-30 04:42:16

Ok, let me know when you fixed it! :)
It would be great when it is working ;)

Er1k

2012-05-30 04:46:23

From: Inheaven
Ok, let me know when you fixed it! :)


Quick check - did you happen to put game info to All and set public to Off? Or is the chat message not scrolled to the bottom most? It may be reasons.

Inheaven

2012-05-30 04:55:45

Checking it right now.

When i start the script is also gives the following "[hints]"

The following DTMs were not freed: [SRL - Lamp bitmap, 1, 2, 3, 4]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]
[Hint] (255:5): Variable 'DX' never used at line 254
[Hint] (255:5): Variable 'DY' never used at line 254
[Hint] (341:5): Variable 'P' never used at line 340
[Hint] (458:5): Variable 'TPA' never used at line 457
[Hint] (459:5): Variable 'X' never used at line 458
[Hint] (459:5): Variable 'Y' never used at line 458
[Hint] (531:5): Variable 'V' never used at line 530
[Hint] (608:5): Variable 'OBJ' never used at line 607
[Hint] (610:5): Variable 'V' never used at line 609
Compiled successfully in 546 ms.
SRL Compiled in 16 msec
SMART Initialized.
Loaded: Server 7, Members: False, Signed: True, Super Detail: False.
True
Successfully executed.
[Hint] (255:5): Variable 'DX' never used at line 254
[Hint] (255:5): Variable 'DY' never used at line 254
[Hint] (341:5): Variable 'P' never used at line 340
[Hint] (458:5): Variable 'TPA' never used at line 457
[Hint] (459:5): Variable 'X' never used at line 458
[Hint] (459:5): Variable 'Y' never used at line 458
[Hint] (531:5): Variable 'V' never used at line 530
[Hint] (608:5): Variable 'OBJ' never used at line 607
[Hint] (610:5): Variable 'V' never used at line 609


This has something to do with your script ?

Inheaven

2012-05-30 04:57:11

You were right, it is working right now! thank you so much!
i will post a proggy within a couple of hours ;)

Er1k

2012-05-30 05:00:19

From: Inheaven
You were right, it is working right now! thank you so much!
i will post a proggy within a couple of hours ;)


Thanks for reporting. I'll update on instructions later today so that people can setup correctly ;)

Inheaven

2012-05-30 05:11:51

That would be great!

Suggestion:
- add rounds p/h
- Exp P/h, Round p/h etc.. shown in RS tab instead of the black command screen? this will make it more easy to check the stats. (don't know how you call that xD) (ADDTIONAL ON/OFF OPTION)

But i like the script. Getting around 30k xp p/h

EDIT:
Time Running: 55 Minutes and 59 Seconds
Exp Gained: 23307
Est XP/H: 24980


What about DDTM? How to find food DDTM, downloaded DTM, put it in the right map but still does not eat. So i think i have to find the DDTM manually? but how ?

Inheaven

2012-05-30 05:52:53

Sorry, double post..

thatoneguy

2012-05-30 20:04:11

Script works great, not sure if it's eating though. What is the default food to use? And like the above post, how do I go about making it eat my own custom food?

Er1k

2012-05-30 20:20:20

To support custom food, you need to create a DTM of the food you're using. Look into DTM section of this tutorial http://villavu.com/forum/showthread.php?t=75826 On how to make one

Im New Sry

2012-05-31 02:29:53

Doesn't work at all. Stood there clicking from food tab to quest tab

DoObstacle: False
current action is pipe
distance is 86
dxdy: 27 50
init xp is 24585202
0
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
atpa[0]: 1
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
atpa[0]: 1
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
atpa[0]: 1
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
init xp is 24585202
0
atpa[0]: 1
DoObstacle: False
current action is pipe
distance is 85
dxdy: 27 50
Successfully executed.

thatoneguy

2012-05-31 05:23:42

Thanks Er1k.

Edit: I have the same problem as the above poster after adding a custom DTM for shark.

HP low
No food
distance is 98
dxdy: 27 50
init xp is 248667
0
atpa[0]: 1
DoObstacle: False
HP low
No food
current action is pipe
HP low
No food
distance is 98
dxdy: 27 50
init xp is 248667
0
atpa[0]: 1
DoObstacle: False
HP low
No food
current action is pipe
HP low
No food
distance is 98
dxdy: 27 50
init xp is 248667
0
atpa[0]: 1
DoObstacle: False
HP low
No food
current action is pipe
HP low
No food
distance is 98
dxdy: 27 50


Just keeps clicking between the quest menu and the inventory menu.

Er1k

2012-05-31 06:34:16

Strange. 3 hours ago I verified it's working with my main with no food. Where did you guys position your character at? I also verified there's not even a single line the script that clicks the quest tab.

Verify if you're at max brightness & lowest video quality in RS options.

thatoneguy

2012-05-31 07:19:37

I was positioned directly in front of the pipe, and yes, settings are as usual (minimum, fixed, max brightness).

Very strange. Script worked perfect (without food support) until I added the shark DTM.

Should anything be added to this section

var courseObjs: array of EObj;
ddtms: array [0..1] of integer;
food: integer; //food dtm
foodslots: TIntegerArray; //food locations
startXP: integer;
wasInDung: boolean;


namely, before the //food dtm and //food locations?

Er1k

2012-05-31 08:49:51

From: thatoneguy
I was positioned directly in front of the pipe, and yes, settings are as usual (minimum, fixed, max brightness).

Very strange. Script worked perfect (without food support) until I added the shark DTM.

Should anything be added to this section



namely, before the //food dtm and //food locations?


The dtm you made for your food should be put in Line 32, namely this:

  FOOD_DTM = 'mggAAAHicY2NgYChlYmAoA+JKIG4E4moofzkQzwHiBUA8D8pfD8S7rKWBupgwMBcDdsCIA0MAAA5cB/Y=';  //put food dtm string here

This is very strange. I have no ideas why this is happening, I need more time to figure out.

thatoneguy

2012-05-31 15:03:08

Yeah that's what I was doing, just making sure.

Would chat options being disabled or private have any sort of effect?

Er1k

2012-05-31 17:54:04

From: thatoneguy
Yeah that's what I was doing, just making sure.

Would chat options being disabled or private have any sort of effect?


Try disabling public, turn game to all. That's all I think is needed.

Im New Sry

2012-06-01 04:26:48

Re-ran it, with disabling public and game to all, it works good. Only one question : which food dtm is specified here? Because my player won't eat lobsters.

Nonetheless, thank you for the script!

thatoneguy

2012-06-01 06:20:39

The script has been working fine, it just wouldn't eat (I haven't tried changing the chat settings yet).

To make it eat your own food, you need to create a custom DTM and insert it where it tells you to. To create your own DTM, follow the link Er1k gave on the previous page.

ne lg

2012-06-01 15:00:35

Awsome script, got everything to work perfectly.

It's eating rocktails atm because im a skiller and i can only survive if i set it to heal at 130 hp and use rocktails :P,

Im using this:


HEAL_AT = 130;
FOOD_DTM = 'mrAAAAHic42BgYKhhYmBoBeIGIC4F4mogbgPiXCAuAmJWRgaGL0B1XED6L5D+CcRMjBDMDcQTampBImCsJccKpg0UFMD0ybXrGAgBRgIYBgBfvwt2';

Everything is fine for me, ofcourse i cant afk for 6 hours but it's cool. I occasionally die when i run out of rocktails(costly :L) or when skele's in the dungeon be tripping on me. I found it will eat only after finishing a procedure, i.e exit the dungeon.

If anyone is having any problems, here i what i did:

Make sure your brightness is all the way up
Make sure you have the latest Simba downloads/extensions.
Make sure your chat is private off and game on ALL
To custom create your food type, find the DTM string following the guide that Er1k posted on page 3.


Thanks Er1k, awsome script.

Tabuloso

2012-06-01 17:26:02

From: Inheaven
If you can explain me what you need and where i can find it i can help you. Cuz i'm a starter you know, keep it nice and simple for me gehe:)

You mean this? :



It keeps saying this over and over again. :$


Take your game off filter.

ne lg

2012-06-01 19:45:51

Okay, now i have noticed two problems.

The first one, is minor, negligible imo. I think it frequently (one in three) times will do the lava steps twice, i have no idea why, it will just do them, run back round and do them again and go on fine. This isn't a big problem


The second one is for the log, After completing the log it doesnt register that it's completed correctly and will run around the side next to the tree to try and do it, This is a problem because it wont be able to re attempt the obstacle and just sits there/dies.

The second problem probably needs attending to, i guess the problem is detecting wether or not the obstacle was succesfull, It thinks is was not when it was succesfull resulting in it trying to click back to the start of the obstacle.

This doesn't happen every time, mabye once every half hour.

Er1k

2012-06-01 21:00:04

From: ne lg
Okay, now i have noticed two problems.

The second one is for the log, After completing the log it doesnt register that it's completed correctly and will run around the side next to the tree to try and do it, This is a problem because it wont be able to re attempt the obstacle and just sits there/dies.

The second problem probably needs attending to, i guess the problem is detecting wether or not the obstacle was succesfull, It thinks is was not when it was succesfull resulting in it trying to click back to the start of the obstacle.

This doesn't happen every time, mabye once every half hour.


I am aware of this 2nd problem. It's on my todo list but I have yet found out what really causes it. The only way I know of to deal with it for now is to manually stop the script and restart at the pipe, hence the babysitting.

ne lg

2012-06-02 09:00:59

I have a question, why do everytime i die/relog i need to take another picture and get another string for the DTM for my food?

It doesnt recognise the food unless i get a new DTM every time i relog/die.

Its kinda frustrating :P

Im using rocktails btw.

rebeltjeh

2012-06-02 13:29:41

idk bout rocktails but monkfish & lobsters is in this thread, maybe use those untill you find your rocktails.

My script gets stuck when I fail on the lavastone, that's his only flaw.

(and all my chats are on off, game on all)

ne lg

2012-06-04 09:55:41

Nvm, i didn't add any tolerence to the food DTM, ma bad.

I might try and tackle a deathwalk,

I literally know nothing to do with scripting but since it would all run on the main runescape surface i could use SPS without having to make my own custom map.

I'll give it a go perhaps.

ne lg

2012-06-05 07:07:56


program FromDeathToCourse;

{$DEFINE SMART}
{.include SRL/SRL.simba}
{.include custom/DDTM.simba}
{.include SPS/SPS.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

const
SmartWorld = 7;
Members = False;
SignedClient = True;
HighDetail = False;
NumbOfPlayers = 1;
StartPlayer= 1;


procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(NumbOfPlayers);
CurrentPlayer := StartPlayer;
for i := 0 to NumbOfPlayers-1 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Active := True;

end;

end;

procedure FromDeathToEdgeBank;
var
x,y:integer;
begin;
Writeln('Unfortunetly you have died!');
ClickNorth(SRL_ANGLE_HIGH);
if ObjDTM_Find('52:48:4:1:7:120:86:1:7:136:90:1:7:58:29:1:7:86:60', x, y, True) then
begin;
Writeln('We found the bank, lets get some more food')
ObjDTM_Walk('52:48:4:1:7:120:86:1:7:136:90:1:7:58:29:1:7:86:60', 2, 100, 5, True);
end;
end;

Function Banking: Boolean;

Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, Retry: Integer;
X,Y:Integer;
Begin
Wait(2000);
Writeln('Banking')
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4347794, MSX1, MSY1, MSX2, MSY2, 20);
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 3, 1);
SortATPASize(TPAA, True);
For I := 0 To High(TPAA) Do
If GetArraylength(TPAA[i]) > 5 Then
Begin
repeat
inc(Retry);
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
if (IsUpTextMultiCustom(['anker', 'Bank B'])) then
Begin
Result := True;
GetMousePos(X, Y);
mouse(x,y,3,3,false);
wait(100 + random(200));
ChooseOption('Bank Banker');
wait(5000 + random(1000));
Break;
End;
until (Retry = 2);
Break;
end;
Mouse(x,y,3,3,false);
ChooseOption('Bank Banker');
Wait(2000);
Withdraw(0,0,28);
CloseBank;
end;


procedure HomeTeleportToArdy;
var
x,y,Sex,Sey:integer;
begin;
Writeln('We are going to Lodestone port to Ardrougune!')
GameTab(28);
if FindColorSpiralTolerance(x,y,8333644,564,222,586,240,20) then
begin;
Mouse(x,y,3,3,true);
end else
begin;
Writeln('Could not find the blue homeport button, logging off');
Logout;
TerminateScript;
end;
Wait(1000+Random(100));
if FindColorSpiralTolerance(Sex,Sey,2566303,163,203,182,229,20) then
begin;
Mouse(Sex,Sey,3,3,True);
Wait(15000+Random(100));
end else
begin;
Writeln('Could not find the red Ardy symbol , logging off');
Logout;
TerminateScript;
end;
GameTab(25);
end;



procedure RunFromLodeStoneToLever;
begin
ClickNorth(SRL_ANGLE_HIGH);
Writeln('Walking to the lever, like a boss')
ObjDTM_Walk('22:106:3:1:7:93:91:1:7:90:45:1:7:51:82:4:17:102:31:102:27:108:12:108',0,100,80,True);
Wait(500);
ObjDTM_Walk('27:118:3:1:7:99:71:1:7:107:54:1:7:24:49:4:20:111:33:110:28:131:19:124', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('71:147:3:1:7:66:41:1:7:58:102:1:7:65:131:4:80:138:65:145:74:154:80:146', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('14:108:3:1:7:71:136:1:7:51:103:1:7:74:82', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('23:70:3:1:7:117:86:1:7:116:69:1:7:78:59:4:12:66:40:68:36:80:11:75', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('40:98:3:0:7:83:33:0:7:75:103:0:7:36:56:4:36:94:47:92:44:103:36:103', 0, 100, 80, True);
Writeln('Arrived at Lever')
end;

procedure PullLeverAndRunToWeb;
var
x,y:integer;
begin;
MakeCompass('W');
SetAngle(1);
Writeln('Pulling Lever');
Wait(1000+Random(100));
if FindObjCustom(x,y,['Lever'],[4092043],20)then
begin;
Writeln('Horray, found lever, pulling it!');
Mouse(x,y,3,3,true);
Wait(6000+Random(100));
end;
Writeln('Running to web')
ClickNorth(SRL_ANGLE_HIGH);
Wait(1000);
ObjDTM_Walk('89:24:3:2:7:70:47:2:7:33:63:2:7:73:130:4:73:17:106:19:97:41:79:26',0,100,80,True);
Wait(500);
ObjDTM_walk('90:22:3:2:7:129:106:2:7:60:102:2:7:52:50:4:84:20:97:20:96:36:85:29',0,100,60,True);
end;


function CutWeb(WaitFor: Integer): Boolean;
var
Uptext: String;
t, x, y: Integer;
begin
Wait(2000);
Result := False;
MarkTime(t);
Writeln('Searching for web...');
repeat
if FindObj(x,y,'Web',9802901,10) then
begin
repeat
Mouse(x,y,3,3,true);
if WaitUptext('alk', 1000) then
begin
Writeln('Web slashed!');
Result := True;
Break;
end;
Wait(Random(1000));
until (TimeFromMark(t) > (WaitFor / 2));
end;
until Result or (TimeFromMark(t) > WaitFor);
if not Result then
Writeln('Web not found!');
end;

procedure RunFromWebToCourse;
begin;
Writeln('Walking to the course gate')
Wait(2000);
ObjDTM_Walk('16:97:3:2:7:109:101:2:7:121:70:2:7:64:37:4:7:89:26:86:29:101:9:106',0,100,80,True);
Wait(500);
ObjDTM_Walk('42:135:3:2:7:108:88:2:7:78:72:2:7:75:110:4:33:124:60:125:57:146:33:136', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('66:143:3:2:7:111:53:2:7:117:100:2:7:97:127:4:55:131:80:132:79:150:57:145', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('31:127:3:2:7:111:62:2:7:137:73:2:7:131:35:4:19:120:52:118:47:133:30:132', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('11:82:2:5:7:56:106:5:7:52:115:4:4:77:22:74:22:86:8:92', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('8:77:4:5:7:75:147:5:7:62:147:5:7:128:102:5:7:20:124:4:2:72:19:73:18:85:7:84', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('21:106:4:2:7:128:120:2:7:89:123:2:7:82:139:2:7:28:95:4:13:98:31:94:37:107:20:112', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('24:59:3:5:7:124:99:5:7:35:97:5:7:13:45:4:11:50:34:45:39:68:15:67', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('20:79:4:5:7:108:18:5:7:58:33:5:7:86:119:5:7:15:114:4:7:72:39:72:36:88:12:91', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('23:90:3:5:7:79:123:5:7:131:64:5:7:73:19:4:16:87:30:82:36:93:20:95', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('12:76:3:5:7:129:116:5:7:120:112:2:7:129:24:4:5:68:23:68:25:83:6:84', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('56:53:4:2:7:86:72:2:7:66:85:2:7:46:90:2:7:29:83:5:45:50:62:51:59:65:52:60:46:56', 0, 100, 80, True);
Writeln('Arrived at Gate')
end;

procedure PressGate;
var
x,y:integer;
begin;
if FindObjCustom(x,y,['Gate'],[2763564],20) then
begin;
Mouse(x,y,3,3,true);
Wait(15000+Random(100))
end;
end;

begin
Smart_Server := SmartWorld;
Smart_Members := Members;
Smart_Signed := SignedClient;
Smart_SuperDetail := HighDetail;
setupSRL();
ObjDTM_Setup
DeclarePlayers;
FromDeathToEdgeBank;
Banking;
HomeTeleportToArdy;
RunFromLodeStoneToLever;
PullLeverAndRunToWeb;
CutWeb(10000);
RunFromWebToCourse;
PressGate;
end.


Heres the deathwalker, if you can use it at all it would be cool.

It takes food from first first spot in your bank and then runs back to the course.

ne lg

2012-06-06 18:50:08

I guess some of the colours have changed because the lava and the rope stopped working for me, I changed them around and fiddled with the tolerances a little bit, they seem to work for me now, I also added my dealthwalker(im not sure it works yet). It worked for me once, but that was just once.

All i did was add my procedures to the LogoutOnDeath procedure, changed it from loging out to going back to the course, if anyone is wanting the updated colours/deathwalk here is what im using atm, tell me if it works for you, or where your having trouble and ill try update the walker, i know the walking Obj_DTMS are very sketchy so i dont expect it to work for everyone :P


program WAR;
{$DEFINE SMART}
{.include SRL/SRL.simba}
{.include custom/DDTM.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

//{$DEFINE DEBUG} //uncomment if you need debug info
//{$DEFINE DEBUG_DRAW} //uncomment if you need debug info

type EObj = record
color, tol, w, h, minc, maxtry: integer;
hmod, smod: extended;
uptexts, options: TStringArray;
left: boolean;
end;

var courseObjs: array of EObj;
ddtms: array [0..1] of integer;
food: integer; //food dtm
foodslots: TIntegerArray; //food locations
startXP: integer;
wasInDung: boolean;

const
//SMART Setup
SmartWorld = 7;
Members = False;
SignedClient = True;
HighDetail = False;

//Player Setup
HEAL_AT = 130;
FOOD_DTM = 'mwQAAAHic42RgYDjPxMBwE4qvAvFlID4LxEeA+BiU7c3IwGALxO5A7AvEwUAcAcT+UDEnIO4qr2Cw0GAHmsjEsHXOPDCNjrmAJCHMSASGAwAuEw5P'; //put food dtm string here

//DDTM Setup
PIT_BLACK = 66566;
LOG_BROWN = 2049116;
DOOR_RED = 1009;
OUTLINE_WHITE = 16049649;


procedure FromDeathToEdgeBank;
var
x,y:integer;
begin;
Writeln('Unfortunetly you have died!');
ClickNorth(SRL_ANGLE_HIGH);
if ObjDTM_Find('52:48:4:1:7:120:86:1:7:136:90:1:7:58:29:1:7:86:60', x, y, True) then
begin;
Writeln('We found the bank, lets get some more food')
ObjDTM_Walk('52:48:4:1:7:120:86:1:7:136:90:1:7:58:29:1:7:86:60', 2, 100, 5, True);
end;
end;

Function Banking: Boolean;

Var
TPAA: T2DPointArray;
TPA: TPointArray;
CTS, I, Retry: Integer;
X,Y:Integer;
Begin
Wait(2000);
Writeln('Banking')
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4347794, MSX1, MSY1, MSX2, MSY2, 20); // Enter the Color and Tolerance Here at the Right place.
ColorToleranceSpeed(CTS);
TPAA := TPAToATPAEx(TPA, 3, 1);
SortATPASize(TPAA, True);
For I := 0 To High(TPAA) Do
If GetArraylength(TPAA[i]) > 5 Then
Begin
repeat
inc(Retry);
MiddleTPAEx(TPAA[i], X, Y);
MMouse(X, Y, 3, 3);
if (IsUpTextMultiCustom(['anker', 'Bank B'])) then
Begin
Result := True;
GetMousePos(X, Y);
mouse(x,y,3,3,false);
wait(100 + random(200));
ChooseOption('Bank Banker');
wait(5000 + random(1000));
Break;
End;
until (Retry = 2);
Break;
end;
Mouse(x,y,3,3,false);
ChooseOption('Bank Banker');
Wait(2000);
Withdraw(0,0,28);
CloseBank;
end;


procedure HomeTeleportToArdy;
var
x,y,Sex,Sey:integer;
begin;
Writeln('We are going to Lodestone port to Ardrougune!')
GameTab(28);
if FindColorSpiralTolerance(x,y,8333644,564,222,586,240,20) then
begin;
Mouse(x,y,3,3,true);
end else
begin;
Writeln('Could not find the blue homeport button, logging off');
Logout;
TerminateScript;
end;
Wait(1000+Random(100));
if FindColorSpiralTolerance(Sex,Sey,2566303,163,203,182,229,20) then
begin;
Mouse(Sex,Sey,3,3,True);
Wait(15000+Random(100));
end else
begin;
Writeln('Could not find the red Ardy symbol , logging off');
Logout;
TerminateScript;
end;
GameTab(25);
end;



procedure RunFromLodeStoneToLever;
begin
ClickNorth(SRL_ANGLE_HIGH);
Writeln('Walking to the lever, like a boss')
ObjDTM_Walk('22:106:3:1:7:93:91:1:7:90:45:1:7:51:82:4:17:102:31:102:27:108:12:108',0,100,80,True);
Wait(500);
ObjDTM_Walk('27:118:3:1:7:99:71:1:7:107:54:1:7:24:49:4:20:111:33:110:28:131:19:124', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('71:147:3:1:7:66:41:1:7:58:102:1:7:65:131:4:80:138:65:145:74:154:80:146', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('14:108:3:1:7:71:136:1:7:51:103:1:7:74:82', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('23:70:3:1:7:117:86:1:7:116:69:1:7:78:59:4:12:66:40:68:36:80:11:75', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('40:98:3:0:7:83:33:0:7:75:103:0:7:36:56:4:36:94:47:92:44:103:36:103', 0, 100, 80, True);
Writeln('Arrived at Lever')
end;

procedure PullLeverAndRunToWeb;
var
x,y:integer;
begin;
MakeCompass('W');
SetAngle(1);
Writeln('Pulling Lever');
Wait(1000+Random(100));
if FindObjCustom(x,y,['Lever'],[4092043],20)then
begin;
Writeln('Horray, found lever, pulling it!');
Mouse(x,y,3,3,true);
Wait(6000+Random(100));
end;
Writeln('Running to web')
ClickNorth(SRL_ANGLE_HIGH);
Wait(1000);
ObjDTM_Walk('89:24:3:2:7:70:47:2:7:33:63:2:7:73:130:4:73:17:106:19:97:41:79:26',0,100,80,True);
Wait(500);
ObjDTM_walk('90:22:3:2:7:129:106:2:7:60:102:2:7:52:50:4:84:20:97:20:96:36:85:29',0,100,60,True);
end;


function CutWeb(WaitFor: Integer): Boolean;
var
Uptext: String;
t, x, y: Integer;
begin
Wait(2000);
Result := False;
MarkTime(t);
Writeln('Searching for web...');
repeat
if FindObj(x,y,'Web',9802901,10) then
begin
repeat
Mouse(x,y,3,3,true);
if WaitUptext('alk', 1000) then
begin
Writeln('Web slashed!');
Result := True;
Break;
end;
Wait(Random(1000));
until (TimeFromMark(t) > (WaitFor / 2));
end;
until Result or (TimeFromMark(t) > WaitFor);
if not Result then
Writeln('Web not found!');
end;

procedure RunFromWebToCourse;
begin;
Writeln('Walking to the course gate')
Wait(2000);
ObjDTM_Walk('16:97:3:2:7:109:101:2:7:121:70:2:7:64:37:4:7:89:26:86:29:101:9:106',0,100,80,True);
Wait(500);
ObjDTM_Walk('42:135:3:2:7:108:88:2:7:78:72:2:7:75:110:4:33:124:60:125:57:146:33:136', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('66:143:3:2:7:111:53:2:7:117:100:2:7:97:127:4:55:131:80:132:79:150:57:145', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('31:127:3:2:7:111:62:2:7:137:73:2:7:131:35:4:19:120:52:118:47:133:30:132', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('11:82:2:5:7:56:106:5:7:52:115:4:4:77:22:74:22:86:8:92', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('8:77:4:5:7:75:147:5:7:62:147:5:7:128:102:5:7:20:124:4:2:72:19:73:18:85:7:84', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('21:106:4:2:7:128:120:2:7:89:123:2:7:82:139:2:7:28:95:4:13:98:31:94:37:107:20:112', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('24:59:3:5:7:124:99:5:7:35:97:5:7:13:45:4:11:50:34:45:39:68:15:67', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('20:79:4:5:7:108:18:5:7:58:33:5:7:86:119:5:7:15:114:4:7:72:39:72:36:88:12:91', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('23:90:3:5:7:79:123:5:7:131:64:5:7:73:19:4:16:87:30:82:36:93:20:95', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('12:76:3:5:7:129:116:5:7:120:112:2:7:129:24:4:5:68:23:68:25:83:6:84', 0, 100, 80, True);
Wait(500);
ObjDTM_Walk('56:53:4:2:7:86:72:2:7:66:85:2:7:46:90:2:7:29:83:5:45:50:62:51:59:65:52:60:46:56', 0, 100, 80, True);
Writeln('Arrived at Gate')
end;

procedure PressGate;
var
x,y:integer;
begin;
if FindObjCustom(x,y,['Gate'],[2763564],20) then
begin;
Mouse(x,y,3,3,true);
Wait(15000+Random(100))
end;
end;

procedure DeclareObjects;
begin
setLength(courseObjs, 6);
//Pipe
with courseObjs[0] do
begin
color:= 6447197;
tol:= 18;
hmod:= 0.25;
smod:= 0.05;
w:= 20; h:= 20; minc:= 100; maxtry:= 3;
uptexts:=['rou'];
options:=['rou'];
left:=true;
end;
//Swing
with courseObjs[1] do
begin
color:= 1060661;
tol:= 10;
hmod:= 0.14;
smod:= 0.87;
w:= 10; h:= 10; minc:= 30; maxtry:= 5;
uptexts:=['wing', 'ing'];
options:=['wing', 'ing'];
left:=false;
end;
//Lava
with courseObjs[2] do
begin
color:= 2240363;
tol:= 4;
hmod:= 0.05;
smod:= 0.40;
w:= 30; h:= 30; minc:= 40; maxtry:= 2;
uptexts:=['ross'];
options:=['ross'];
left:=false;
end;
//Log
with courseObjs[3] do
begin
color:= 5002072;
tol:= 6;
hmod:= 0.34;
smod:= 0.10;
w:= 20; h:= 20; minc:= 40; maxtry:= 2;
uptexts:=['acro'];
options:=['acro'];
left:=true;
end;
//Cliff
with courseObjs[4] do
begin
color:= 5197651;
tol:= 2;
hmod:= 0.0;
smod:= 0.27;
w:= 30; h:= 30; minc:= 100; maxtry:= 3;
uptexts:=['iff'];
options:=['iff'];
left:=false;
end;
//Ladder
with courseObjs[5] do
begin
color:= 3555138;
tol:= 7;
hmod:= 0.20;
smod:= 0.55;
w:=10; h:=10; minc:=40; maxtry:=3;
uptexts:=['imb'];
options:=['imb'];
left:=true;
end;
{
with courseObjs[4] do
begin
color:=;
tol:=;
hmod:=;
smod:=;
w:=; h:=; minc:=; maxtry:=;
uptexts:=;
options:=;
end;
}
end;

procedure ProgressReport(var startXP: integer);
var gain: integer;
begin
gain := GetXPBarTotal- startXP;

writeln('Time running: ' + TimeRunning);
writeln('Exp Gained: ' + IntToStr(gain));
writeln('Est XP/H: ' + IntToStr(round(3600000 * 1.0 / GetTimeRunning * gain)));
end;

procedure FreeDDTM;
var i: integer;
begin
for i:=0 to high(ddtms) do
FreeDTM(ddtms[i]);
end;

procedure DeclareDDTM;
var DTMSubPoints: array of TDTMPointDef;
DTMMainPoint: TDTMPointDef;
begin
//Log DDTM
setLength(DTMSubPoints, 4);
DTMMainPoint:= DTMPoint(9, 0, 1, 0, 16777215, 255);
DTMSubPoints[0] := DTMPoint(9, 6, 1, 0, PIT_BLACK, 25);
DTMSubPoints[1] := DTMPoint(19, 3, 1, 0, PIT_BLACK, 25);
DTMSubPoints[2] := DTMPoint(0, 3, 1, 0, PIT_BLACK, 25);
DTMSubPoints[3] := DTMPoint(0, 12, 1, 0, LOG_BROWN, 25);

ddtms[0] := AssembleDDTM(DTMMainPoint, DTMSubPoints);

//Gate DDTM

setLength(DTMSubPoints, 3);
DTMMainPoint:= DTMPoint(4, 0, 1, 0, 16777215, 255);
// DTMSubPoints[0] := DTMPoint(4, 0, 1, 0, 1009, 25); //red
DTMSubPoints[0] := DTMPoint(10, 0, 1, 0, 15268071, 25); //white
DTMSubPoints[1] := DTMPoint(7, 0, 1, 0, 1009, 25); //red
DTMSubPoints[2] := DTMPoint(0, 0, 1, 0, 1009, 25); //''
ddtms[1] := AssembleDDTM(DTMMainPoint, DTMSubPoints);

//Hook FreeDTM
AddOnTerminate('FreeDDTM');
end;

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 0 do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := 'swt@hotmail.co.uk'; //Player username.
Pass := 'balonibaloni1'; //Player password.
Nick := 'Euz'; //Player nickname - 3-4 letters of Player username.
Active := True;
end;
end;

procedure DoLogin;
var t: integer;
begin
MarkTime(t);
while (not LoggedIn) do
begin
if LogInPlayer then
break;
wait(10000+random(500));
if (TimeFromMark(t) > 180000) then
begin
writeln('Failed to login after 180s... Terminating');
TerminateScript;
end;
end;
end;

procedure GetLocationOffset(location: string; var dx, dy: integer);
begin
//Change the global offsets here!
case location of
'pipe' : begin
dx:=27;
dy:=50;
end;
'swing' : begin
dx:=31;
dy:=-19;
end;
'lava' : begin
dx:=18;
dy:=-48;
end;
'log' : begin
dx:=15;
dy:=13;
end;
'cliff' : begin
dx:=-16;
dy:=38;
end;
end;
end;

function CalibratePosition(location: string): boolean;
var d, x, y, dx, dy: integer;
e: extended;
begin
if not LoggedIn then Exit;
result := false;
FindNormalRandoms;
d:=ddtms[0];
//eat
if FindDTMRotated(d, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/6, Pi/6, 0.05, e) then
begin
GetLocationOffset(location, dx, dy);
writeln('dxdy: ' + inttostr(dx) + ' ' + inttostr(dy));
mouse(x+dx, y+dy, 4, 4, mouse_left);
// mouse(x, y, 4, 4, mouse_move);
end;
end;

function CalibratePositionB(location: string; var p: TPoint): boolean;
var d, x, y, dx, dy: integer;
e: extended;
begin
if not LoggedIn then Exit;
result := false;
FindNormalRandoms;
d:=ddtms[0];
//eat
result:= FindDTMRotated(d, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/6, Pi/6, 0.05, e);
p:= Point(x,y);
end;

function objFind(color, tol: integer; hmod, smod: extended; w,h, minc, maxtry: integer;
left: boolean; uptexts, options: TStringArray): boolean;
var tcts, i, x, y, c: integer;
tpa: TPointArray;
atpa: T2DPointArray;
begin
Result:=False;
tcts:= getToleranceSpeed;
setColorToleranceSpeed(2);
setColorSpeed2Modifiers(hmod, smod);
if FindColorsSpiralTolerance(MSCX, MSCY, tpa, color, MSX1, MSY1, MSX2, MSY2, tol) then
begin
atpa:= TPAtoATPAEx(tpa, 20, 20);
{$IFDEF DEBUG_DRAW}
debugATPABounds(atpa);
{$ENDIF}
for i:=0 to high(atpa) do
begin
writeln('atpa['+IntToStr(i)+']: '+IntToStr(length(atpa[i])));
if (minc > 0) and (length(atpa[i]) < minc) then continue;
if (c > maxtry) then continue;
Inc(c);
MiddleTPAEx(atpa[i], x, y);
Mouse(x, y, 3, 3, mouse_move);
if WaitUptextMulti(uptexts, 1000) then
begin
if left then
begin
ClickMouse2(mouse_left);
Result:= DidRedClick;
end
else
begin
ClickMouse2(mouse_right);
Result:= WaitOptionMulti(options, 1000);
end;
if Result then
begin
writeln('objfind success!');
break;
end;
end;
end;
end;
setColorToleranceSpeed(tcts);
end;

function objFindW(obj: EObj): boolean;
begin
result:= objFind(obj.color, obj.tol, obj.hmod, obj.smod,
obj.w, obj.h, obj.minc, obj.maxtry, obj.left, obj.uptexts, obj.options);
end;

function InDungeon: boolean;
var tpa: TPointArray;
begin
if not LoggedIn then Exit;
SetColorToleranceSpeed(1);
FindMMColorsSpiralTolerance(tpa, 2574684, 25);
writeln(length(tpa));
result := length(tpa) > 1200;
if result then writeln('in dungeon');
end;

function InSurface: boolean;
var tpa: TPointArray;
begin
FindMMColorsSpiralTolerance(tpa, 5222643, 25);
result:= length(tpa) >= 200;
end;

function DetermineAction(var action: string): boolean;
var d, x, y, dx, dy: integer;
e: extended;
p: TPoint;
begin
if not LoggedIn then Exit;
FindNormalRandoms;

//Dungeon
if InDungeon then
begin
action:= 'dungeon';
result:= true;
Exit;
end;

//Detect where we are on the surface!
d:=ddtms[0];
result:= FindDTMRotated(d, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/6, Pi/6, 0.05, e);
if result then
begin
//Calculate our position offsets
dx:= MMCX - x;
dy:= MMCY - y;

//Determine action based on these offsets
//pipe
if dy > 38 then
begin
action:= 'pipe';
Exit;
end;

//swing
if (dx > 27) and (dy < 0) and (dy > -40) then
begin
action:= 'swing';
Exit;
end;

//lava
if (dx > -5) and (dy < -35) then
begin
action:= 'lava';
Exit;
end;

//log
if (dx < 20) and (dy > -35) and (dy < 25) then
begin
action:= 'log';
Exit;
end;

//cliff
if (dy > 0) and (dy < 38) and (dx < 0) then
begin
action:= 'cliff';
Exit;
end;
end;

end;

procedure AddArray(var a: TIntegerArray; v: integer);
var i: integer;
begin
for i:=0 to high(a) do
if a[i] = v then
exit;
setLength(a, length(a) + 1);
a[high(a)] := v;
end;

procedure SetupInventory;
var i, x, y: integer;
tb: TBox;
begin
setLength(foodslots, 0);
for i:=1 to 28 do
if ExistsItem(i) then
begin
tb:= InvBox(i);
if FindDTM(food, x, y, tb.X1, tb.Y1, tb.X2, tb.Y2) then
AddArray(foodslots, i);
end;
end;

procedure LobbyOnDeath;
begin
Reincarnate:= true;
if FindDead then
begin
DeclarePlayers;
FromDeathToEdgeBank;
Banking;
HomeTeleportToArdy;
RunFromLodeStoneToLever;
PullLeverAndRunToWeb;
CutWeb(10000);
RunFromWebToCourse;
PressGate;
end;
end;

procedure EatFood;
var hp: integer;
temp: string;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
hp:= getMMLevels('hp', temp);
if hp <= HEAL_AT then
begin
writeln('HP low');
if length(foodslots) = 0 then
begin
writeln('No food');
Exit;
end;
MouseItem(foodslots[0], mouse_left);
wait(500+random(250));
SetupInventory;
end;
end;

function EscapeDungeon: boolean;
var tpa: TPointArray;
r, a, x, y: integer;
begin
if not LoggedIn then Exit;
result := false;
FindNormalRandoms;
LobbyOnDeath;
//Eat
if InDungeon then
begin
writeln('Player in dungeon. Trying to escape...');
wasInDung:= true;
// FindMMColorsSpiralTolerance(tpa, 123, 456); //ladder
// if length(tpa) < 100 then
if true then
begin
r:= randomRange(65, 72);
a:= randomRange(60, 75);
Mouse(MMCX + round(r*cos(a*pi/180.0)), MMCY -round(r*sin(a*pi/180.0)), 4, 4, mouse_left);
wait(2000+random(500));
while IsMoving do
wait(100+random(50));
end;
{ FindMMColorsSpiralTolerance(tpa, 123, 456); //find Ladder again
if length(tpa) > 100 then
begin
MiddleTPAEx(tpa, x, y);
Mouse(x, y, 4, 4, mouse_left);
wait(1000+random(500));
while IsMoving do
wait(100+random(50));
end;
}
result:=ObjFindW(courseObjs[5]);
if result then
if WaitFunc(@InSurface, 500, 5000) then
begin
result:=true;
wait(1000+random(250));
end
else
result:=false;
end;
end;

function CheckObstacle(success, fail: string): boolean;
var t: integer;
begin
result:= false; //silent update 2
if FindBlackChatMessage(success) or FindBlackChatMessage(fail) then
wait(5000);
MarkTime(t);
repeat
if FindBlackChatMessage(success) then
begin
result:= true;
break;
end;
if FindBlackChatMessage(fail) then
begin
result:= false;
break;
end;
wait(500+random(150));
until TimeFromMark(t) > 10000;
if timefrommark(t) <= 10000 then
if result then
writeln('success message detected!')
else writeln('failure message detected!')
end;

function DoObstacleEx(location: string): boolean;
var obj, initXP, lastXP, t: integer;
v: TVariantArray;
begin
if not LoggedIn then Exit;
result := false;
FindNormalRandoms;
initXP := getXPBarTotal;
writeln('init xp is ' + inttostr(initxp));
case location of
'pipe' : obj:= 0;
'swing' : obj:= 1;
'lava' : obj:= 2;
'log' : obj:= 3;
'cliff' : obj:= 4;
end;
writeln(obj);
result := ObjFindW(courseObjs[obj]);
if result then
begin
case location of
'lava' : begin
result:= CheckObstacle('safe', 'fall');
if not result then
begin
wait(1000+random(250));//stall the animation
Exit;
end;
end;
'log' : begin
result:= CheckObstacle('skil', 'fall');
if not result then
if WaitFunc(@InDungeon, 500, 5000) then
Exit
else result:= true; //false positive!
end;
'swing': begin
MarkTime(t);
repeat
if ClickContinue(true, true) then //someone is using
begin
result:=false;
Exit;
end;
if FindBlackChatMessage('wing') then //success
begin
writeln('success');
result:=true;
break;
end;
if InDungeon then //Fell into pit
begin
writeln('failure');
result:=false;
WaitFunc(@InDungeon, 500, 2000); //improve walking
Exit;
end;
wait(500+random(150));
until TimeFromMark(t) > 10000;
end;
end;
end;
if result then
begin
MarkTime(t);
repeat
lastXP:= GetXPBarTotal;
wait(100+random(100));
until (TimeFromMark(t) > 10000) or (lastXP > initXP);
if (TimeFromMark(t) <= 15000) then
writeln('XP gain detected!');
case location of
'swing': wait(2000+random(500));
'log' : wait(1000+random(500));
end;
end;
end;

function DoObstacle(location: string): boolean;
var obj, dx, dy: integer;
p: TPoint;
v: TVariantArray;
begin
if not LoggedIn then Exit;
result := false;
FindNormalRandoms;
EatFood;
LobbyOnDeath;
//Immediate Exit if we're in dungeon
if ((location = 'log') or (location = 'swing')) and InDungeon then
begin
result:= false;
exit;
end;
//Now just try to do it
if (location <> 'pipe') then //this we don't need to relocate
result:= DoObstacleEx(location);
// if ((location = 'swing') or (location = 'log')) and not wasInDung then
// result:= DoObstacleEx(location);
if result then
begin
writeln('DoObstacle: ' + booltostr(result));
Exit;
end;
//Calibrate position because previous find is not successful
if CalibratePositionB(location, p) then
begin
GetLocationOffset(location, dx, dy);
writeln('distance is '+ inttostr(Distance(MMCX, MMCY, p.x+dx, p.y+dy)));
if Distance(MMCX, MMCY, p.x+dx, p.y+dy) > 15 then
begin
CalibratePosition(location);
wait(2000+random(250));
while IsMoving do
wait(50+random(50));
end;
end;
result:= DoObstacleEx(location);
writeln('DoObstacle: ' + booltostr(result));
end;

procedure DoCourse;
var action: string;
begin
action:= 'pipe';
SetupInventory;
ClickNorth(SRL_ANGLE_HIGH);
while LoggedIn do
begin
FindNormalRandoms;
LobbyOnDeath;
writeln('current action is ' + action);
case action of
'pipe' : begin
if DoObstacle(action) then action := 'swing';
LobbyOnDeath;
end;
'swing': begin
// if true then
// begin
if DoObstacle(action) then //found success
begin
action:='lava';
wasInDung:= false;
end
else EscapeDungeon;
LobbyOnDeath;
// end;
end;
'lava' : begin
if DoObstacle(action) then
action:= 'log'
else
writeln('return to lava');//return to starting lava
end;
'log' : begin
if DoObstacle(action) then
begin
action:='cliff';
wasInDung:= false;
end
else EscapeDungeon;
LobbyOnDeath;
end;
'cliff': begin
if DoObstacle(action) then action:='pipe';
ProgressReport(startXP);
end;
'dung': begin //failsafe if lost
if EscapeDungeon then
action:='lava';
end;
end;
EatFood;
LobbyOnDeath;
wait(500+random(250));
end;
end;

procedure FreeDTMz;
begin
FreeDTM(food);
end;

var d,x, y: integer;
e: extended;
begin
Smart_Server := SmartWorld;
Smart_Members := Members;
Smart_Signed := SignedClient;
Smart_SuperDetail := HighDetail;

setupSRL();
DeclarePlayers;
DoLogin;
DeclareDDTM;
food:=DTMFromString(FOOD_DTM);
AddOnTerminate('FreeDTMz');
Reincarnate := true;
DeclareObjects;
d:= ddtms[0];
writeln(booltostr(FindDTMRotated(d, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/6, Pi/6, 0.05, e) ));

ToggleXPBar(true);
startXP:= GetXPBarTotal;
DoCourse;
end.

I also added in some random LobbyOnDeath procedures here and there because i recall more than once the script didnt recognise i was dead and found myself running around edgeville when i came back to my computer.

Anyhoo, if anyone is still active on this thread at all :L give it a shot and tell me how it goes.
Y
ou'll need the ODTM extension!!!

however, i might try it out using SPS, it seemed more reliable, when i tried making this with SPS i got it to work pretty well, so if the Obj DTM's are that bad ill change back over.

Stanger

2012-06-12 16:28:28

Really nice script:)

For those who want lobsters:

FOOD_DTM = 'mggAAAHicY2NgYKhiYWDoAuI2IG4F4mYgbgFiFSYGBjEglgJiWSYIXxuI14ZJAHUxMZxJlQHTMMwPJLFhRhwYAgB+5QbR';

mclengthy

2012-07-02 16:02:32

Great script, works like a charm! Thanks for posting!

As I'm new to SRL, I found it helpful to add a message in the inventory setup to let me know right away that it found food. (Just so that I knew my DTM string was acceptable, I struggled to get it right the first couple of times.)

Had the same problem with repeating the lava obstacle. I tried setting chats to off and game to all as suggested elsewhere in this thread, but didn't seem to help. Not really a problem though, only repeats it the once and it doesn't stop me getting the complete lap xp.

Thanks again for a great script! :)

McLengthy

kenddy3

2012-07-04 00:15:09

Um guys can anyone make a Dtm on Cakes plz :D

Based Lord

2012-07-04 09:35:07

From: kenddy3
Um guys can anyone make a Dtm on Cakes plz :D

It is very easy to make man just gotta learn how to do it!
try this guide by YoHoJo

kenddy3

2012-07-16 15:27:01

Er1k thnks so much for this script used it from 52-70 agility and only baby sitted it for a while achieved 70 agility like 5 days ago but for got to post it !!!

Er1k

2012-07-18 08:40:35

From: kenddy3
Er1k thnks so much for this script used it from 52-70 agility and only baby sitted it for a while achieved 70 agility like 5 days ago but for got to post it !!!


Glad to know it is still working for some people :)

freezeyp

2012-07-30 08:28:43

Nice script, but i got some problem on lava's obstacle detect. If i fail on lava part, the player would appear on north of the poll, and that make color detect broken. Can you give me some idea about how do i fix it?

freezeyp

2012-08-03 03:37:19

From: freezeyp
Nice script, but i got some problem on lava's obstacle detect. If i fail on lava part, the player would appear on north of the poll, and that make color detect broken. Can you give me some idea about how do i fix it?


Maybe you are thinking that why i not trying to fix it myself. Well, i did fix it by replace the lava obstacle part detection from color to DTM. I just want to ask some question about how is the "re-position" work in this script. Most of the time, when it can't detect the obstacle to click, it will try to reposition the player. However, when after failing lava obstacle , this script will not try to re-position itself when it can't find the obstacle to click.