SRL Archive - Test corner

New Lamp Solver


Bebe

2006-05-31 21:12:10

A simple Lamp solver based on Bitmaps that I just made.

program lampsolver;
{.include SRL/SRL.scar}

var
c: integer;

function BFindLamp(skill: String): Boolean;
var
LampTime,SRLLampConfirmBitmap : Integer;
SRLLampBitmap, Bx, By,BMSY2,BMSX2,BMSY1,BMSX1 :Integer;
BFound: boolean;
begin
SRLLampConfirmBitmap := BitmapFromString(6, 6, 'z78DA3330307731303077323702420C' +
'D2002C0B03D855228B23AB471501ABB134373437405103164116A' +
'7961A00FF0A2C7A');
GameTab(4);
case Lowercase(skill) of
'strength':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA3331337636727334B434327784' +
'90266011132471131C6A904530F56292F84D8088B81838195998E' +
'05789AC06972D0066D03023');
end;
'attack':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33350502431310303475044253' +
'0310303437357732778690A6603510125316AAC6C8D4C8C405972' +
'C84C42F8BC54C53532753475C26E09285B81300C0F52EF9');
end;
'range':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA6D8D310EC0300C02BF14275896' +
'C7A456FFFFA436A103434162809340A1903E5F53862D6B5B16735' +
'44BEFDE51CA307F18C9E324A30979546678BF6D85C78A8B0D195D' +
'BFC7C328A92BDF1F3BA92D3F');
end;
'magic':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33743230B33432C4200D0C0CCC' +
'DC5C21A421056A905552AE063FE9E8EA6861600A21017E272E1F');
end;
'defence':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA333535753275340593E6A6E64E' +
'E6CE98A4290E350620600821E9A986181200E8F32DA9');
end;
'hitpoints':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA73713171333034000114D2C412' +
'084D216C17B01A6412533DA69A812501D8592FFF');
end;
'prayer':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA3371317131B104435353235323' +
'131703103084908EAE8E1606A6261035206008614364CD2DCD5C0' +
'C2C50D460C8625103B60B971A64DB916591D5608A63AA01009D54' +
'2E99');
end;
'agility':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA6D8D410A00210C03BFB42D89D0' +
'A3ACFF7FD3AAF150E926904333250804C83E4D8CE9503E4BA654D' +
'BAC395F2CD90FE3740C915BE7EB6274576E3EB7794B6D5DA94C6D' +
'F5F501F8EB2C4A');
end;
'herblore':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA3331010243134B203435353235' +
'327131018B40D80620009505CAB8805970951059034B33670323A' +
'84A881AB009505914358E96060628E2C8B2286A9049FC6AB09B03' +
'00AEFB2BDC');
end;
'thieving':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA3330000243038A49131720B444' +
'2631D5983A02A1297E3566866646A6CE26206088DF1C30C0E91E0' +
'003FD2ACA');
end;
'crafting':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA65CA310E00200803C02FA142D4' +
'91C8FFDF248A438925E9408FD953D8FCE6EBF8DCA693B48AFA459' +
'289962A950D4D5A47535A2871EDDA8C661894B8FE06259A0D065E' +
'2D10');
end;
'runecrafting':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DAB334B0B0B03034B734373337C6' +
'240D40C010973832894B8DA593B1B9811984C46F0E2E35982A71A' +
'9412601E9B32CAE');
end;
'slayer':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA333000024303BCA493A5A3A3A5' +
'1B26099135B73437333776C300C8B2C86A2C0D2C2C2C50CC47560' +
'33119598DA99BA9B3A9397E73206A90550200E2AC2F48');
end;
'farming':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA658DC10DC0300803574A9A82E1' +
'5D85FD47AA22F7E10A3F4E089F204744CC7132EF936F56A638241' +
'28E65658F8154E7D75EB6AB48EEE9F4561DBDDC09F8F645937F3B' +
'5F2D672E39');
end;
'mining':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33300002430330696E6AEE64EE' +
'8C499A8080A1890B105AE252095163EA0884A6B8549A82008A392' +
'666C6CE466E10126A0E0E59086980E45A5CB2A646A646262E00AD' +
'822E54');
end;
'smithing':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33353575327534A59834363572' +
'3374C24F1A80802184C4A506681ED0444C352836E25083AC12001' +
'C852F27');
end;
'fishing':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33300002430322487353732773' +
'674C12226B620984A6F8D5E3123735357532758490262E4068896' +
'C0EB22C84C4258B2C0E00D8492CE9');
end;
'cooking':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA3371317131B134000143377337' +
'7317174C3631A4A985B1A3813326696E69E66260012171892393C' +
'8A611A30697990040992DED');
end;
'firemaking':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA737475B430307504932E2E266E' +
'06864EC6C69606C610B623922C316A90659149883832894B0D31E' +
'6188080217EF70000A2CC3041');
end;
'woodcutting':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33B03473363032C0419A5A183B' +
'1A382393B864914530D5404540C010972EA808580DA64A14D2C8D' +
'4C8C405BF4A008FEA2E04');
end;
'fletching':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA33353235327131750442083034' +
'000143034B33670323635323374327131720B4849220005503918' +
'5A884C842CC4191859806264DC17661CAE2D70BB517044D212620' +
'CB427421AB81B00134F42D6F');
end;
'construction':
begin
SRLLampBitmap := BitmapFromString(6, 6, 'z78DA758CB10DC03008045702117828' +
'1D27DE7F242BC60592158A2BB8D3BBE9A5E28BF450A77E476B318' +
'2DC9D113008445DF06B17E93B4E9B6B80BD26B549AB2C4D38372B' +
'7568D7CDFADF6B477FB29613E6CF2E83');
end;
end;
if (FindBitmapSpiralTolerance(Lamp, Bx, By, 550, 200, 745, 465, 25)) then
begin
Result := True;
if (Screenshots) then
SaveScreenshot('Lamp Random - Bebemycat2 - ' + TimeRunning + '.bmp');
BMSX1:= Trunc(MSX1*0.90);
BMSY1:= Trunc(MSY1*0.90); (*These can be reduced more*)
BMSX2:= Trunc(MSX2*0.90);
BMSY2:= Trunc(MSY2*0.90);
Lamps:= Lamps + 1;
Mouse(Bx, By, 1, 1, True);
Wait(1500+Random(500));
MarkTime(LampTime);
repeat
if(FindBitmapToleranceIn(SRLLampBitmap, Bx, By, BMSY2,BMSX2,BMSY1,BMSX1, 20))then
BFound:=true
if(TimeFromMark(LampTime)>=30000)then
begin
Logout;
Exit;
End;
until(BFound)
if(FindBitmapToleranceIn(SRLLampConfirmBitmap, Bx, By, BMSY2,BMSX2,BMSY1,BMSX1, 20))then
Mouse(Bx, By, 1, 1, True);
wait(200+random(100)+random(80));
end;
freebitmap(SRLLampBitmap);
freebitmap(SRLlampConfirmBitmap);
end;


begin
c:=0;
cleardebug;
setupSRL;
activateclient;
repeat
BFindLamp('attack');
until(c>=1);
end.

Any feedback is welcome. Also, this is untested ;)

Thanks c0de for letting me use your bitmaps :p

And the DTM version (with DTMs made by yohojo8):
program lampsolver;
{.include SRL/SRL.scar}

var
c: integer;

function BFindLamp(skill: String): Boolean;
var
LampTime,SRLLampConfirmBitmap : Integer;
SRLLampDTM, Bx, By,BMSY2,BMSX2,BMSY1,BMSX1 :Integer;
BFound: boolean;
begin
SRLLampConfirmBitmap := BitmapFromString(6, 6, 'z78DA3330307731303077323702420C' +
'D2002C0B03D855228B23AB471501ABB134373437405103164116A' +
'7961A00FF0A2C7A');
GameTab(4);
case Lowercase(skill) of
'strength':
begin
SRLLampDTM := DTMFromString('78DA63BCCFC8C0E004C440C0CC00038C70F23' +
'F10303EC7AF064CDF06B2CC08A879026419E05703004E28088C');
end;
'attack':
begin
SRLLampDTM := DTMFromString('78DA633CCFC8C0A00BC440C0CC00038C48249' +
'03E0A645911507310C8B220A0663B90E58A5F0D0065B30411');
end;
'range':
begin
SRLLampDTM := DTMFromString('78DA63FCCDC8C0E008C440C0CC00038C48249' +
'0FE0764D91050C3C0C4C0604F400D0B508D1901353C403506F8D5' +
'0000CB100357');
end;
'magic':
begin
SRLLampDTM := DTMFromString('78DA635465626070616400016606186044228' +
'1B404508D2301353A40353604D44801D558125003728F097E3500' +
'D6E20204');
end;
'defence':
begin
SRLLampDTM := DTMFromString('78DA63B466626030646400016606186044228' +
'1B437116A40E6D811610E21354E4035CEF8D5000008E4029D');
end;
'hitpoints':
begin
SRLLampDTM := DTMFromString('78DA635CC7C8C0E007C440C0CC00038C48249' +
'0DE45849AB540560C11E6C41250B319C84AC4AF06002E900561');
end;
'prayer':
begin
SRLLampDTM := DTMFromString('78DA63BCC2C8C0E003C440C0CC00038C48249' +
'03E0964851350739F083520BB9208A8B90164451150739EB01A00' +
'75A60738');
end;
'agility':
begin
SRLLampDTM := DTMFromString('78DA637CCFC8C01000C440C0CC00038C48249' +
'0FE44A49A50026ADE0259F104D47C07B26208A8F90D6485E05703' +
'00C8AF07E7');
end;
'herblore':
begin
SRLLampDTM := DTMFromString('78DA631461626088676400016606186044228' +
'134488D3F01353C40358104D4C810A106644E0C0135B24035D1F8' +
'D5000045AF02B7');
end;
'thieving':
begin
SRLLampDTM := DTMFromString('78DA63D463626008626400016606186044228' +
'1B415116A8C816AE208A87100AA0927A04683B01A002AAC02E1');
end;
'crafting':
begin
SRLLampDTM := DTMFromString('78DA63F464626048646400016606186044228' +
'17424508D3F013520730208A88901AA49C0AF0600EF8902CC');
end;
'runecrafting':
begin
SRLLampDTM := DTMFromString('78DA633CCCC8C0D000C440C0CC00038C48249' +
'006A9C920A0663F90554440CD3120AB94809ADD40561E7E35008F' +
'39062C');
end;
'slayer':
begin
SRLLampDTM := DTMFromString('78DA637CCCC8C05009C428809181194C4279A' +
'F81AC4C026A6E02591504D43C04B28A08A8790564D5E3570300D3' +
'7706E6');
end;
'farming':
begin
SRLLampDTM := DTMFromString('78DA63FCCFC8C0500FC440C0CC00038C48249' +
'0E6676260A820A08615A8268B809AEF40562101355C40734AF0AB' +
'010001D80486');
end;
'mining':
begin
SRLLampDTM := DTMFromString('78DA6394606260A8636400016606186044228' +
'1B43A504D3601355A4035B904D46810619724504D3E7E35004302' +
'031B');
end;
'smithing':
begin
SRLLampDTM := DTMFromString('78DA63B462626028636400016606186044228' +
'134484D3601353E40354504D4D802D5D41250E345841A3BA09A3C' +
'FC6A001C220477');
end;
'fishing':
begin
SRLLampDTM := DTMFromString('78DA635CCFC8C0301B8881809901061891482' +
'0BD02C89A4240CD6E206B0211E6B41350B309C89A8E5F0D00A707' +
'0672');
end;
'cooking':
begin
SRLLampDTM := DTMFromString('78DA63BCC4C8C0300B8881809901061891482' +
'07D1AC8EA21A0E63690D54B40CD3920AB8D809A1B40563B7E3500' +
'E7BA0707');
end;
'firemaking':
begin
SRLLampDTM := DTMFromString('78DA637CC3C8C0D00EC440C0CC00038C48249' +
'0FE0464B51250F3830873DE0359B388B08B909AAF44A8F946580D' +
'00E72C0AD6');
end;
'woodcutting':
begin
SRLLampDTM := DTMFromString('78DA63E467626098CDC80002CC0C30C088440' +
'2690922D40802D54C21A0469C08350240356D04D48811560300FA' +
'140416');
end;
'fletching':
begin
SRLLampDTM := DTMFromString('78DA63D467626098CDC80002CC0C30C088440' +
'2693BA09A4E026AF4806A261250630E54D34A408D3A50CD34FC6A' +
'00A0D603F7');
end;
'construction':
begin
SRLLampDTM := DTMFromString('78DA63F462626098C5C80002CC0C30C088440' +
'2E948A09A16026A62806ABA09A88902AA9949400DC83D7DF8D500' +
'00E2F804A1');
end;
end;
if (FindBitmapSpiralTolerance(Lamp, Bx, By, MIX1,MIY1,MIX2,MIY2, 25)) then
begin
Result := True;
if (Screenshots) then
SaveScreenshot('Lamp Random - Bebemycat2 - ' + TimeRunning + '.bmp');
BMSX1:= Trunc(MSX1*0.80);
BMSY1:= Trunc(MSY1*0.80); (*These can be reduced more*)
BMSX2:= Trunc(MSX2*0.80);
BMSY2:= Trunc(MSY2*0.80);
Lamps:= Lamps + 1;
Mouse(Bx, By, 1, 1, True);
Wait(1500 + Random(500));
MarkTime ( LampTime );
repeat
if(FindDtmIn(Bx, By, SRLLampDTM, BMSY2,BMSX2,BMSY1,BMSX1))then
BFound:=true
if(TimeFromMark(LampTime)>=30000)then
begin
Logout;
Exit;
End;
until(BFound)
if(FindBitmapToleranceIn(SRLLampConfirmBitmap, Bx, By, BMSY2,BMSX2,BMSY1,BMSX1, 20))then
Mouse(Bx, By, 1, 1, True);
wait(200+random(100)+random(80));
end;
freeDTM(SRLLampDTM);
freebitmap(SRLlampConfirmBitmap);
end;


begin
c:=0;
cleardebug;
setupSRL;
activateclient;
repeat
BFindLamp('attack');
until(c>=1);
end.

phantombmx

2006-05-31 21:27:55

looks good megan :)

also you might wanna change 'carpentry' to 'construction' as that is what its called ;)

Bebe

2006-05-31 21:30:23

O :p

I guess that would be smart, haha
Thanks for catching that error ;)

Spky

2006-05-31 22:05:42

Nice one ;).

The Un-Named

2006-05-31 22:08:43

Would be easyer with coords but then the guy that posted the picture didn't post coords. :rolleyes:

Bebe

2006-05-31 22:30:08

Well the reason I did it with bitmaps is because it should have been that way to begin with and also, if they change the lamp design then we don't have to rewrite the whole function ;)

-chaos-

2006-05-31 22:32:05

nice i love bitmaps so easy to work with :P

WT-Fakawi

2006-06-01 06:28:40

Bebe: Tried it. Wont work :)

I will give you one of my 'lamped' Players to test it with, k?


[php]program New;
{.include SRL/SRL.scar}

begin
HowManyPlayers:=1;

NumberOfPlayers(HowManyPlayers);

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;

SetupSRL;
LoginPlayer;

Repeat
FindNormalRandoms;
wait(1000);
until(False);
end.[/php]

Mutant Squirrle

2006-06-01 07:54:17

bebe use little bitmaps of very distinct places yours are rather… large :P

Wizzup?

2006-06-01 08:44:07

From: Mutant Squirrle
bebe use little bitmaps of very distinct places yours are rather… large :P


BitMap Masks! *hides in a corner* :p

Bebe

2006-06-01 18:42:59

Ok, Ok I knew it wouldn't work :p

It was a quick first draft that I put into the test corner to see how it faired. I'll fix it….. don't worry ;)

leader

2006-06-01 20:05:26

Whats wrong with the old lamp solver?

Bebe

2006-06-01 20:45:42

The lamp layout changed, plus there is a new skill.

c0de

2006-06-02 20:25:02

Try with my bmps in my lamp solver :o and be sure to credit :P

YoHoJo

2006-06-03 06:02:38

Pfft! Yeah right
DTMs pwn Bitmaps
I made her DTM of each skills.
Shes gona release taht one.
And it will be better than urs.
BITMAPS=GAY!
Haw HAw HAW

Wizzup?

2006-06-03 06:32:13

From: yohojo8
Pfft! Yeah right
DTMs pwn Bitmaps
I made her DTM of each skills.
Shes gona release taht one.
And it will be better than urs.
BITMAPS=GAY!
Haw HAw HAW


I'll make masks of all then, let's see what ones work. :p

c0de

2006-06-03 09:56:42

hahaha owned :)

Bebe

2006-06-03 10:31:07

I have masks already made ;)

Keen

2006-06-03 10:33:19

From: Wizzup?
I'll make masks of all then, let's see what ones work. :p


Yep masked bitmaps rule. *Wissup teach me your skills* :p

Roberty Bob

2006-06-04 09:55:31

Use this in Paintbrush to get all the co-ordinates you need. :)

All my zips have been corrupt lately but hopefully *fingers crossed*
edit: finally found why my zips have been stuffed!!! hooray!! It was my proxy

P.S I have the entire screenshot too, as well as some with certain skills selected etc.

YoHoJo

2006-06-05 16:44:12

We dont need cordiantes.
We like it to run off op DTMs or Bitmaps.
Because each time the lamp is chage so are the cordianates.
Making a DTM or Bitmap would walakys work unless Jagex changes the actauly look of the skill icon. which i havent seen
P.S. The menue at the top ISNT selected when you drag crosshair to scar. So it wouldnt work for cordiantes unless you crop it a bit.

¿ 0 \/\/ /\/ 7
p 1 0 >< ?