muna580
2006-07-05 16:27:35
Below is a function from SRL Magic skill. It cast's a spell and then check if enough runes are avilabe to cast another one.
I was wondering if someone can help me so it just cast's the spell one time. It shoudln't check if more runes are avilable.
Please help me edit this.
I was wondering if someone can help me so it just cast's the spell one time. It shoudln't check if more runes are avilable.
Please help me edit this.
{*******************************************************************************
function Cast(Spell: String) : Boolean;
By: Spky / Wizzup?
Description: Cast's the selected spell, returns true if enough runes to complete.
*******************************************************************************}
function Cast(TheSpell : string) : Boolean;
var
Spell : string;
Color : Integer;
Coords : TPoint;
begin
Spell:= Lowercase(TheSpell);
GameTab(7);
if ((Spell) = 'wind strike') or (Spell = '1') then
begin FixMage(True); Color:= 1907996; Coords.x:= 563; Coords.y:= 225; end;
if ((Spell) = 'confuse') or (Spell = '2') then
begin FixMage(True); Color:= 2359833; Coords.x:= 585; Coords.y:= 225; end;
if ((Spell) = 'water strike') or (Spell = '3') then
begin FixMage(True); Color:= 2429972; Coords.x:= 635; Coords.y:= 225; end;
if ((Spell) = 'enchant lvl-1 jewelry') or (Spell = '4') then
begin FixMage(True); Color:= 1966596; Coords.x:= 563; Coords.y:= 225; end;
if ((Spell) = 'earth strike') or (Spell = '5') then
begin FixMage(True); Color:= 72450; Coords.x:= 660; Coords.y:= 225; end;
if ((Spell) = 'weaken') or (Spell = '6') then
begin FixMage(True); Color:= 2359833; Coords.x:= 690; Coords.y:= 225; end;
if ((Spell) = 'fire strike') or (Spell = '7') then
begin FixMage(True); Color:= 70437; Coords.x:= 708; Coords.y:= 225; end;
if ((Spell) = 'bones to bananas') or (Spell = '8') then
begin FixMage(True); Color:= 2500134; Coords.x:= 559; Coords.y:= 250; end;
if ((Spell) = 'wind bolt') or (Spell = '9') then
begin FixMage(True); Color:= 1250324; Coords.x:= 582; Coords.y:= 250; end;
if ((Spell) = 'curse') or (Spell = '10') then
begin FixMage(True); Color:= 2359833; Coords.x:= 606; Coords.y:= 250; end;
if ((Spell) = 'bind') or (Spell = '11') then
begin FixMage(True); Color:= 1842204; Coords.x:= 635; Coords.y:= 250; end;
if ((Spell) = 'low level alchemy') or (Spell = '12') then
begin FixMage(True); Color:= 596489; Coords.x:= 665; Coords.y:= 250; end;
if ((Spell) = 'water bolt') or (Spell = '13') then
begin FixMage(True); Color:= 2427402; Coords.x:= 680; Coords.y:= 250; end;
if ((Spell) = 'varrock teleport') or (Spell = '14') then
begin FixMage(True); Color:= 2500134; Coords.x:= 709; Coords.y:= 250; end;
if ((Spell) = 'enchant lvl-2 jewelry') or (Spell = '15') then
begin FixMage(True); Color:= 67842; Coords.x:= 561; Coords.y:= 276; end;
if ((Spell) = 'earth bolt') or (Spell = '16') then
begin FixMage(True); Color:= 70145; Coords.x:= 581; Coords.y:= 275; end;
if ((Spell) = 'lumbridge teleport') or (Spell = '17') then
begin FixMage(True); Color:= 2500134; Coords.x:= 610; Coords.y:= 275; end;
if ((Spell) = 'telekinetic grab') or (Spell = '18') then
begin FixMage(True); Color:= 1514278; Coords.x:= 634; Coords.y:= 270; end;
if ((Spell) = 'fire bolt') or (Spell = '19') then
begin FixMage(True); Color:= 265508; Coords.x:= 653; Coords.y:= 275; end;
if ((Spell) = 'falador teleport') or (Spell = '20') then
begin FixMage(True); Color:= 2500134; Coords.x:= 682; Coords.y:= 275; end;
if ((Spell) = 'crumble undead') or (Spell = '21') then
begin FixMage(True); Color:= 1250324; Coords.x:= 702; Coords.y:= 275; end;
if ((Spell) = 'teleport to house') or (Spell = '22') then
begin FixMage(True); Color:= 2105120; Coords.x:= 565; Coords.y:= 301; end;
if ((Spell) = 'wind blast') or (Spell = '23') then
begin FixMage(True); Color:= 1907996; Coords.x:= 588; Coords.y:= 300; end;
if ((Spell) = 'superheat item') or (Spell = '24') then
begin FixMage(True); Color:= 70437; Coords.x:= 609; Coords.y:= 300; end;
if ((Spell) = 'camelot teleport') or (Spell = '25') then
begin FixMage(True); Color:= 2500134; Coords.x:= 634; Coords.y:= 300; end;
if ((Spell) = 'water blast') or (Spell = '26') then
begin FixMage(True); Color:= 2427402; Coords.x:= 660; Coords.y:= 299; end;
if ((Spell) = 'enchant lvl-3 jewelry') or (Spell = '27') then
begin FixMage(True); Color:= 65813; Coords.x:= 685; Coords.y:= 300; end;
if ((Spell) = 'iban blast') or (Spell = '28') then
begin FixMage(True); Color:= 2500134; Coords.x:= 709; Coords.y:= 300; end;
if ((Spell) = 'snare') or (Spell = '29') then
begin FixMage(True); Color:= 2697513; Coords.x:= 565; Coords.y:= 325; end;
if ((Spell) = 'magic dart') or (Spell = '26') then
begin FixMage(True); Color:= 2106650; Coords.x:= 593; Coords.y:= 318; end;
if ((Spell) = 'ardougne teleport') or (Spell = '27') then
begin FixMage(True); Color:= 2500134; Coords.x:= 611; Coords.y:= 322; end;
if ((Spell) = 'earth blast') or (Spell = '28') then
begin FixMage(True); Color:= 72450; Coords.x:= 636; Coords.y:= 325; end;
if ((Spell) = 'high level alchemy') or (Spell = '29') then
begin FixMage(True); Color:= 140325; Coords.x:= 658; Coords.y:= 329; end;
if ((Spell) = 'charge water orb') or (Spell = '30') then
begin FixMage(True); Color:= 2427402; Coords.x:= 686; Coords.y:= 325; end;
if ((Spell) = 'enchant lvl-4 jewelry') or (Spell = '31') then
begin FixMage(True); Color:= 1907996; Coords.x:= 708; Coords.y:= 325; end;
if ((Spell) = 'watchtower teleport') or (Spell = '32') then
begin FixMage(True); Color:= 2429972; Coords.x:= 564; Coords.y:= 350; end;
if ((Spell) = 'fire blast') or (Spell = '33') then
begin FixMage(True); Color:= 30; Coords.x:= 589; Coords.y:= 350; end;
if ((Spell) = 'charge earth orb') or (Spell = '34') then
begin FixMage(True); Color:= 70145; Coords.x:= 613; Coords.y:= 350; end;
if ((Spell) = 'bones to peaches') or (Spell = '35') then
begin FixMage(True); Color:= 726050; Coords.x:= 639; Coords.y:= 350; end;
if ((Spell) = 'saradomin strike') or (Spell = '36') then
begin FixMage(True); Color:= 65828; Coords.x:= 663; Coords.y:= 350; end;
if ((Spell) = 'claws of guthix') or (Spell = '37') then
begin FixMage(True); Color:= 65828; Coords.x:= 683; Coords.y:= 350; end;
if ((Spell) = 'flames of zamorak') or (Spell = '38') then
begin FixMage(True); Color:= 65828; Coords.x:= 704; Coords.y:= 350; end;
if ((Spell) = 'trollheim teleport') or (Spell = '39') then
begin FixMage(True); Color:= 2628636; Coords.x:= 565; Coords.y:= 375; end;
if ((Spell) = 'wind wave') or (Spell = '40') then
begin FixMage(True); Color:= 1907996; Coords.x:= 588; Coords.y:= 370; end;
if ((Spell) = 'charge fire orb') or (Spell = '41') then
begin FixMage(True); Color:= 30; Coords.x:= 610; Coords.y:= 375; end;
if ((Spell) = 'ape atoll teleport') or (Spell = '42') then
begin FixMage(True); Color:= 3604480; Coords.x:= 632; Coords.y:= 372; end;
if ((Spell) = 'water wave') or (Spell = '43') then
begin FixMage(True); Color:= 2427402; Coords.x:= 656; Coords.y:= 30165; end;
if ((Spell) = 'charge air orb') or (Spell = '44') then
begin FixMage(True); Color:= 1907996; Coords.x:= 683; Coords.y:= 370; end;
if ((Spell) = 'vulnerability') or (Spell = '45') then
begin FixMage(True); Color:= 2500134; Coords.x:= 705; Coords.y:= 371; end;
if ((Spell) = 'enchant lvl-5 jewelry') or (Spell = '46') then
begin FixMage(False); Color:= 2359833; Coords.x:= 566; Coords.y:= 347; end;
if ((Spell) = 'earth wave') or (Spell = '47') then
begin FixMage(False); Color:= 72450; Coords.x:= 588; Coords.y:= 350; end;
if ((Spell) = 'enfeeble') or (Spell = '48') then
begin FixMage(False); Color:= 2500134; Coords.x:= 606; Coords.y:= 350; end;
if ((Spell) = 'teleother lumbridge') or (Spell = '49') then
begin FixMage(False); Color:= 1774612; Coords.x:= 636; Coords.y:= 350; end;
if ((Spell) = 'fire wave') or (Spell = '50') then
begin FixMage(False); Color:= 265508; Coords.x:= 658; Coords.y:= 350; end;
if ((Spell) = 'entangle') or (Spell = '51') then
begin FixMage(False); Color:= 991503; Coords.x:= 681; Coords.y:= 351; end;
if ((Spell) = 'stun') or (Spell = '52') then
begin FixMage(False); Color:= 2500134; Coords.x:= 705; Coords.y:= 359; end;
if ((Spell) = 'charge') or (Spell = '53') then
begin FixMage(False); Color:= 2697513; Coords.x:= 566; Coords.y:= 371; end;
if ((Spell) = 'teleother falador') or (Spell = '54') then
begin FixMage(False); Color:= 2697513; Coords.x:= 589; Coords.y:= 370; end;
if ((Spell) = 'tele block') or (Spell = '55') then
begin FixMage(False); Color:= 2628636; Coords.x:= 612; Coords.y:= 371; end;
if ((Spell) = 'enchant lvl-6 jewelry') or (Spell = '56') then
begin FixMage(False); Color:= 65536; Coords.x:= 634; Coords.y:= 372; end;
if ((Spell) = 'teleother camelot') or (Spell = '57') then
begin FixMage(False); Color:= 1774612; Coords.x:= 660; Coords.y:= 372; end;
if(Color > 0)then
begin
if(not(FindColor(x, y, Color, Coords.x, Coords.y, Coords.x, Coords.y)))then
begin
Result:= True;
MMouse(Coords.x, Coords.y, 2, 2);
Wait(20 + Random (10) - Random (20));
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(200 + Random (100) - Random (200));
ReleaseMouse(x + Random (1) - Random (2), y + Random (1) - Random (2), True);
end;
end;
end;