YoHoJo
2011-12-10 18:17:42
function Cast(Spell: string; AutoCast: Boolean): Boolean;
var
X, Y: Integer;
B: TBox;
SInfo: TSpell;
begin
if not LoggedIn then
Exit;
SInfo := GetSpellInfo(Spell);
if AutoCast then
if not SInfo.AutoCast then
begin
srl_Warn('Cast', Spell + ' is not autocast-able', warn_AllVersions);
Exit;
end;
if not SpellAvailable(B, Spell) then
Exit;
GetMousePos(X, Y);
if AutoCast then
begin
if not WaitUpTextMulti(['Autocast', 'ocast', 'utoca'], 300+Random(100)) then
Exit;
if not(CountColor(16711422, B.X1-10, B.Y1-10, B.X2+10, B.Y2+10) > 50) then
begin
Mouse(X, Y, 0, 0, True);
Result := True;
end;
Exit;
end;
Mouse(X, Y, 0, 0, not SInfo.AutoCast);
if SInfo.AutoCast then
Result := WaitOptionMulti(['Cast', 'ast', 'Cas'], 300+Random(100))
else
Result := WaitUpTextMulti(['Cast', 'ast', 'Cas'], 500+Random(100));
end; If user already has the spell set to autocast (There is a colored box around the spell, then when calling this function like
Cast('fire strike', True); it results false! It should result true, AND cast the spell like it's being told.
Currently, it just goes to magic tab, hovers the spells for a split second, and then (because of my script Logs out).
I unno, someone check it out? :D