Log in

View Full Version : Question



wasfer
11-15-2011, 11:55 AM
How do i make this part of code only do CheckRunes; procedure if, it had failed to click on spell, currently the code is doing CheckRunes; every single time. Thanks.

Procedure Spell;
var
x, y, I, Timer1, Timer2: Integer;
begin

if(GetCurrentTab = 28) then
MMouse(601, 341, 2, 2)
else
begin
Writeln('Magic tab not open, opening it!');
Gametab(28);
MMouse(601, 341, 2, 2)
Wait(200 + Random(100));
end;

if WaitUptext('lch', 100) then
Begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Writeln('Clicked on the spell!');
end else
Writeln('Failed to cast spell,Checking if we got runes!');
MMouse(602, 342, 2, 2)
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
CheckRunes;

end;
Also if i leave out the -
MMouse(602, 342, 2, 2)
GetMousePos(x, y);
Mouse(x, y, 0, 0, true); - it will not click on the spell and will just check for runes :/(Not always, at start it does not use this part of code to click on spell.)(like 2-3 runs)

cycrosism
11-15-2011, 12:04 PM
Change this


if WaitUptext('lch', 100) then
Begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Writeln('Clicked on the spell!');
end else
Writeln('Failed to cast spell,Checking if we got runes!');
MMouse(602, 342, 2, 2)
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
CheckRunes;

end;

To this



if WaitUptext('lch', 100) then
Begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Writeln('Clicked on the spell!');
end else begin
Writeln('Failed to cast spell,Checking if we got runes!');
MMouse(602, 342, 2, 2)
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
CheckRunes;
end;
end;


And tell me if that works

wasfer
11-15-2011, 12:10 PM
Thanks! It did fix the problem.

Dynamite
11-15-2011, 12:13 PM
Thanks! It did fix the problem.
Do you understand what he changed?

-Boom

wasfer
11-15-2011, 04:39 PM
Do you understand what he changed?

-Boom

What that has to do with anything? But yes i did understand.

Markus
11-15-2011, 05:14 PM
What that has to do with anything?

It has to do with everything! It's a fundamental mistake you made and for that reason alone you would need to understand it in order to actually learn something related to scripting.

Dynamite
11-15-2011, 11:33 PM
What that has to do with anything? But yes i did understand.

What Markus said +
This is a community about learning, not about leeching. Now I congratulate you for starting to learn scripting but bare in mind, every where you go, people will try and help you learn :)

-Boom

wasfer
11-16-2011, 11:41 AM
Not everywhere, just here it seems. Here people have time to post answers that actually help other than just random guesses.