ne lg
2012-06-04 21:37:12
Granted, this isnt a script in its own right however its the first thing i've written.
It's for Er1k's wilderness script, what it does is banks at edge, lode stone ports to ardy, then walks to the lever, teleport, cuts the web, walks to the course, opens the gate and tada, back at the agility course.
If anyone can test it for me please, some of the Obj_DTMS are a bit shakey, i dont know how to get them more reliable though.
Any feedback would be greatly appreicated, Also, i understand that this isn't a script, it's just the first code i've written :P
If you could try see if it works for you i'd appreicate it, You need food in your first bank slot(or change the function to where your food is) and you start at the respawn point in edgeville.
Please try it out and tell me witch DTM's arent working for you, because they are very unreliable for me.
Any criticsm is appreicated. Thanks for all the help i got in the Help section of the fourms and for YoHo's videos+ a few tutorials. I'm really suprised at how good the SRL community is to new people trying to learn how to script, it's very encouraging :redface:
It's for Er1k's wilderness script, what it does is banks at edge, lode stone ports to ardy, then walks to the lever, teleport, cuts the web, walks to the course, opens the gate and tada, back at the agility course.
If anyone can test it for me please, some of the Obj_DTMS are a bit shakey, i dont know how to get them more reliable though.
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.
Any feedback would be greatly appreicated, Also, i understand that this isn't a script, it's just the first code i've written :P
If you could try see if it works for you i'd appreicate it, You need food in your first bank slot(or change the function to where your food is) and you start at the respawn point in edgeville.
Please try it out and tell me witch DTM's arent working for you, because they are very unreliable for me.
Any criticsm is appreicated. Thanks for all the help i got in the Help section of the fourms and for YoHo's videos+ a few tutorials. I'm really suprised at how good the SRL community is to new people trying to learn how to script, it's very encouraging :redface: