HippestTrip
2016-04-21 00:00:42
From: Incurable
You can also add =1 to the first tag to add line numbers, like this:YOUR CODE HERE[simba]
I've taken the liberty of fixing up a lot of your script. I've commented what I've changed, and it should be explained well enough. If you have any questions, shoot.
[simba=true]program HeadlessArrow;
{$define smart}
{$i Reflection/Reflection.Simba}
// Use camelCase or PascalCase for procedure/function/variable names. It makes
// it a lot easier to read for you and anyone else who reads the script for any
// reason. This is a part of basic standards and is very important. The sooner you
// learn to use standards, the sooner you can write clean, functional scripts. :)
procedure findShaft;
var
x, y: integer; // Space between : and the variable type
// This line is blank to make it easier to differentiate
begin
if FindColorSpiralTolerance(x, y, 138811 ,575, 227, 583, 229, 100) then
begin // You only need one begin here
MoveMouse(x,y);
ClickMouse(x,y, 1)
Wait(2500+random(233)); //MY EDIT IS HERE if I don't put a begin before this it returns an operator error at the "wait"?
MoveMouse(622,227);
Wait(2500+random(123));
ClickMouse(622,227,1);
Wait(2500+random(100));
MoveMouse(254,423);
Wait(2500+random(100));
ClickMouse(254,423,1);
Wait(2500+random(124));
end; // You only need one end here. Each begin should have a matching end, but
// only when you actually need them
// No begin/end necessary. You've ended your if statement, but there's
// no need to tell the script to begin again because this is all inside of the
// one findShaft procedure. You'll notice that we're doing all of this inside of
// findShaft's begin/end keywords. ;) Click on a begin or end to see its matching
// one highlighted. Very useful! :D
MoveMouse(644,484);
Wait(2500+random(224));
ClickMouse(644, 484, 1);
Wait(2500+random(223));
MoveMouse(637,419);
wait(2500+random(223));
ClickMouse(637,419, 1);
end;
procedure doAntiBan; // Again, camelCase procedure name.
begin
case random(10) of
0..10: begin
TReflectionAntiban.RandomRClick; // Notice that this is all PascalCase?
TReflectionAntiban.PickUpMouse; // Much easier to read than this:
TReflectionAntiban.HumanRandomMouse; // treflectionantiban.exmaineinv
TReflectionAntiban.ExamineInv;
end;
end;
end;
procedure dummyProcedure;
begin
writeLn('This writes this line!');
end;
// This is your "main" procedure. Your script is executed line by line in this
// procedure. Only what's in here is executed, dummyProcedure will never be
// called unless we add it. Try adding it before "Reflect.Setup" and note that
// it will be called first before anythinge else.
begin
Reflect.Setup; // Added indentation
// Space for clean code
repeat
findshaft;
until(false); // repeat..until is a post-test loop. It is going to repeat
// findShaft until the boolean (true/false) condition within
// the parentheses () is true. Since you've given it the boolean
// false, and this can never be changed to true, this loop will
// run forever. This is also known as an infinite loop.
end.
I'd also seriously suggest that you read this, followed by this, followed by this. It's amazing that you're willing to learn, but you need to be learning the right way in the right order. Those three tutorials will absolutely kick off your coding ability.
Have fun!
ive made an edit inside this post with a problem im having.