Naum
2009-08-26 16:20:11
1) FindXP, 'prayer' augument could be shortened from this:
to this:
If this is done then 2 new variables, 'P' being a string and 'T' being an Extended would need to be added :).
2) SetAngle could be shortened and a variable could be removed:
to:
3) A new SetupAutoCast:
to:
Fixed a DIB error
Fixed Out Of Range Error
Fixed Co-ordinates
Removed the need for colors, found out that the outline stayed the same.
Added a Mouse() to exit the popup
Needed To Set The Length
Fixed how it would select 'Defensive', the co-ords were off by too much.
Credits go to Richard.
Big hand to Markus for letting me test it on his account :)
4) FindAxe's 'FoundAxe' output could be array'ised'.
Thanks for looking over, please post suggestions, or further shortenings :D
'prayer': case sType of // PRAYER
'normal bones' : Result:= 4.5; // NORMAL BURYING BONES
'burnt bones' : Result:= 4.5;
'wolf bones' : Result:= 4.5;
'monkey bones' : Result:= 5;
'bat bones' : Result:= 5.3;
'big bones' : Result:= 15;
'jogre bones' : Result:= 15;
'shaikahan bones' : Result:= 25;
'baby dragon bones': Result:= 30;
'wyvern bones' : Result:= 50;
'dragon bones' : Result:= 72;
'dagannoth bones' : Result:= 125;
'zogre bones' : Result:= 22.5;
'fayrg bones' : Result:= 84;
'raurg bones' : Result:= 96;
'ourg bones' : Result:= 140;
'g normal bones' : Result:= 4.5 * 3.5; // GILDED + BURNERS
'g burnt bones' : Result:= 4.5 * 3.5;
'g wolf bones' : Result:= 4.5 * 3.5;
'g monkey bones' : Result:= 5 * 3.5;
'g bat bones' : Result:= 5.3 * 3.5;
'g big bones' : Result:= 15 * 3.5;
'g jogre bones' : Result:= 15 * 3.5;
'g shaikahan bones' : Result:= 25 * 3.5;
'g baby dragon bones': Result:= 30 * 3.5;
'g wyvern bones' : Result:= 50 * 3.5;
'g dragon bones' : Result:= 72 * 3.5;
'g dagannoth bones' : Result:= 125 * 3.5;
'g zogre bones' : Result:= 22.5 * 3.5;
'g fayrg bones' : Result:= 84 * 3.5;
'g raurg bones' : Result:= 96 * 3.5;
'g ourg bones' : Result:= 140 * 3.5;
'e normal bones' : Result:= 4.5 * 4; // ECTOFUNTUS
'e burnt bones' : Result:= 4.5 * 4;
'e wolf bones' : Result:= 4.5 * 4;
'e monkey bones' : Result:= 5 * 4;
'e bat bones' : Result:= 5.3 * 4;
'e big bones' : Result:= 15 * 4;
'e jogre bones' : Result:= 15 * 4;
'e shaikahan bones' : Result:= 25 * 4;
'e baby dragon bones': Result:= 30 * 4;
'e wyvern bones' : Result:= 50 * 4;
'e dragon bones' : Result:= 72 * 4;
'e dagannoth bones' : Result:= 125 * 4;
'e zogre bones' : Result:= 22.5 * 4;
'e fayrg bones' : Result:= 84 * 4;
'e raurg bones' : Result:= 96 * 4;
'e ourg bones' : Result:= 140 * 4;
end;
to this:
'prayer': Begin
Case sType[1] Of
'g' : T := 3.5;
'e' : T := 4.0;
End;
If T = 3.5 Then P := 'g ';
If T = 4.0 Then P := 'e ';
If T = 0.0 Then P := '';
Case sType of // PRAYER
P+'normal bones', P+'burnt bones', P+'wolf bones' : Result:= 4.5 * (1.0 * T);
P+'monkey bones' : Result:= 5 * (1.0 * T);
P+'bat bones' : Result:= 5.3 * (1.0 * T);
P+'jogre bones', P+'big bones' : Result:= 15 * (1.0 * T); //those give same amount of XP too.
P+'shaikahan bones' : Result:= 25 * (1.0 * T);
P+'baby dragon bones': Result:= 30 * (1.0 * T);
P+'wyvern bones' : Result:= 50 * (1.0 * T);
P+'dragon bones' : Result:= 72 * (1.0 * T);
P+'dagannoth bones' : Result:= 125 * (1.0 * T);
P+'zogre bones' : Result:= 22.5 * (1.0 * T);
P+'fayrg bones' : Result:= 84 * (1.0 * T);
P+'raurg bones' : Result:= 96 * (1.0 * T);
P+'ourg bones' : Result:= 140 * (1.0 * T);
End;
End;If this is done then 2 new variables, 'P' being a string and 'T' being an Extended would need to be added :).
2) SetAngle could be shortened and a variable could be removed:
procedure SetAngle(Highest : Boolean);
var
Key: Byte;
begin;
if (not LoggedIn) then exit;
if (Highest) then
Key := 38
else Key := 40;
KeyDown(Key);
Sleep(1000 + Random(100) + Random(200));
KeyUp(Key);
Wait(500 + Random(100));
end;to:
procedure SetAngle(Highest : Boolean);
begin
if (not LoggedIn) then exit;
KeyDown((Integer(Not Highest)*2)+38);
Sleep(1000 + Random(300));
KeyUp((Integer(Not Highest)*2)+38);
Wait(500 + Random(100));
end;3) A new SetupAutoCast:
function SetUpAutoCast(AutoSpell: string; Defensive: Boolean): Boolean;
var
X, Y: Integer;
begin
Result := False;
if not GameTab(tab_Combat) then exit;
if (Defensive) then
Mouse(655, 253, 50, 25, True)
else Mouse(665, 320, 50, 25, True);
Wait(2000 + Random(1500));
case LowerCase(AutoSpell) of
'wind strike', '1': Result := FindColor(X, Y, 16579836, 577, 236, 588, 246);
'water strike','2': Result := FindColor(X, Y, 16563743, 617, 236, 628, 246);
'earth strike','3': Result := FindColor(X, Y, 3003805, 657, 236, 668, 246);
'fire strike', '4': Result := FindColor(X, Y, 835570, 696, 236, 707, 246);
'wind bolt', '5': Result := FindColor(X, Y, 16579836, 577, 295, 590, 309);
'water bolt', '6': Result := FindColor(X, Y, 16563743, 617, 295, 630, 309);
'earth bolt', '7': Result := FindColor(X, Y, 3003805, 656, 295, 669, 309);
'fire bolt', '8': Result := FindColor(X, Y, 835570, 697, 295, 710, 309);
'wind blast', '9': Result := FindColor(X, Y, 16579836, 573, 356, 587, 371);
'water blast','10': Result := FindColor(X, Y, 16563743, 614, 356, 628, 371);
'earth blast','11': Result := FindColor(X, Y, 3003805, 654, 356, 668, 371);
'fire blast', '12': Result := FindColor(X, Y, 835570, 694, 357, 708, 372);
'wind wave', '13': Result := FindColor(X, Y, 16579836, 574, 414, 591, 435);
'water wave', '14': Result := FindColor(X, Y, 16563743, 614, 414, 631, 435);
'earth wave', '15': Result := FindColor(X, Y, 3003805, 655, 414, 672, 435);
'fire wave', '16': Result := FindColor(X, Y, 835570, 694, 414, 711, 435);
else
begin
srl_Warn('SetUpAutoCast', '"' + AutoSpell + '" is not a valid autocasting spell.', warn_Warning);
Mouse(687, 584, 4, 4, True); // Exits the autocasting spells setup 'popup'.
Exit;
end;
end;
if (Result) then
begin
Mouse(X, Y, 2, 2, True);
Wait(1750 + Random(1500));
end;
end;
to:
Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
Var SpellNames : Array [0..1] Of TStringArray;
TSA : TStringArray;
i, xb, yb, x, y : Integer;
SpellInt : TIntegerArray;
Begin
If Not GameTab(Tab_Combat) Then Exit;
SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
Mouse(655, ((Integer(not(Defensive)) * 60) + 253), 50, 25, True);
TSA := srl_Explode(Spell, ' ');
SetLength(SpellInt, 2);
For I := 0 To 1 Do
If Not(InStrArrEx(TSA[i], SpellNames[i], SpellInt[i])) Then
Begin
srl_Warn('SetupAutoCast', 'Invalid spell name', warn_AllVersions);
Exit;
End;
xb := 585 + (39 * SpellInt[0]);
yb := 245 + (60 * SpellInt[1]);
Wait(500 + Random(500));
If Not FindColor(x, y, 2, xb - 10, yb - 10, xb + 10, yb + 10) then
Mouse(xb, yb, 3, 3, True)
Else
Mouse(687, 448, 9, 4, True); //If it's invalid then exit menu
End;Fixed a DIB error
Fixed Out Of Range Error
Fixed Co-ordinates
Removed the need for colors, found out that the outline stayed the same.
Added a Mouse() to exit the popup
Needed To Set The Length
Fixed how it would select 'Defensive', the co-ords were off by too much.
Credits go to Richard.
Big hand to Markus for letting me test it on his account :)
4) FindAxe's 'FoundAxe' output could be array'ised'.
Thanks for looking over, please post suggestions, or further shortenings :D