SRL Archive - Help and Support

Cast Spell


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.

{*******************************************************************************
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;

Pyro

2006-07-05 16:47:35

It will Cast it onyl once…….After a quick look through Function. I think what it will do is it will result in either true or false If you have enough runes to do it. Try it in a script. Sometimes its better just to test for yourself then post and wait for a reply.

muna580

2006-07-05 16:57:03

See I have created an Auto Teleporter. I used this funcation to keep teleporting again and again at the same location.

The problem with this funcation is that its not human like when you keep using it ever second and that it takes too long.

What it does is, it clicks on the invetory. Then clicks on the spell book. Then it cast's spell. Then again it clicks on the inventory, spell book, cast spell.

It keeps repeating that process. This process takes too long. So I thought, it would be a good idea if there was a funcation that doens't click on the inventory. It should only click on the spell.

Then what I can do is, I can make the non clicking inveotry function reapeat again and again. Then at random times, I an make the origainal funcation run 1 or 2 times. Then agian keep repating the non clicking inveontory funcation.

This way, it is humanlike and it doens't take longer.

I just need help editing that function above so it doens't click on invtory to check if there are enough runes.

c0de

2006-07-05 17:04:09

I belive that FindNormalRandoms; switches to backpack

muna580

2006-07-05 17:11:33

From: c0de
I belive that FindNormalRandoms; switches to backpack

:confused: ??????

realrune

2006-07-05 18:06:37

From: muna580
:confused: ??????

Yep, FindNormalRandoms switches to GameTab(4) (the inventory) to check for boxes and lamps.

Basically saying that you probably have findnormalrandoms switching it back to gametab(4).

Cast has nothing to do with the problem.

muna580

2006-07-05 18:37:10

So how would I set FindNormalRandom so it be like ever x mins. Or how do i make FindNormalRandom to not click on gametab 4.

Spky

2006-07-06 16:57:04

Meh rip mine :p,

procedure AntiRandomsEvery;
begin
if ((TimeFromMark(RandomsMark) / 1000) / 60 >= RandomsRandom) then
begin
if(not(LoggedIn))then
Exit;
SolveMatrix;
if(FindFight)then
begin
PerfectNorth;
RunAway;
end;
FindNormalRandoms;
GetLawAmount;
MarkTime(RandomsMark);
RandomsRandom:= 1 + Random (4);
end
else
begin
if(TeleType[CurrentPlayer] = 'Teleport')then SolveMatrix;
if(not(LoggedIn))then
Exit;
if FindFight then
begin
PerfectNorth;
RunAway;
end;
CloseWindow;
FindTalk;
FindDead;
FindMod;
FindMime;
FindMaze;
FindQuiz;
FindDemon;
FindScapeRune;
FindTalk;
FindTrade;
if NoGameTab then
begin
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
SaveToChatLog;
Wait(5);
end;
end;

You'll need to edit it to suite your script.