SRL Archive - First Scripts

Bruce's(yamaha317's) First Script.


yamaha317

2007-10-19 03:10:40

Alright i decided to read a TON of tutorials and once i got sick of reading i decided to make this script, its way different than most people's first scripts as i can see are either a auto typer or some type of auto miner or something since i am "weird" i decided a different and maybe less practical but more learning approach.

I ask for constructive criticism (after you test it if you have Firefox) and any idea's of improvement as a scripter or towards the script itself. Also please do not post or use my script as your own work anywhere without my approval.

What my script does is open firefox and bring runescape up in selected detail and selected worlds (somewhat) and login with your acc and password.

program RunescapeFF;                                        //Opens Runescape in Firefox
{.include SRL\SRL.scar}

var
x, y:Integer; //Coordinates
FF, MAXX, ADD, PLAY, HighD, LowD, MemsBW, NonBW, Cross, TBScar:Integer; //DTMs
Account, Password:string; //Account Settings.
High, Member, BestW:Boolean; //Options
ACC, PASS: array[0..1] of string; //Options

procedure Setup;
begin
High:=True //Detail (high or low?)
Member:=False //Members world (members or non?)
BestW:=True //Choose Best World? (keep true not made yet)
Account:='YourACCHere'; //Account
Password:='YourPassHere'; //Password
end;

procedure DTMs;
begin
FF:= DTMFromString('78DA63546660606064644006979C58C1344C9' +
'4D11848B0A3AAF9F38111558D3A90F885A28461CD836FA86AA481' +
'0433AA39F78A4550D580DC2384AA66A728078A1A008FED09A4');
MAXX:= DTMFromString('78DA631462626068664001D6E55FC1342394C' +
'F2803545385AA266DF20B5435524035DDA86A185C2FA3AAE105AA' +
'E94055F2FFFF7F4C3575B8D5300331004BFF0DA2');
ADD:= DTMFromString('78DA63BCCBC0C060CF801530C2E8D740C2938' +
'09A4F40C289809A8740C29D809A9744980352E38C2AF7FFFF7F54' +
'35F781840B0135778084077E3500A6841252');
PLAY:= DTMFromString('78DA63AC666060C867400117B7D7806946289' +
'FF10A900827A08615C89A4A404D0E036135654062310356005773' +
'10484CC06F0E005E42103C');
HighD:= DTMFromString('78DA63FCCBC0C070800105DC7CEC01A619A17' +
'CC64C20B117558DB58B10AA9AFD406222AA9A924C7E5435B381C4' +
'6A5435AB4A0B50D5AC0112E751D5FCFBF70F55CD1F20711955CDC' +
'AA9BC286A00ADFE1225');
LowD:= DTMFromString('78DA637463626058CE80027E7FF503D38C503' +
'EE32E206B2BAA9A277B9851D5EC03B2AEA3AA39B5991F558D3BD0' +
'AE03A86AB62EE74355F310C8DA81AAC68F930555CD27206B297E3' +
'500C8080FCA');
NonBW := DTMFromString('78DA63BCC0C0C0B08A01052C99DBCDC00AA41' +
'981F83F10300602590750D56C5C3D17AE0604186F008943A86A36' +
'AF9D8EAA461EC85A8CAA6613BA9A284C35ABE6B5A0AAF90924AEA' +
'0D9B56626AA1A7320EB369A9A55A86A00C7931A61');
MemsBW := DTMFromString('78DA634C676460E864400197B656836946289' +
'FF10E90D585AAE6CCD66654357C4C0C0C2DA86A4E6EEA4455F31F' +
'C8CA435573766B3BAA9AEB40D6625435C7B74F4555330BC89A8FA' +
'AE6DCD67A14350039151344');
Cross:= DTMFromString('78DA63CC6462602865C00A18617411116A40E' +
'6E410509340A4397504D4DC06AA99852AF7FFFF7F143500CC5608' +
'E1');
TBScar:= DTMFromString('78DA635CCBC0C0C0C78002CE18436846289F7' +
'117901066C00AE06AB600096E026AD61261CE6620218A5F0D0038' +
'0C04D9');
end;

procedure OpenFF;
begin
ClearDebug;
PlaySound('C:\WINDOWS\Media\winSpaceSysStart');
{minimize overlapping programs later?}
repeat
FindDTM(FF, x, y, 0, 0, 1023, 767);
until(FindDTM(FF, x, y, 0, 0, 1023, 767));
Mouse(x, y, 0, 0, True);
Mouse(x, y, 0, 0, True);
repeat
FindDTM(ADD, x, y, 0, 0, 1023, 767);
until(FindDTM(ADD, x, y, 0, 0, 1023, 767));
if FindDTM(MAXX, x, y, 0, 0, 1023, 767) then //incase already maximized
Mouse(x, y, 0, 0, True);
begin
repeat
FindDTM(Add, x, y, 0, 0, 1023, 767);
until(FindDTM(Add, x, y, 0, 0, 1023, 767));
Mouse(x, y, 0, 0, True);
TypeSend('www.runescape.com' + #13);
{Different browsers later}
end;
end;

procedure Enterscape;
begin
repeat
FindDTM(PLAY, x, y, 0, 0, 1023, 767);
until(FindDTM(PLAY, x, y, 0, 0, 1023, 767));
Mouse(x, y, 0, 0, True);
if (High=True) then
begin
repeat
FindDTM(HighD, x, y, 0, 0, 1023, 767);
until(FindDTM(HighD, x, y, 0, 0, 1023, 767));
Mouse(x, y, 0, 0, True);
end else
begin
repeat
FindDTM(LowD, x, y, 0, 0, 1023, 767);
until(FindDTM(LowD, x, y, 0, 0, 1023, 767));
Mouse(x, y, 0, 0, True);
end;
end;

procedure WorldSel;
begin
Mouse(0, 100, 0, 0, True);
if (BestW=True) and (Member=True) then
begin
FindDTM(MemsBW, x, y, 0, 0, 1023, 767);
Mouse(x, y, 0, 0, True);
end else
begin
if (BestW=True) and (Member=False) then
FindDTM(NonBW, x, y, 0, 0, 1023, 767);
Mouse(x, y, 0, 0, True);
{writing in more world selecting options later}
end;
end;

Procedure Login;
begin
repeat
Wait(5000);
findcolor(x, y, 65535, 400, 400, 500, 500);
until(findcolor(x, y, 65535, 400, 400, 500, 500));
Mouse(600, 500, 0, 0, True);
Typesend(Account + #13 + Password);
{Better Account Settings}
Mouse(450, 520, 0, 0, True);
end;

Procedure ProgressSig;
begin
writeln('RuneFF script by: ');
writeln('____________________________________________');
writeln(' \ _ \ / __ \ \ | | / / __/ / ___/ ');
writeln(' | || / | \--\/ | | | | / / / \__ ');
writeln('--| - |---| / \ \---| |-| |-| |-----| __|--');
writeln(' | || \ | | \ \ | \_/ | \ \__ \ /__ ');
writeln('__/____/__\_/___\/__\_____/___\___\__\____\_');
writeln('AKA: Yamaha317');
end;

begin
SetupSRL;
DTMs;
Setup;
OpenFF;
Enterscape;
WorldSel;
Login;
ProgressSig;
end.

All of these commented things in my script are possible improvements for later.
 {minimize overlapping programs later?}
{Different browsers later}
{writing in more world selecting options later}
{Better Account Settings}

Submersal

2007-10-19 04:30:37

Definitely going to try this.

I'll let you know with an edit on how it went.

EDIT: Sorry but it didn't end up working….debug box just went blank and that's it.

yamaha317

2007-10-19 12:41:07

From: Submersal
Definitely going to try this.

I'll let you know with an edit on how it went.

EDIT: Sorry but it didn't end up working….debug box just went blank and that's it.


make sure you use your desktop as your target window and make sure firefox is visable also make sure its not highlighted.

Rikje

2007-10-19 13:31:08

Looks nice :)
good use of dtm etc :D
but try to make failsaves ;)

yamaha317

2007-10-19 13:45:35

From: rikjess
Looks nice :)
good use of dtm etc :D
but try to make failsaves ;)


alright thanks, was thinking of trying to make those but last night i was tired and just posted it to get feedback and such which i havnt gotten much of but every little bit counts thanks.

rogeruk

2007-10-19 15:54:41

Sort out your standards and add failsafes.

Failsafe =


repeat
wait(100+random(100));
c:=c+1;
until(FindDTM(test,x,y,0,0,500,500)) or (c>10)

This will repeat the wait until c is greater than 10 or you find the DTM. 10x100 = 1000, so it will wait at least 1 second before breaking out in the failsafe.

If it fails (failsafe), then you may want it to relocate your player? check colors? or just logout maybe?

gerauchert

2007-10-19 16:05:44

yeah it doesnt seem to find the firefox dtm on my desktop, it just sits there :(

yamaha317

2007-10-19 16:14:33

From: gerauchert
yeah it doesnt seem to find the firefox dtm on my desktop, it just sits there :(


hmmm maybe i need to edit the dtm? or maybe you had firefox highlighted? i dont know but it works perfect on my comp =/ lol ill try and figure it out.

Maybe this will work if you replace this DTM with the other.
  FF:= DTMFromString('78DA63546560606064644006CF2A75C1344C9' +
'4511B48F0A2AA51104153A30E24FEA12861F0997512558D1C9060' +
'473567961423AA1A907BF850D55C6C3241510300BA8407C2')

From: rogeruk
Sort out your standards and add failsafes.

Failsafe =


repeat
wait(100+random(100));
c:=c+1;
until(FindDTM(test,x,y,0,0,500,500)) or (c>10)

This will repeat the wait until c is greater than 10 or you find the DTM. 10x100 = 1000, so it will wait at least 1 second before breaking out in the failsafe.

If it fails (failsafe), then you may want it to relocate your player? check colors? or just logout maybe?


will try adding them, also i added the actual SRL login process. will post an update maybe tonight if i get to working on it.

yamaha317

2007-10-20 15:46:04

any other thoughts? or tests?

yamaha317

2007-10-21 17:03:27

From: yamaha317
any other thoughts? or tests?


bump? (hopefully bumping is aloud it has been awhile since a reply..)