Code:
program ZamMageTrainer;
{$DEFINE SMART}
{$I Aerolib/Aerolib.simba}
//{$i reflection/Reflection.simba}
Procedure CountSpellXP
var
xp: Integer;
begin
end
Procedure ClickSpell
var
p:TPoint;
begin
if (getCurrentTab = TAB_MAGIC) then
begin
begin
p := point(669, 255); //Setting TPOINT to where spell is
humanMMouse(p,random(10),random(10));
wait(RandomRange(20,60));
if waitUpTextMulti(['ast', 'Cu'],100) then //Waits and checks for uptext for 100ms!
begin
writeln('found spell!');
wait(randomRange(10,50));
fastClick(Mouse_left);
end
else
begin
writeln('Cannot find UpText!');
end
end
end
else
begin
FTab(TAB_MAGIC);
WriteLn('Changing to magic tab')
end
end
Procedure ClickEnemy
var
color_Item : TColEx;
TPA : TPointArray;
ATPA : T2DPointArray;
pnt : TPoint;
i : Integer;
begin
color_Item.create(2567281, 12, 0.04, 0.14); //replace color, tolerance, hue and sat with respective values (from ACA)
if color_Item.findAllIn(Area_MS, TPA) then
begin //should be a begin here
ATPA := ClusterTPAEx(TPA, 10, 10); //split these into 5x5 boxes, change these parameters as you like
SortATPASize(ATPA, true); //sort big first, these are the ones who we will search first
//DebugATPABounds(ATPA); //SHOWS DEBUG SCREEN
for i := 0 to high(ATPA) do
begin
pnt := MiddleTPA(ATPA[i]); //set our pnt to the middle of the ATPA
HumanMMouse(pnt, random(5), random(5)); //move the mouse to our point
if isUpTextMulti(['Cas', 'onk', 'of', 'Zam']) then //if the uptext is what we want it to be
begin
Wait(RandomRange(20, 200));
fastClick(Mouse_left);
//FastClick(Mouse_right);
//Wait(RandomRange(20, 200));
//ChooseOptionMulti(['Cast', 'We','aken']);
break; //("break" out of the for..to..do loop, we found our point)
end;
end;
end
else
begin
writeln('Could not find ZamMage!');
end
end
procedure AntiBan; // ANTIBAN taken from FoolPottatoMashAL foolmonstermashalpha
begin
writeln('Performing antiban');
case random(400) of
//0..10: examineInv();
11..20: boredHuman();
21..30: pickUpMouse();
31..40: HoverSkill('magic', False);
41..50: randomRClick();
51..60: SleepAndMoveMouse(random(1000));
61..70: randomFKeys(true);
71..80: randomTab(true);
81..90: checkMovingObjs(true);
91..100: MMouseOffClient('random');
101..110: MMouseOffClient('top');
111..120: MMouseOffClient('bottom');
121..130: MMouseOffClient('left');
131..140: MMouseOffClient('right');
141..150:RandomMovement;
151..160:RandomTab(true);
161..170:RandomRClick;
171..180:compassMovement(20,60,False);
end;
end;
begin
initAL;
repeat
dismissedRandoms;
ClickSpell;
ClickEnemy;
if (random(100) >=90) then AntiBan;
wait(800+RandomRange(200,600));
until(false)
end.
Please help me improve my script! I have a few questions:
-Is there a way to do an if statement with a not in it? Like:
Code:
if (getCurrentTab !(not)= TAB_MAGIC) then...
-What other error checking could I add / how would I do this? - If I run out of runes it keeps clicking even though no spell is cast, learning how to tell if a spell was cast would also let me help finish the XP earned proggy
-How would I go about dealing with randoms? Currently if a random appears nothing happens.
Thank you all for any help!