bevardis
2012-02-04 17:42:47
How Long have You Played Runescape?
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, Python, Pascal
Are you a member of any other communities?
Kbot, Rscheata
Tell us about yourself…
Please show us one (or multiple) of your scripts.
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Java, Python, Pascal
Are you a member of any other communities?
Kbot, Rscheata
Tell us about yourself…
From: bevardis
I'm from Lithuania and I'm 17. At first, when I found srl, I registered and used scripts with the main intent of acquiring resources for ingame advantage, but now that is not my intention anymore. I want to educate myself and make something useful. Also, I'm trying to keep myself occupied, so I recently started bird watching, wine making, reading and programming.
Please show us one (or multiple) of your scripts.
program new;
{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{
This script was started 2012-02-02
↓ ↑ ↔ → ← ⊗ ♠ ♣ ♥ ♦
GOS stands for Garden Of Serenity as a methaphor for graveyard.
Cuts the Yew in the Lumbridge graveyard.
As a versioning system, I use CUPS, cups of Tea drunk while working on this script.
Due to this untraditional versioning system, I will, at some point, be forced to drink a cup
of Tea just to change the script's version after I had updated it.
Failsafes: Checking if in area and proceeding from there,
teleporting home if lost, and proceeding (not added yet)
checking if Yew is chopped down already, also in a not cpu intensive way
}
const
CUP = 5;
SCRIPTNAME = 'GOS';
{↓Constants you can edit are below↓}
WORLD = 38; {← Input 0 to load a random world.}
MEMBERS = False;
SIGNED = True;
DEBUG = True;
{↑Constants you can edit are above↑}
var
i,C : Integer;
ScriptTitle : String;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; {← Your username.}
Players[0].Pass := ''; {← Your password.}
Players[0].Nick := ''; {←3-4 lowercase letters from username.}
Players[0].Active := True;
Players[0].Pin := '9999'; {← Input your bank pin.}
end;
procedure DefineScriptTitle;
begin
Case Random(4) of
0: SCRIPTTITLE := '♠'+SCRIPTNAME+'♠';
1: SCRIPTTITLE := '♣'+SCRIPTNAME+'♣';
2: SCRIPTTITLE := '♥'+SCRIPTNAME+'♥';
3: SCRIPTTITLE := '♦'+SCRIPTNAME+'♦';
end;
end;
procedure setvars;
var
YewColors : TIntegerArray;
StumpColor : Integer;
Areas : TStringArray;
CenterBox : TBox;
begin
CenterBox := IntToBox(240, 137, 278, 185);
StumpColor := 7115456;
YewColors := [4542554,4410968,4674140,3884109];
Areas := ['80:80:3:0:7:51:34:0:7:33:100:3:7:93:29:4:72:85:73:75:91:76:83:85',
'80:80:3:0:7:40:73:0:7:67:32:0:7:61:117:4:75:90:77:64:87:64:85:91',
'80:80:4:0:7:116:46:0:7:116:92:1:7:70:116:1:7:65:17:4:71:93:68:44:101:43:103:91',
'80:80:5:1:7:50:75:1:7:130:85:1:7:26:55:2:7:43:66:2:7:41:118:4:75:81:79:71:88:77:82:88',
'80:80:2:0:7:75:84:0:7:50:39:4:79:88:86:79:75:73:72:83',
'80:80:3:0:7:86:23:0:7:50:39:0:7:75:84:4:83:86:86:76:75:73:69:83'];
end;
procedure findTree;
var
angle : integer;
begin
Case Random(6) of
0: angle:=320;
1: angle:=240;
2: angle:=79;
3: angle:=28;
4: angle:=297;
5: angle:=30;
end;
SetAngle(RandomRange(0,27));
MakeCompass(angle + RandomRange(5,14));
end;
function ifbetw(a, b, c : integer) : boolean;
begin
result := true;
if a < b then result := false;
if a > c then result := false;
end;
procedure checkyew;
var
colx,coly,StumpColor : integer;
begin
setvars;
StumpColor := 7181250;
if (FindColorSpiralTolerance(colx,coly,StumpColor,0,0,400,400,4)) then
begin
Writeln('Waiting for Yew tree to appear');
WaitColorGone(StumpColor, colx, coly, 4, 360000);
Writeln('Yew spawned');
end;
end;
procedure walktobank;
begin
ObjDTM_Walk('95:36:3:0:7:87:22:0:7:75:84:0:7:51:38', 0, 100, 80, False);
end;
function isAnimating : boolean;
var
CenterBox : TBox;
begin
setvars;
CenterBox := IntToBox(240, 137, 278, 185);
writeln(PixelShift(CenterBox, 2000));
if (PixelShift(CenterBox, 2000) > 1050) then
//if (Animating(CenterBox,2000,800)) then
result := true
else result := false;
end;
procedure Cutyew;
var
x,y:Integer;
YewColors : TIntegerArray;
begin
setvars;
YewColors := [4542554,4410968,4674140,3884109];
if (FindObjCustom(x, y, ['hop','Yew','down'],YewColors, 2)) then
begin
Writeln('Yew found');
MoveMouse(x,y);
ClickMouse2(0);;
WaitOption('down Y',2000);
end;
end;
Function CheckStairs:Boolean;
var
x,y:Integer;
StairColors : TIntegerArray;
Options : TStringArray;
begin
StairColors := [9278356,10923182,9607321,9738907];
if (FindObjCustom(x, y, ['limb','limb-down','limb-up'], StairColors, 2)) then
MoveMouse(x,y);
ClickMouse2(0);
if (ChooseOptionMultiEx(['limb-up'],'All',Nothing) and ChooseOptionMultiEx(['limb-down'],'All',Nothing)) then
begin
writeln('Verified second castle floor area;');
end;
//Mouse(x, y, 0, 0, True);
result:= True;
end;
function walking(a : boolean): boolean;
var
path,pathtoyews,pathtobank : TStringArray;
begin
pathtoyews := ['80:80:5:0:7:49:39:0:7:75:84:1:7:49:75:1:7:132:85:1:7:24:54', '116:74:5:0:7:75:84:0:7:50:39:1:7:132:85:1:7:49:75:1:7:20:43', '100:51:3:0:7:144:75:0:7:42:97:1:7:99:98', '113:79:6:0:7:128:59:0:7:128:104:0:7:27:126:1:7:83:127:1:7:77:30:1:7:57:26', '119:105:4:0:7:100:120:0:7:96:108:1:7:90:46:1:7:136:73', '88:130:3:0:7:108:88:0:7:59:88:3:7:149:82', '127:83:4:0:7:98:39:0:7:84:104:0:7:50:40:1:7:130:78'];
pathtobank := ['80:80:3:0:7:51:34:0:7:33:100:3:7:93:29', '29:72:3:0:7:51:35:0:7:34:100:3:7:93:31', '76:38:5:0:7:104:48:0:7:55:47:0:7:87:112:1:7:134:88:1:7:96:14', '32:69:3:0:7:59:48:0:7:59:92:1:7:83:15', '43:118:3:0:7:107:65:0:7:106:108:1:7:61:129', '53:80:2:1:7:98:90:1:7:18:78'];
writeln('fftoyews');
//path:=pathtobank;
if (a) then path := pathtoyews else path:=pathtobank;
//If true will walk to yews, if false will walk to bank
for I := 0 to High(path) do
begin
WriteLn(i);
ObjDTM_Walk(path[i], 0, 100, 80, True);
end;
end;
procedure walktostairs;
begin
Writeln('WalkToStairs');
ObjDTM_Walk('80:80:3:0:7:51:38:0:7:75:84:0:7:88:21', 0, 100, 80, False);
end;
procedure climbDown;
var
x,y:Integer;
StairColors : TIntegerArray;
begin
StairColors := [9278356,10923182,9607321,9738907];
if (FindObjCustom(x, y, ['limb','limb-down','limb-up'],StairColors, 2)) then
begin
MoveMouse(x,y);
ClickMouse2(0);
WaitOption('imb-dow',2000);
end;
end;
procedure climbUp;
var
x,y:integer;
StairColors : TIntegerArray;
begin
StairColors := [9278356,10923182,9607321,9738907];
if (FindObjCustom(x, y, ['limb','limb-down','limb-up'],StairColors, 2)) then
begin
MoveMouse(x,y);
ClickMouse2(0);
WaitOption('imb-up',2000);
end;
end;
function checkloc : string;
var
Areas : TStringArray;
loc : string;
begin
//Writeln('Function: checkloc;');
setvars;
Areas := ['80:80:3:0:7:51:34:0:7:33:100:3:7:93:29:4:72:85:73:75:91:76:83:85',
'80:80:3:0:7:40:73:0:7:67:32:0:7:61:117:4:75:90:77:64:87:64:85:91',
'80:80:4:0:7:116:46:0:7:116:92:1:7:70:116:1:7:65:17:4:71:93:68:44:101:43:103:91',
'80:80:5:1:7:50:75:1:7:130:85:1:7:26:55:2:7:43:66:2:7:41:118:4:75:81:79:71:88:77:82:88',
'80:80:2:0:7:75:84:0:7:50:39:4:79:88:86:79:75:73:72:83',
'80:80:3:0:7:86:23:0:7:50:39:0:7:75:84:4:83:86:86:76:75:73:69:83'];
if (ObjDTM_InArea(Areas[0], True)) then loc:='yew';
if (ObjDTM_InArea(Areas[1], False)) then loc:='bank';
if (ObjDTM_InArea(Areas[2], True)) then loc:='lumb';
if (ObjDTM_InArea(Areas[3], True)) then loc:='ffgrleft';
if (ObjDTM_InArea(Areas[4], False)) then loc:='sfngrleft';
if (ObjDTM_InArea(Areas[5], False)) then loc:='tfngrleft';
writeln('Current location: '+loc);
result := loc;
end;
procedure Awesome;
var
timeout,amount1,amount2,I : integer;
uptext1,uptext2,loc : String;
Path,Areas: TStringArray;
PlayerStatus : Boolean;
begin
Case C of
0: {determine case}
begin
setvars;
Path := ['80:80:3:0:7:52:33:0:7:36:95:3:7:92:29', '35:64:3:0:7:56:34:0:7:41:95:3:7:96:29', '67:36:4:0:7:56:53:0:7:56:10:0:7:102:53:0:7:86:115', '80:80:6:0:7:67:57:0:7:67:99:1:7:24:121:1:7:24:29:6:7:42:71:6:7:40:128', '33:76:3:0:7:67:56:0:7:67:99:1:7:23:121', '53:117:4:0:7:111:64:1:7:43:32:1:7:62:36:1:7:66:129', '49:87:3:0:7:43:92:1:7:19:83:1:7:98:94'];
loc := 'lost';
Writeln('finding out location');
if (ObjDTM_InArea(Areas[0], True)) then loc:='yew';C:=4;Awesome;
if (ObjDTM_InArea(Areas[1], False)) then loc:='bank';C:=3;Awesome;
if (ObjDTM_InArea(Areas[2], True)) then loc:='lumb';C:=8;Awesome;
if (ObjDTM_InArea(Areas[3], True)) then loc:='ffgrleft';C:=8;Awesome;
if (ObjDTM_InArea(Areas[4], True)) then loc:='sfngrleft';C:=8;Awesome;
if (ObjDTM_InArea(Areas[5], False)) then loc:='tfngrleft';C:=8;Awesome;
//if (loc = 'lost') then C:=6;Awesome;
end;
1:{login case}
begin
Writeln('login case;');
if not(LoggedIn) then
begin;
Loginplayer;
PlayerStatus := True;
end;
C:=7;Awesome;
end;
2:{logout case}
begin //SearchBank(
Writeln('logout case;'); //FixBank;
if (LoggedIn) then Logout;
NextPlayer(playerstatus);C:=1;Awesome; //FixBankTab
end;
3:{bank phase}
begin
if (invfull) then
begin //CloseBank //OpenBankNPC
if not (BankScreen) then
begin
OpenBankNPC;
While not (BankScreen) do If (timeout > 25) then Break;wait(200);inc(timeout);
end;
if (BankScreen) then
begin
Deposit(2,28,True);
//QuickDeposit(RandomRange(2,27));
CloseBank;
end;
C:=3;Awesome;
end;
C:=7;Awesome;
end;
4:{Cut phase}
begin
While (not invfull) do
begin
checkyew;
findTree;
cutyew;
while (isAnimating) do
begin
Writeln('Player is animating');
wait(RandomRange(400,900));
Writeln('Waited animation time');
end;
end;
C:=7;Awesome;
{Find yew}
{Cut}
{keep checking if inv full}
{If inv full, phase = 7}
end;
5:Writeln('C := 6'); {teleport home}
6:Writeln('sdijg'); {yews to bank}
7:
begin
loc := checkloc;
Writeln('The location is '+loc);
//Writeln(loc);
Case loc of
'yew':
begin
If (invfull) then walking(false);
if (not invfull) then C:=4;Awesome;
end;
'bank':
begin
//Writeln(loc);
Writeln('suris');
if (not invfull) then walktostairs;
If (invfull) then C:=3;Awesome;
//ObjDTM_WalkPath(['80:80:3:0:7:51:42:0:7:75:84:10:7:91:30'], 0, 100, 80, True, True)
checkloc;
end;
'lumb':
begin
//Writeln(loc);
{walk towards yews}
checkloc;
end;
'ffgrleft':
begin
//Writeln(loc);
if (invfull) then climbUp;
if (not invfull) then Walking(true);
checkloc;
end;
'tfngrleft':
begin
//Writeln(loc);
if (invfull) then walktobank;
if (not invfull) then climbDown;
checkloc;
end;
'sfngrleft':
begin;
Writeln('C=7;');
if (invfull) then climbUp;
if (not invfull) then climbDown;
checkloc;
end;
end;
//Writeln(loc);
C:=7;Awesome;
end;
end;
end;
begin
DefineScriptTitle;
Disguise(ScriptTitle + ' cup '+ FloatToStr(CUP));
Smart_Server := WORLD;Smart_Members := MEMBERS;Smart_Signed := SIGNED;Smart_Signed := SIGNED;
ClearDebug;
SetupSRL;
DeclarePlayers;
ClearDebug;
ObjDTM_Setup;
C:=1;Awesome;
end.