View Full Version : How would I write this in Simba
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
11-18-2011, 09:08 AM
repeat
Wait(Random(500));
until(Condition);
if(Condition)then
DoWhatever;
I guess? PascalScript has while loops, too. (while(something)do whatever)
YoHoJo
11-18-2011, 09:40 AM
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!
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
11-18-2011, 10:26 AM
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
11-18-2011, 01:31 PM
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
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.