SRL Archive - Help

How would I write this in Simba


Near

2011-11-18 03:56:37

Anywase, trying to do something simple, but don't know how I'd do it in Simba.

This is how it would look in Java (I think).

Boolean continue = true;
while (continue){
continue = false;
if ("condition"){
“then”
}
else {
continue = true;
}

So pretty much, keep checking for the condition to be true, until it is true, then have 'then' happen once.

Could someone show me how to do this .

Edit: Also just realized wrong section, my bad.

i luffs yeww

2011-11-18 04:08:38


repeat
Wait(Random(500));
until(Condition);
if(Condition)then
DoWhatever;

I guess? PascalScript has while loops, too. (while(something)do whatever)

Near

2011-11-18 04:36:52

It worked, thanx

YoHoJo

2011-11-18 04:40:37

What kind of a script are you working on if you don't mind me asking? Feel free to aak any and every question you have here we love to help!

Near

2011-11-18 04:50:36

Cheat for Dragon Dyce. Took me like 1-2 hours to make from pretty much no knowledge of SIMBA at all :x

program Talk;
{.include SRL/SRL.scar}

Var
Typed: Integer;
X, Y : Integer;

Const

Text = '';
Times = 1;


procedure TalkIt;
begin
Repeat
Wait(Random(1));
until(FindColor(X, Y, 16711680, 292, 641, 292, 641));
Repeat
if FindColor(X, Y, 16711680, 292, 641, 292, 641) then
TypeSend(Text);
Typed := Typed + 1;
Until(Typed >= Times);
end;


begin
SetupSRL;
ActivateClient;
TalkIt;
end.

Just modified a code for an autotyper so it worked like this :(

x[Warrior]x3500

2011-11-18 05:26:17

change ur procedure talkit to:

procedure TalkIt;
begin
Repeat
Wait(Random(1));
if FindColor(X, Y, 16711680, 292, 641, 292, 641) then
begin
TypeSend(Text);
Typed := Typed + 1;
end;
Until(Typed >= Times);
end;

why? well there are two repeats and that in itself is not necessary; so i combined them. also, you used the if() statement, and it was pointless, because it JUST checked for that statement to be true. and you incremented typed EVERY time it passed through the second repeat loop (not only if you actually typed something).

this code gets rid of all the bugs, and is a little easier to read IMO.

Sir R. M8gic1an

2011-11-18 08:31:51

you really want to make that wait longer;

Wait(Random(1)) will always wait 0 msec. Id suggest about 50 ms.

And I'd also suggest you search for specific text, using the chat box functions.

-RM