SRL Archive - SRL Archives

procedure SelectSpell(spellnum :integer)


KyleGut3

2006-06-01 18:45:26

It only uses co-ordinates, but it works for me.
Works for all 61 spells that I know of [not a member]


procedure SelectSpell(spellnum :integer);
var
spx, spy, pamt, o, p :integer;
begin
spx:= 564;
spy:= 225;
pamt:= 24;

if(not(GetCurrentTab = 7))then
begin
GameTab(7);
end;

if(spellnum < 8) and (spellnum > 0)then
begin
FixMage(true);
wait(100);
MMouse(spx + (spellnum * pamt) - pamt, spy, 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 15) and (spellnum > 7)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 7) * pamt) - pamt, spy + pamt, 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 22) and (spellnum > 14)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 14) * pamt) - pamt, spy + (2 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 29) and (spellnum > 21)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 21) * pamt) - pamt, spy + (3 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 36) and (spellnum > 28)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 28) * pamt) - pamt, spy + (4 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 43) and (spellnum > 35)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 35) * pamt) - pamt, spy + (5 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 50) and (spellnum > 42)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 42) * pamt) - pamt, spy + (6 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 57) and (spellnum > 49)then
begin
FixMage(false);
wait(100);
MMouse(spx + ((spellnum - 49) * pamt) - pamt, spy + (5 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

if(spellnum < 62) and (spellnum > 56)then
begin
FixMage(true);
wait(100);
MMouse(spx + ((spellnum - 56) * pamt) - pamt, spy + (6 * pamt), 3, 3);
wait(50 + random(50));
GetMousePos(o,p);
wait(50);
HoldMouse(o,p,true);
Sleep(85 + random(10));
ReleaseMouse(o,p,true);
end;

end;

If anyone finds anything wrong with it please tell me the error or how to fix it.

Hope you like, Thanks!

ollie

2006-06-03 09:06:42

nice, maybe make it names then i think it will be put in srl

WT-Fakawi

2006-06-03 09:40:30

Check out magic.scar, already there :D

Wizzup?

2006-06-03 09:43:29

It needs updating though… I'll prolly be doing that soon.

KyleGut3

2006-06-04 15:12:49

I know… i made it a few weeks ago and then I checked magic.scar x.x, but with the new spell it doesn't work completely so I thought I'd post mine. :)

WhiteShadow

2006-06-04 15:45:16

You've made good use of Math with coordinates. Great job!

Jagex_Fagex

2006-06-04 19:25:02

looks pretty food, its already there though. good work anyway

WT-Fakawi

2006-06-04 19:39:19

hmmm. I see a loop somewhere. I think it can be truncated a lot if you use a two dimensional array to store your coords like this:

Spell: array[1..62] of array [1..2] of integer;

I did the same with my sandwichsolver, just to get the coords of the seven boxes, and attach extra info to it.