n3ss3s
2007-07-30 08:44:43
Yeah, I was scripting today and I got the lamp and I tried FindLamp to findout if it works and it didnt, so I made a DTMs using my own bit different lamp solver.
I tested it on the lamp I had and it works perfect.
I tested it on the lamp I had and it works perfect.
{*******************************************************************************
function FindLamp2(Skill: string): Boolean;
by: n3ss3s
Description: Finds the lamp in inventory using DTM and solves.
*******************************************************************************}
function FindLamp2(Skill: string): Boolean;
var
dtmLamp, Choose, Ve: Integer;
var
P1, P2, P3, P4: TPoint;
begin
dtmLamp := DTMFromString('78DA63F4646260F0676440065BD7098069982' +
'86308504D30AA1A1880AB0905AA0920A02600A8C697801A2FA01A' +
'2F026ADC816ABC09A87121C22E3BA01A1F026AAC806AFC08A8712' +
'0C2EF20F78410E1AF5022C287901A5FC26A00B9BC0A09');
if(FindDTM(dtmLamp, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
Mouse(x, y, 2, 2, True);
FreeDTM(dtmLamp);
Choose := CreateBitmapMaskFromText('Choose', UpChars);
repeat
Wait(10);
until(FindBitmapMaskTolerance(Choose, x, y, MSX1, MSY1, MSX2, MSY2, 50, 30));
FreeBitmap(Choose);
P1.x := 199;
P1.y := 142;
P2.x := 183;
P2.y := 173;
P3.x := 180;
P3.y := 200;
P4.x := 183;
P4.y := 230;
Ve := 30;
case Lowercase(Skill) of
'attack': Mouse(P1.x, P1.y, 3, 3, True);
'strength': Mouse(P1.x + Ve, P1.y, 3, 3, True);
'ranged': Mouse(P1.x + Ve * 2, P1.y, 3, 3, True);
'magic': Mouse(P1.x + Ve * 3, P1.y, 3, 3, True);
'defence': Mouse(P1.x + Ve * 4, P1.y, 3, 3, True);
'hitpoints': Mouse(P2.x, P2.y, 3, 3, True);
'prayer': Mouse(P2.x + Ve, P2.y, 3, 3, True);
'agility': Mouse(P2.x + Ve * 2, P2.y, 3, 3, True);
'herblore': Mouse(P2.x + Ve * 3, P2.y, 3, 3, True);
'thieving': Mouse(P2.x + Ve * 4, P2.y, 3, 3, True);
'crafting': Mouse(p2.x + Ve * 5, P2.y, 3, 3, True);
'runecrafting': Mouse(P3.x, P3.y, 3, 3, True);
'slayer': Mouse(P3.x + Ve, P3.y, 3, 3, True);
'farming': Mouse(P3.x + Ve * 2, P3.y, 3, 3, True);
'mining': Mouse(P3.x + Ve * 3, P3.y, 3, 3, True);
'smithing': Mouse(P3.x + Ve * 4, P3.y, 3, 3, True);
'fishing': Mouse(P3.x + Ve * 5, P3.y, 3, 3, True);
'cooking': Mouse(P4.x, P4.y, 3, 3, True);
'firemaking': Mouse(P4.x + Ve, P4.y, 3, 3, True);
'woodcutting': Mouse(P4.x + Ve * 2, P4.y, 3, 3, True);
'fletching': Mouse(P4.x + Ve * 3, P4.y, 3, 3, True);
'construction': Mouse(P4.x + Ve * 4, P4.y, 3, 3, True);
'hunter': Mouse(P4.x + Ve * 5, P4.y, 3, 3, True);
end;
Wait(1000 + Random(250));
Mouse(261, 279, 5, 1, True);
Wait(6000 + Random(25));
if(FindNpcChatText('Your wish has'))then
begin
Writeln('*** Solved Lamp Random ***');
Result := True;
end;
end;
end;