SRL Archive - Help

Question


wasfer

2011-11-15 06:55:33

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

2011-11-15 07:04:31

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

2011-11-15 07:10:29

Thanks! It did fix the problem.

Dynamite

2011-11-15 07:13:29

From: wasfer
Thanks! It did fix the problem.

Do you understand what he changed?

-Boom

wasfer

2011-11-15 11:39:56

From: Dynamite
Do you understand what he changed?

-Boom


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

Markus

2011-11-15 12:14:18

From: wasfer
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

2011-11-15 18:33:03

From: wasfer
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

2011-11-16 06:41:49

Not everywhere, just here it seems. Here people have time to post answers that actually help other than just random guesses.