SRL Archive - Research & Development Lounge

SetupAutoCast


Richard

2009-07-09 02:18:57

Well I've been working on a new auto cast, using a shorter method. I have the coords from the previous spells, but I'm not sure if they work with the new spell buttons. Also there isn't a luminance checker, due to me not current owning an account with access to all the spells.

Here it is, please just tell me if it clicks or not:

Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
Var
SpellNames: Array [0..1] of Array [0..3] of String;
TSA: TStringArray;
i: Integer;
ii, SpellInt: TIntegerArray;
Begin
if not GameTab(1) then Exit;
SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
Mouse(655, ((Integer(not(Defensive)) * 33) + 253), 50, 25, True);
TSA := srl_Explode(Spell, ' ');
For i := 0 to 1 do
For ii[i] := 0 to 3 do
If (TSA[ii[i]] = SpellNames[i][ii[i]]) then
Begin
SpellInt[i] := ii[i];
Break;
end;
Mouse(((SpellInt[0] * 40) + 503), ((SpellInt[1] * 61) + 124), 3, 3, True);
end;

Just start logged in, it should do that rest.


Note: I've only been working on this for about half an hour, so it may look a bit scruffy.

Thanks

EDIT: Due to the new gametabs, just comment out that line, and start on the first gametab.

Blender

2009-07-09 05:21:44

Hmmm…

I will be including this in my Demon Taunter script.

Too bad reflection isn't working though…

Naum

2009-07-09 23:31:18

From: Richard
Well I've been working on a new auto cast, using a shorter method. I have the coords from the previous spells, but I'm not sure if they work with the new spell buttons. Also there isn't a luminance checker, due to me not current owning an account with access to all the spells.

Here it is, please just tell me if it clicks or not:

Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
Var
SpellNames: Array [0..1] of Array [0..3] of String;
TSA: TStringArray;
i: Integer;
ii, SpellInt: TIntegerArray;
Begin
if not GameTab(1) then Exit;
SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
Mouse(655, ((Integer(not(Defensive)) * 33) + 253), 50, 25, True);
TSA := srl_Explode(Spell, ' ');
For i := 0 to 1 do
For ii[i] := 0 to 3 do
If (TSA[ii[i]] = SpellNames[i][ii[i]]) then
Begin
SpellInt[i] := ii[i];
Break;
end;
Mouse(((SpellInt[0] * 40) + 503), ((SpellInt[1] * 61) + 124), 3, 3, True);
end;

Just start logged in, it should do that rest.


Note: I've only been working on this for about half an hour, so it may look a bit scruffy.

Thanks

EDIT: Due to the new game tabs, just comment out that line, and start on the first game tab.


Lol, that's much better than my one, post it in Pub SVN to get it added.

EDIT: Great work, but remember to add the mouse function for if it's not found.

Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
Var
SpellNames: Array [0..1] of Array [0..3] of String;
TSA: TStringArray;
i: Integer;
ii, SpellInt: TIntegerArray;
Begin
if not GameTab(1) then Exit;
SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
Mouse(655, ((Integer(not(Defensive)) * 33) + 253), 50, 25, True);
TSA := srl_Explode(Spell, ' ');
For i := 0 to 1 do
For ii[i] := 0 to 3 do
If (TSA[ii[i]] = SpellNames[i][ii[i]]) then
Begin
SpellInt[i] := ii[i];
Break;
end;
Mouse(((SpellInt[0] * 40) + 503), ((SpellInt[1] * 61) + 124), 3, 3, True);
If Not SpellInt[0] <> 0 Then
Begin
srl_Warn('SetUpAutoCast', '"' + AutoSpell + '" is not a valid autocasting spell.', -2);
Mouse(687, 448, 9, 4, True);
End;
end;

Richard

2009-07-10 01:00:50

From: NaumanAkhlaQ
Lol, that's much better than my one, post it in Pub SVN to get it added.

EDIT: Great work, but remember to add the mouse function for if it's not found.

Procedure SetupAutoCast(Spell: String; Defensive: Boolean);
Var
SpellNames: Array [0..1] of Array [0..3] of String;
TSA: TStringArray;
i: Integer;
ii, SpellInt: TIntegerArray;
Begin
if not GameTab(1) then Exit;
SpellNames[0] := ['wind', 'water', 'earth', 'fire'];
SpellNames[1] := ['strike', 'bolt', 'blast', 'wave'];
Mouse(655, ((Integer(not(Defensive)) * 33) + 253), 50, 25, True);
TSA := srl_Explode(Spell, ' ');
For i := 0 to 1 do
For ii[i] := 0 to 3 do
If (TSA[ii[i]] = SpellNames[i][ii[i]]) then
Begin
SpellInt[i] := ii[i];
Break;
end;
Mouse(((SpellInt[0] * 40) + 503), ((SpellInt[1] * 61) + 124), 3, 3, True);
If Not SpellInt[0] <> 0 Then
Begin
srl_Warn('SetUpAutoCast', '"' + AutoSpell + '" is not a valid autocasting spell.', -2);
Mouse(687, 448, 9, 4, True);
End;
end;


This so far only works in theory, I have no colours or anything added, just the mathematical part sorted right now.

If I could steal some colours it would be greatly appreciated :)

Naum

2009-07-10 01:10:52

No prob ;).
You doing great man!

Richard

2009-07-10 01:19:23

Although there seems to be a slight problem, apparently the Integer() function has been changed inside the SRL Library, and False = -1 and True = 0, which means a slight change in the first mouse movement.

Thanks for the help so far

Naum

2009-07-10 01:25:55

From: Richard
Although there seems to be a slight problem, apparently the Integer() function has been changed inside the SRL Library, and False = -1 and True = 0, which means a slight change in the first mouse movement.

Thanks for the help so far


False is 0, and Not Defence should give -2 (in Defence is True) if i'm not mistaken.

Richard

2009-07-10 01:30:01

Nope, tested for myself:

True = 1
False = 0